Give a model twenty retrieved documents and ask a question whose answer is in only one of them. Liu and colleagues ran this kind of test and found a U-shaped pattern: models answered best when the useful document came first or last, and noticeably worse when it sat in the middle, even models advertised for long inputs (Liu et al.). A bigger context window lets you fit more text in; it does not mean every part of that text gets equal attention.
The result is from specific 2023 models and tasks. Newer models have improved on long-context tests, and the size of the effect varies by model and by how the input is arranged, so treat it as a known risk to test for rather than a fixed law.
It matters most in retrieval-augmented generation and long agent sessions. Practical responses follow from the finding: send fewer, better documents using reranking; put the most relevant material and the key instructions near the start or end; split long documents with sensible chunking; and remove stale or irrelevant text, which also reduces context poisoning. Context engineering is the broader practice of deciding what goes into the model’s input and where. To check your own system, plant a known fact at different positions in a realistic long input and measure whether answers change.
Sources
- Liu et al.: Lost in the Middle: How Language Models Use Long Contexts — Finds performance is often highest when relevant information is at the beginning or end of the input and degrades significantly when it is in the middle, even for long-context models tested; checked October 24, 2026.