Skip to content
AI Skill Index

Retrieval beats a bigger context window

Long context made 'paste everything' possible. It did not make it a good idea, and the reason is measurable.

Editorial·2 min read·
Sign in to save

Context windows are now large enough to hold a small codebase or a few hundred pages. The obvious move is to stop being clever and paste everything in. It is worth understanding why that degrades before relying on it.

Attention is not uniform

Models attend unevenly across a long input. Material at the beginning and end is used more reliably than material in the middle — the effect is well documented and does not go away with a larger window.

The practical form: a fact on page 3 of 200 may be present and unused. Not refused, not flagged. Just quietly not incorporated, while the answer is written with the same confidence as one that used it.

Irrelevant context is not free

Adding material that does not bear on the question makes answers worse, not merely more expensive. More candidate information means more ways to construct a plausible answer, and some of those are wrong.

"Include it just in case" is the intuition to give up. The cost is not only tokens.

The three real costs

Money, linear in tokens, on every call — a padded prompt reused a million times is a budget line.

Latency, which changes what people build. A three-second response is a different product from a three-hundred-millisecond one.

Cache invalidation. Prompt caching pays off when a long prefix is stable. Rebuilding the whole context per request forfeits it, and that is usually a bigger cost than the tokens.

What to do instead

Retrieve the relevant part and pass that. Concretely:

  • Chunk on structure, not character count. A section, a function, a table. Chunks that cut mid-argument retrieve badly because neither half means anything alone.
  • Combine keyword and semantic search. Pure embeddings miss exact identifiers — error codes, function names, SKUs — which are precisely what technical questions are about.
  • Rerank. Retrieve twenty, rerank, pass five. Cheap, and the largest single quality gain in most retrieval systems.
  • Cite. If the model names the chunk it used, wrong answers become traceable to either bad retrieval or bad reasoning, and those need different fixes.

When long context is right

Genuinely: when the material is a single coherent argument that must be understood as a whole, when it is short enough to sit well inside the window rather than at its edge, and when it is stable enough to cache.

A contract, a paper, one long file. Not a corpus.

ShareXLinkedIn

Cookies

We use only the cookies this site needs to work. Optional analytics helps us see which content is worth writing more of — nothing loads until you say yes.

Read the privacy policy