What is “lost in the middle” in AI?
Short answer: “Lost in the middle” is a research finding about AI language models: when you give them a long input, they use information at the very beginning and the very end much better than information buried in the middle. Plot accuracy against where the key fact sits, and you get a U-shaped curve. The name comes from a 2023 study by researchers at Stanford and elsewhere.
What the study found
Researchers gave language models a question plus a stack of documents, only one of which held the answer, and moved that document from the first position to the last (Liu et al., 2024). Models found the answer most reliably when it was near the start or the end. When it sat in the middle, accuracy dropped noticeably, even for models built for long contexts. A simpler retrieval test showed the same pattern.
Why it happens
Like people, language models show a primacy effect, paying attention to what came first, and a recency effect, paying attention to what came last. Everything in between competes for less attention. The longer the input, the bigger the middle.
Why it matters for everyday AI use
- Long chats. In a long conversation, your important early details slide into the middle as more messages pile up. That is one driver of context rot.
- Pasted documents. Paste a long report and ask about something on page 12, and the answer may be weaker than you expect.
- Drift toward the latest message. When the recent end carries the most weight, an AI can lean toward whatever you said last. See AI model drift.
How to work around it
- Put the question and the most important context at the start or the end, not the middle.
- Paste only the relevant section of a long document.
- Restate key constraints in your newest message.
- Summarize long chats and start fresh.
The Preisach Model includes thread summaries and a Logbook that keep what matters most to you and let the rest go, so the important parts never get buried. See the tools.
Common questions
What does lost in the middle mean in AI?
It refers to research showing that language models use information at the beginning and end of a long input much better than information in the middle, producing a U-shaped accuracy curve.
Who wrote the Lost in the Middle paper?
Nelson F. Liu and colleagues at Stanford and other institutions; it was released in 2023 and published in Transactions of the Association for Computational Linguistics in 2024.
Do bigger context windows fix lost in the middle?
No. The study found the effect even in models designed for long contexts; a larger window holds more text but does not make the middle easier to use.
How do you avoid the lost in the middle problem?
Place the most important information and your question at the start or end of the prompt, trim irrelevant text, and restate key details in your latest message.
Next: what is context rot?, what is AI hallucination?, or all questions.