Topic 5 of 5 · 5 min read
Huge context windows versus focused context
Goal: Choose between loading a whole corpus into a long-context model and selecting excerpts, based on the task, cost and accuracy.
Load a whole corpus into a long window when the task needs the whole picture and the corpus is small enough to pay for; select excerpts when the answer sits in a few places.
Check yourself · 1 of 3
Which task is the best fit for loading a whole corpus into a long-context model?
Why it matters
Some models now accept very large inputs, up to hundreds of thousands or even a million tokens. That makes "just paste everything" tempting. It sometimes works well. It is also slower, costs more on every call, and, as the research on context rot shows, can be less accurate than a short, well-chosen input. You need a way to choose.
Two approaches
- Whole corpus in the window. You load all the documents and ask. Simple, with no search step to go wrong.
- Focused context. You first pick the relevant excerpts, by search, retrieval or by hand, and send only those. This is the idea behind retrieval-augmented generation (RAG): fetch the right passages, then answer from them.
How to choose
Ask four questions.
- Where is the answer? If it lives in one or two places ("what is the notice period?"), excerpts win. If it needs patterns across the whole set ("what themes recur in all 80 interviews?"), the whole corpus may be needed, or a staged summary.
- How big and how stable is the corpus? A small, fixed set fits easily. A large or changing set is hard to reload and costly to send every time.
- What does a wrong answer cost? For high-stakes answers, narrower input plus quoted evidence is easier to check.
- How often will you ask? One question may justify loading everything. Fifty questions about the same material add up, because you pay for the large input on each call unless your tool offers caching.
Before and after
Task: a support team wants answers from 300 help articles.
Weak: paste all 300 articles for every customer question. It is slow and costly, and the right article is lost in the crowd.
Better: search the articles, send the three most relevant, and ask the model to answer only from them and cite the article. Keep a whole-corpus run for the rare job of finding gaps across all articles.
What goes wrong
- Trusting a big window blindly. Test on your own task. Results on a benchmark do not always carry over, especially when the question does not share words with the answer.
- Bad retrieval. Focused context fails when the search misses the right passage. The model then answers confidently from the wrong one. Check what was retrieved.
- Ignoring cost. Input is billed per token, so a repeated large input adds up fast.
- Choosing once. Re-check as models, prices and your corpus change.
Examples
Choosing for three tasks
| Task | Choice | Why |
|---|---|---|
| Find the notice period in one contract | Excerpts | Answer sits in one clause. |
| Find recurring complaints across 80 interview transcripts | Whole corpus, or staged summaries | Needs patterns across all of it. |
| Answer customer questions from 300 help articles, all day | Excerpts via search | High volume, answers in a few articles. |
Checking that retrieval did its job
Your assistant answers a question about refunds using three retrieved passages. Before trusting it, read the three passages. If the refund policy page is missing, the answer is built on the wrong material, however fluent it sounds.
Fix the search or add the page, then ask again.
Key points
- Whole-corpus loading suits tasks that need the full picture across a corpus small enough to pay for.
- Excerpts suit questions whose answers sit in a few places, and they cost less and are easier to check.
- A repeated large input is paid for on every call, so question volume matters to the choice.
- Focused context depends on retrieval, so check what was selected before trusting the answer.
- Test both approaches on your own material, because benchmark results do not always transfer.
Common mistakes
- Pasting a whole corpus for every question when the answer sits in one or two documents.
- Assuming a large window means the model reads every part equally well.
- Trusting a focused answer without checking which excerpts were actually retrieved.
- Forgetting that a large input is billed again on every call.
Check yourself · 2 of 3
You will ask fifty questions a day about the same large document set. Which factor most favours focused excerpts?
Check yourself · 3 of 3
A support bot answers from three retrieved help articles, but the answer is wrong. What should you check first?
Practice items, not counted towards your mastery.
Start here
- Context Rot (Chroma research) (opens in a new tab)ArticleFree
Tests many models as input grows and shows accuracy dropping even on simple tasks.
- Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)PaperFree
The study showing models use facts at the start and end of a long input better than facts in the middle.
- NoLiMa: Long-Context Evaluation Beyond Literal Matching (opens in a new tab)PaperFree
Shows long-context accuracy falls when the question does not share words with the answer.
More for this topic
- Effective context engineering for AI agents (Anthropic) (opens in a new tab)ArticleFree
Explains context as a limited resource and covers trimming, compaction and note-taking for agents.