lost in the middle
The finding that models use information at the start or end of a long context better than information in the middle.
In more detail
Liu and colleagues reported it in 2023; newer models and tests show it in some settings and not others. Put the most important material where it is used best, usually long documents first and the question last, and measure your own case.
Related terms
- context rot — The fall in a model's accuracy as its input grows longer, even on simple tasks and well within the context window.
- context engineering — Choosing and arranging everything a model reads on each call, from instructions and tools to history, memory and retrieved data, within a token budget.
Taught in
- When Context Fails — AI Engineering: LLM Apps, RAG & Agents
References
- Liu et al.: Lost in the Middle: How Language Models Use Long Contexts (arXiv 2307.03172)
- Chroma: Context Rot: How Increasing Input Tokens Impacts LLM Performance (2025-07-14)