Language models often ignore relevant evidence sitting in the middle of a prompt even when it fits comfortably inside their context window. In Lost in the Middle, Nelson Liu and colleagues swept the position of a single answer-bearing passage across multi-document prompts and observed a sharp U-shaped accuracy curve that favors the start (primacy) and end (recency) while collapsing in between.
- 22.0-point drop on GPT-3.5-Turbo: With 20 retrieved Wikipedia passages (~4K tokens), GPT-3.5-Turbo scores 75.8% when the answer appears first, plunges to 53.8% in the middle (position 10), worse than its 56.1% closed-book score with zero documents, and recovers to 63.2% when placed last.
- Extended context windows do not cure middle loss: Across identical 20-document prompts, GPT-3.5-Turbo (16K) tracks the 4K model almost identically (75.7% down to 54.1%, then 63.1%), and Claude-1.3 (100K) mirrors Claude-1.3 (8K) at 59.8% to 55.9% to 60.0%.
- Even exact UUID lookup fails in the middle: On a synthetic JSON key-value retrieval task with 300 pairs (~16K tokens), GPT-3.5-Turbo (16K) drops to 45.6% worst-case accuracy in the middle while Claude-1.3 holds near 100%.
- Encoder-decoders stay flat only inside training length: Flan-UL2 varies by just 1.9 percentage points across 10 documents (~2K tokens, matching its 2,048-token encoder training limit), then develops the same U-curve at 20 and 30 documents.
- RAG accuracy saturates long before retriever recall: On NaturalQuestions-Open, expanding retrieval from 20 to 50 documents improves Contriever recall markedly, yet raises reader accuracy by only ~1.5% on GPT-3.5-Turbo and ~1.0% on Claude-1.3.
How the position sweep isolates context use
To separate retrieval failure from context-reading failure, Liu et al. built two controlled testbeds across open models (MPT-30B-Instruct using ALiBi, LongChat-13B-16K using condensed RoPE) and API models (GPT-3.5-Turbo, Claude-1.3, and a 500-example GPT-4 check):
- Multi-document QA: Across 2,655 NaturalQuestions-Open queries, each prompt packs 10, 20, or 30 Wikipedia passages (up to 100 tokens each): one gold answer passage plus
k - 1MS-MARCO Contriever distractors. Sweeping the gold passage from index 0 tok - 1holds question and evidence identical. GPT-4 achieved higher accuracy overall on 500 sampled prompts, yet reproduced the same U-curve. - Synthetic key-value retrieval: To eliminate search-rank priors and semantic clues, models looked up a single 128-bit UUID key inside serialized JSON objects of 75, 140, or 300 random UUID pairs. GPT-3.5-Turbo, GPT-3.5-Turbo (16K), and MPT-30B-Instruct still degraded sharply in the middle, while LongChat-13B (16K) frequently emitted Python code instead of the value when the target sat first.
Shuffling distractor order, telling the model the list was randomly ordered, using random Wikipedia distractors instead of hard negatives, and restricting to unambiguous questions all preserved the U-shaped drop.
Why primacy and recency bias emerge
The authors probed three architectural and training hypotheses to explain why causal Transformers lose the middle:
Because causal attention prevents early tokens from attending to a question placed at the end of a prompt, repeating the query before the documents lets models contextualize passages during prefill. That solves exact-match key lookup completely, yet fails to fix multi-document reasoning, showing that causal masking is only part of the bottleneck. Meanwhile, comparing base and instruction-tuned MPT-30B and Llama 2 models demonstrates that pretraining itself induces both recency and primacy bias once models reach roughly 13B parameters.
Caveats and builder takeaway
These experiments tested 2023-vintage models under greedy decoding on single-document lookup and short-answer QA rather than tasks requiring synthesis across an entire codebase or book. Modern frontier models have improved needle-in-a-haystack recall, yet positional bias remains a recurring failure mode whenever distracting context accumulates.
For retrieval-augmented systems, separate retriever recall from reader utilization: evaluate prompts with a position sweep, rerank the highest-value chunks to the very start or very end of the context, and prefer fewer high-precision passages (often 10 to 20 via strong late-interaction retrieval) over stuffing 50 noisy documents into a long window.


