Skip to content

Lost in the Middle: Long-Context Position Effects

A longer context window is only useful if the model uses what is in it. Liu et al. test that with a controlled question-answering task built from NaturalQuestions-Open: each input holds k documents, exactly one of which contains the answer, and the others are distractors. The only thing they change between runs is where the answering document sits.

Accuracy forms a U. It is highest when the answer is in the first or last position, "primacy" and "recency" in the paper's words, and it drops when the answer is in the middle. For GPT-3.5-Turbo the multi-document accuracy "can drop by more than 20%," and in the worst case, with 20 or 30 documents, it is lower than the closed-book score of 56.1% from the same model given no documents.

The paper also checks whether a model built for long inputs does better. When the input fits both a model and its extended-context version, the two perform nearly identically, so a larger window did not fix the problem.

Does more retrieval help? On open-domain questions, the paper finds that moving from 20 to 50 retrieved documents improved GPT-3.5-Turbo by only about 1.5%, even though the retriever's recall kept rising.

If you assemble a prompt from retrieved passages, order matters. Put the passages you trust most at the start or the end.

Liu et al., Transactions of the ACL 2024, §1, §2.3, and §5