
Deep Dive
Lost in the Middle: Why Big Context ≠ Better Retrieval
October 9, 2025 · 5 min read · By Yusuf Tunc Karadut
Million-token context windows sound impressive. The reality: models struggle to retrieve information buried in the middle of long prompts. There's a difference between "can fit" and "can effectively process." RAG isn't obsolete. It's more relevant than ever.
The U-Shaped Performance Curve
Liu, Lin, Hewitt, Paranjape, Bevilacqua, Petroni & Liang documented a consistent pattern: LLMs retrieve information at the beginning and end of prompts well (primacy and recency bias), but performance degrades, sometimes below random chance, when relevant information sits in the middle.
The attention mechanism can theoretically attend to all tokens, but in practice it dilutes focus across massive sequences. The model can't distinguish signal from noise when you dump everything into context.
The Economics of Context
Even if retrieval were perfect, the economics don't work. Attention scales quadratically (or linearly with optimizations) with sequence length. Processing a million tokens for every query incurs massive latency and cost.
RAG transforms needle-in-haystack into needle-on-plate. Retrieve the top-k most relevant chunks, keep context short. Fast, cheap, and counterintuitively more accurate because you've removed distractors.
The optimal architecture isn't RAG vs. long context. It's hybrid: route simple queries to RAG, escalate complex synthesis tasks that genuinely need cross-document reasoning to long context. System engineering, not feature worship.
Sources
Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024)
Lost in the Middle: How Language Models Use Long Contexts
TACL 2024 · arXiv:2307.03172