FDE Times dataFDE jobs open 913▼15 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 69Companies hiring 200Remote-friendly 24%Median US pay $200kTop hirer Databricks 106
中文VI

The newspaper of the Forward Deployed Engineer

Analysis

Context windows hold 5,000 pages, but past 500 you still need RAG

Models often miss information buried in the middle of long contexts, so FDEs have to make the case to clients on accuracy, latency and cost.

ShareLinkedInFacebookX

In brief

  • A 2-million-token window holds about 5,000 pages. According to Anthropic, a knowledge base under 200,000 tokens (about 500 pages) can go into the prompt whole, without RAG.
  • Long context costs disproportionately more, the first token can take over 2 minutes to arrive, and models make much poorer use of information in the middle of the context.
  • RAG and long context draw on the same token budget. For large document sets, the answer is to combine the two rather than pick one.
Horizontal bar chart comparing two thresholds measured in pages. Gemini 1.5 Pro's 2 million-token context window equals about 5,000 pages. The 200,000-token level at which Anthropic says a whole knowledge base can go into the prompt without RAG is only about 500 pages. A bracket marks the tenfold gap between the two. The article calls this the zone for combining retrieval with long context.
The context window holds about 5,000 pages, but the safe threshold for dropping RAG is only about 500 pages. Source: Google Cloud (Gemini 1.5 Pro), Anthropic.

According to Google Cloud, Gemini 1.5 Pro has a context window of up to 2 million tokens, roughly 5,000 pages of text. Anthropic sets a much lower bar: a knowledge base under 200,000 tokens, about 500 pages, can go into the prompt whole, without RAG.

The two figures are ten times apart. Most of the work of designing document Q&A systems for clients, and most of the arguments in their meeting rooms, happens in that gap.

On a client site, the question comes up early. An IT manager who has just read about million-token contexts will ask why your team is spending two weeks building chunking, embeddings and a vector store. Answer “RAG is best practice” and you have already lost. You need to argue in three terms the client understands: accuracy, latency and the bill.

A wide window does not mean a careful reader

The strongest evidence against stuffing a whole corpus into the prompt comes from “Lost in the Middle”, the paper by Liu and colleagues published in TACL in 2024. The authors showed that performance drops markedly when the information a model needs sits in the middle of a long context, compared with when it sits at the beginning or the end.

The finding holds even for models designed specifically for long context.

Introl, an AI infrastructure company, draws the practical conclusion: enterprises cannot assume that “more context is better”. Say so plainly to the client, because their intuition leans the other way.

Take a 400-page set of insurance rules whose most important exclusion clause sits on page 200. Put the whole set in the prompt and that clause lands exactly where the model is most likely to miss it. With RAG, the passage is retrieved and placed right next to the question, where the model uses it well.

So the first job on a client site is to measure, before choosing an architecture. Insert a distinctive factual sentence at the start, middle and end of the client’s real documents, ask about it, and count how often the model answers correctly at each position.

The bill grows faster than the page count

Even when accuracy is acceptable, cost remains a problem. IBM explains that compute requirements grow quadratically with sequence length. Introl makes the same point in terms a budget holder will follow: the relationship is non-linear, and longer contexts become disproportionately expensive.

A quick calculation makes it concrete. A lean RAG prompt of about 10,000 tokens and a full-corpus prompt of 1 million tokens differ by a factor of 100 in token count. Apply the quadratic rule and the corresponding compute could differ by up to 10,000 times for the same question.

That calculation applies the quadratic rule to the entire prompt, so treat 10,000 times as an upper bound for illustration rather than the real difference on an invoice. It is still useful for showing a client that the bill grows faster than the number of pages.

Even Google, which sells the 2-million-token window, acknowledges that long-context queries typically increase processing time and require more compute. Introl puts a number on it: at maximum context length, users may wait more than 2 minutes before the model starts generating.

Clients who host their own models, such as a bank required to run on-prem, face a further obstacle. According to Introl, a 70-billion-parameter model with a 128K context needs about 40GB of KV cache per user. With 50 employees asking questions at once, the KV cache alone would need about 2,000GB of memory, before counting the model weights.

In customer discovery, then, do not stop at asking how long the document set is. Ask how many concurrent users there will be, how long they will wait for an answer, and whether the system runs in the cloud or in the client’s data center.

Under 500 pages, put the whole corpus in

None of this makes long context useless. Anthropic is fairly blunt: a knowledge base smaller than 200,000 tokens can go entirely into the prompt, without RAG. What makes this workable is prompt caching, which Anthropic says cuts latency by more than 2x and costs by up to 90%.

IBM describes the general mechanism: prompt caching reduces the tokens processed, API costs and latency for repeated or similar requests. “Repeated” is the key condition. Caching works best when the documents at the top of the prompt rarely change while the questions change constantly.

Consider a company’s 300-page HR policy handbook, revised a few times a year and fielding hundreds of questions a day. It is the ideal case for putting the whole corpus in the prompt and caching it. Building RAG here means spending two weeks solving a problem the client does not have.

If the documents change hourly, as price lists or inventory do, the cache is constantly invalidated and the cost advantage shrinks. Check this reasoning against real measurements before making promises to the client.

Above that line, RAG gets an upgrade

Now take a corpus of 20,000 pages of contracts, four times the roughly 5,000 pages that Google’s 2-million-token window can hold. At this scale there is nothing to debate: retrieval is mandatory.

The question becomes how to retrieve better. Anthropic reports that Contextual Embeddings, a technique that attaches context from the whole document to each chunk before embedding, reduces the top-20 chunk retrieval failure rate by 35%.

The most overlooked detail in the whole debate is in an explanation from IBM: the content RAG retrieves also sits in the context window at inference time. RAG and long context are not rival camps; they share the same token budget.

That is why Introl recommends a hybrid approach, combining long context with retrieval so that critical information is reliably surfaced. A large window lets you retrieve more generously, bringing in complete sections instead of fragments. Retrieval, in turn, ensures the decisive passage is not buried in the middle.

Corpus size Sensible approach Main risk First task on the client site
Under 200,000 tokens (~500 pages) Put the whole corpus in the prompt, turn on prompt caching Frequently changing documents defeat the cache Measure how often documents are updated and how many questions arrive each day
200,000 to 2 million tokens (~500 to 5,000 pages) Hybrid: retrieve broadly, use the long window for full sections Lost in the middle, non-linear cost, long waits at the top of the range Run the start, middle and end fact-insertion test and measure latency
Over 2 million tokens (over ~5,000 pages) RAG is mandatory; improve retrieval (e.g. Contextual Embeddings) Retrieval misses the decisive passage Build a standard question set to measure the top-20 miss rate

The table is only a starting point. The real boundaries depend on the number of concurrent users, the latency limit and whether the client runs in the cloud or on-prem, things you only learn after sitting down with them.

What developers should practice from this debate

The most valuable skill here has little to do with memorizing any particular vector store’s API. It is the ability to turn “context or RAG?” into three numbers measured on the client’s data: accuracy by information position, time to first token, and cost per thousand questions.

Get into the habit of counting tokens with a real tokenizer instead of estimating from page counts. The figure of about 400 tokens per page that both Google and Anthropic implicitly use is only an approximation, and a client’s documents may be full of tables, contract codes or scanned text. Misjudge by an order of magnitude at this step and you pick the wrong architecture altogether.

When reading job descriptions for FDE or AI engineer roles, watch for phrases such as retrieval evaluation, latency budget and on-prem deployment. They signal that the company is wrestling with exactly this problem.

On a CV, instead of writing “built a RAG chatbot”, say that you compared full context with RAG on a corpus of so many pages, what you measured, which approach you chose and why, with your own numbers.

Context windows will keep growing. The question clients pay you to answer stays the same: which tokens deserve a place in the window, and where should they go?

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
6 sources
Read next on the roadmap · Stage 3: Applied AIClients pay for reasoning tokens they will never readReasoning is a dial to measure per workload, and the case that convinces a client comes from evals on its own data, not benchmarks.