AI architecture · RAG

Long context or RAG? What the research says about very large context windows

Context windows have grown from a few thousand tokens to hundreds of thousands and more. It's tempting to stop building retrieval and just put everything in the prompt. The research suggests that bigger windows change the trade-offs, but don't remove them.

EssaySumanta Mukhopadhyay9 min read5 sources
#ai#rag#llm#platform
ESSAY · AI ARCHITECTURE · RAG23 Oct 2026 · 04:15 GST

Every few months a model ships with a bigger context window, and the same question comes up: do we still need retrieval? If the model can read the whole policy manual, the full contract set or a year of support tickets in one go, why maintain chunking, embeddings, indexes and ranking at all?

It's a fair question, and for some workloads the answer really is "less than before". But the research on how models use long inputs is consistent enough that I don't treat a large window as a substitute for deciding what the model should read.

Three findings worth knowing

Position matters. In "Lost in the Middle", Liu and colleagues studied how models use long inputs in tasks such as multi-document question answering. Performance was often highest when the relevant information appeared at the beginning or end of the context and dropped when it was in the middle1. A later survey of long-context modelling describes this as a U-shaped curve5. The practical implication: where a fact sits in a long prompt can change whether it's used.

Advertised windows overstate useful windows. NVIDIA's RULER benchmark extended simple needle-in-a-haystack tests with harder tasks such as multi-hop tracing and aggregation. Models that scored almost perfectly on the simple test showed large drops as context length grew, and the authors report that many models fell below their quality threshold well before reaching their claimed context lengths2. Finding one sentence in a haystack is a much easier job than reasoning across a long document.

Longer inputs degrade reliability. Chroma's 2025 "Context Rot" report tested 18 models, including several frontier models, on deliberately simple tasks, keeping difficulty constant while increasing input length. Performance grew increasingly unreliable as input grew, and models didn't use their context uniformly3. The authors note that real tasks are more complex, so the effect may be larger in practice, and they published their code for replication34.

A model that can accept a million tokens has not promised to use all of them equally well. Capacity and attention are different things.

The other costs of stuffing the context

Quality isn't the only issue. Every token in the prompt costs money and adds latency on every request, unless the same prefix is cached and reused, which I cover in LLM inference serving. Long prompts are also harder to debug: when an answer is wrong, it is much harder to tell which of 200 pages misled the model than which of five retrieved passages did.

There's a governance cost too. Retrieval enforces access control naturally: you only fetch documents the user is allowed to see. "Put everything in the prompt" either ignores permissions or rebuilds them in a less tested way. For regulated data, that alone usually settles the question, as discussed in the HIPAA Security Rule proposal and UAE health data localisation.

When long context genuinely helps

None of this means long context is a gimmick. It changes what good retrieval looks like:

  • Bigger, more coherent chunks. Instead of 300-token fragments, retrieve whole sections or whole documents, so the model sees definitions and exceptions alongside the rule.
  • Single-document deep work. Reviewing one contract, one codebase module or one patient record against a checklist is a good fit, especially with the most important material placed at the start or end.
  • Fewer retrieval misses. A wider net for recall, followed by a model that reads more candidates, can beat aggressive filtering that drops the right passage.
  • Stable reference material. Long, unchanging context such as a policy manual or schema can be cached as a prefix and reused across requests.

How I design it: retrieve, then read generously

WorkloadApproach
Questions over a large, changing corpusRAG with larger chunks and reranking; long context only for the top results
Analysis of one long documentLong context, with key instructions and questions at the start and end
Whole-corpus themes and patternsNeither alone; consider GraphRAG or map-reduce summarisation
Facts about known entitiesQuery a governed knowledge graph, then explain with the model
Agents working over many stepsKeep working context small; summarise and store state rather than accumulating everything

The common thread is what is now called context engineering: deciding deliberately what goes into the window, in what order, and what stays out. Retrieval, ranking, summarisation and memory are all tools for that decision. A large window gives you more room to be generous; it doesn't remove the need to choose.

Test it on your own data

Published benchmarks tell you the direction of the effect, not its size for your documents. Before choosing an approach, I run a simple comparison on the client's own evaluation set, as described in evaluation sets that predict production:

  1. Baseline RAG with the current chunking and top-k.
  2. RAG with larger chunks and more results, using the long window to read more.
  3. Full-document long context for the subset of questions where it is feasible.
  4. Position tests: the same answer-bearing passage placed at the start, middle and end of the context.

Measure accuracy, citation correctness, latency and cost per answer for each. The result is usually a hybrid, and the numbers make the case to stakeholders far better than any article, including this one.

The bottom line

Bigger context windows are a genuine improvement. They make retrieval more forgiving, enable new single-document workflows and reduce some engineering effort. But the evidence on position effects, effective context length and degradation with input size means the most reliable systems still choose what the model reads. Treat the window as a budget to spend well, not a bucket to fill.

How I can help

I design retrieval and context strategies for AI products, from chunking and ranking to long-context workflows, and test them against real data before they ship. See my AI architecture work and the RAG to production checklist, or analyse your challenge and bring the result to a call.

References
  1. 1
  2. 2
  3. 3
    Context Rot: How Increasing Input Tokens Impacts LLM PerformanceHong, Troynikov and Huber, Chroma · 14 Jul 2025
  4. 4
  5. 5
FAQ

Common questions

Do long context windows replace RAG?

Not in general. Research shows models use long inputs unevenly: information in the middle of a long context can be used less reliably, effective context length is often shorter than the advertised window, and performance tends to degrade as input grows. Retrieval remains useful for selecting what goes into the context.

What is 'lost in the middle'?

A finding by Liu and colleagues that language model performance on tasks such as multi-document question answering is often highest when relevant information is at the beginning or end of the input, and lower when it is in the middle.

What is context rot?

A term used in a 2025 Chroma technical report, which tested 18 models and found that performance grows increasingly unreliable as input length grows, even on simple tasks.

Keep reading

Related

Open to advisory, fractional CTO & select builds

Let's talk about what you're building.

The fastest route is a free 30-minute call. Prefer to write? Send a message and I'll reply personally within two business days.

Start a conversation

How would you like to reach me?

Book a 30-min callFastest. Pick any open slot on my calendar.→ Write in GmailOpens a pre-filled draft in your browser.→ Use my email appOutlook, Apple Mail or your default client.→

I reply personally within two business days. US & UAE time zones.