Memory

How Language Models Use Long Contexts (Lost-in-the-Middle)

First page
How Language Models Use Long Contexts (Lost-in-the-Middle)
Paper summary

Shows LLM performance drops when relevant information is in the middle of a long context.

Ask this paper

Key points
01

U-shaped performance curve: LMs perform best when relevant info is at the start or end of context, with substantial degradation for middle positions.

02

Cross-model phenomenon: Confirmed across GPT-3.5, GPT-4, Claude, and open-weight models - indicating a fundamental attention pattern rather than a bug.

03

QA and retrieval benchmarks: Demonstrated on multi-document QA and key-value retrieval tasks with varying context positions.

04

Foundational finding: Coined the phrase "lost in the middle" - one of the most widely-cited 2023 findings that shaped subsequent long-context benchmark and model design.

Abstract

While recent language models have the ability to take long contexts as input, relatively little is known about how well they use longer context. We analyze the performance of language models on two tasks that require identifying relevant information in their input contexts: multi-document question answering and key-value retrieval. We find that performance can degrade significantly when changing the position of relevant information, indicating that current language models do not robustly make use of information in long input contexts. In particular, we observe that performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts, even for explicitly long-context models. Our analysis provides a better understanding of how language models use their input context and provides new evaluation protocols for future long-context language models.

Every Monday
Get next week’s papers.
Subscribe on Substack