short · 3 min
When does long context beat retrieval?
Putting whole documents in the prompt instead of retrieving pieces: better answers on broad questions, more cost on every call.
updated 27 Sept 2026
Here's a result from a test at Google. They asked models the same questions two ways: once with the whole text in the prompt, and once with only the five best-matching chunks, the usual RAG setup. For 63% of the questions, the two answers came out exactly the same.
So why would we ever send the whole thing? It's a fair question now that a context window can hold hundreds of pages. Sending everything means no chunking to tune and no search that can miss the right page. But we pay for every token of it, on every call, and the answer is the same most of the time.
When the whole text wins
Overall, sending everything did win on quality, for all three models tested (2024 models), by about 4 to 13 percent. And RAG was much cheaper, since API pricing is per input token. So the gain comes from the minority of questions where the answers differ. What were those?
They had a pattern. They needed several steps of reasoning across the text. Or they were broad, about the text as a whole rather than one fact in it. Or they were long and complicated themselves. Or the answer was implied across the text, never stated in one place. Five chunks can't cover any of those. A lookup for one fact, they handle fine.
Two results went the other way. When the text was much bigger than a model's window, retrieval won, because the long version had to be cut off to fit. And when retrieval sent more than 50 chunks, the two scored about the same.
Try the cheap way first
That 63% suggests a router, and the same team built one. Send the question with the retrieved chunks and ask the model whether it can answer from them. If yes, done. If it says no, send the full text.
Most questions stopped at the first step: 57% for one model, 82% for another. Answers stayed about as good as always sending everything, and cost dropped by 39% and 65%. One model used only 38.6% of the tokens it would have used otherwise.
A rule of thumb
Anthropic's advice from 2024 was blunt: if your whole knowledge base is under about 200,000 tokens (roughly 500 pages), skip retrieval and put it all in the prompt. Prompt caching, which lets the provider reuse a prompt it's seen before, makes that cheaper; they said it cut latency by more than half and cost by up to 90%. Past that size you need retrieval.
That number will move as windows grow, but the idea holds. If your data fits comfortably and the cost per call is fine, try the simple version first and only build a pipeline when you have a reason.
Fitting isn't the same as being used well, though. Models get less precise as the window fills, and where the key passage sits in a long prompt can matter too (lost in the middle).
And it's worth being honest about what we don't know. "Long" in those tests meant around 7,000 words on one benchmark and about 100,000 tokens on the other, and the models were from 2024. Bigger windows and newer models may shift the balance either way. None of the sources here tested 2026 models, so measure it on yours.
Further reading
- Retrieval Augmented Generation or Long-Context LLMs?, Li et al. (Google DeepMind), 2024. The head-to-head, the 63% result, why retrieval fails, and the router. The one to read.
- Introducing Contextual Retrieval, Anthropic, 2024. Mostly about something else, but the "under 200,000 tokens, put it all in" rule is near the top.