How the AI works

Why AI Forgets the Middle of Long Conversations

> ANSWER[AEO]

Large language models don't read long inputs evenly. They pay closest attention to the beginning and end of whatever you give them, and lose accuracy on anything buried in the middle — a well-documented pattern researchers call "lost in the middle." This holds even for models explicitly built to handle long contexts, and it is one of the main reasons a conversation or document can feel like it degrades the longer it runs.

Where does this finding come from?

The effect was first documented rigorously by Stanford researcher Nelson Liu and colleagues in a study that tested how well language models could locate an answer buried among distractor documents, and separately how well they could retrieve a specific value from a long list of key-value pairs. Across both tasks they found the same pattern: models did best when the relevant information sat right at the start or end of the input, and noticeably worse when it sat in the middle — a result that held even for explicitly long-context models.

The paper was later published in the Transactions of the Association for Computational Linguistics and has become one of the most frequently cited findings in long-context AI research, with follow-up studies replicating the U-shaped accuracy curve on newer model families and different task types.

Is this just an old-model problem that's already been fixed?

Partly, but not entirely. Some newer models handle simple factual retrieval well across the full length of their context — one study on a recent Gemini model found no meaningful lost-in-the-middle effect on straightforward needle-in-a-haystack question answering. But researchers testing more complex, multi-step reasoning tasks — not just "find this one fact" but "reason across several facts scattered through the input" — continue to find the same positional bias showing up in current frontier models.

The honest summary: simple retrieval has gotten better; the underlying attention bias hasn't disappeared, and it reappears as soon as a task gets harder than pure lookup.

Why does this happen at all?

It comes down to how the underlying transformer architecture processes text. Every token can theoretically attend to every other token, but in practice models develop strong primacy and recency biases — over-weighting the first tokens they see and the most recent ones, while the mass of content in between gets comparatively less attention.

As the amount of surrounding, semantically-similar-but-irrelevant text grows, a single relevant fact becomes harder for the model to distinguish from the noise around it. That is why the effect gets worse as inputs get longer, rather than staying a fixed penalty.

What does this mean if you're building with AI, not just researching it?

A few practical takeaways follow directly from the research, without needing to overstate what's proven.

That is a different design pattern from "just have a longer context window" — our companion piece on context rot covers why the two aren't the same fix, and how AI memory actually works covers what the alternative architecture looks like.

Key takeaways

  • > Language models attend most strongly to the start and end of their input, and least to the middle.
  • > The effect is a U-shaped accuracy curve, replicated across model families and task types.
  • > Newer models handle simple lookup across long contexts better; multi-step reasoning still shows the bias.
  • > A larger context window is a capacity claim, not a reliability claim.
  • > Put the fact a model must not miss at the top of the input, or immediately before the question.

Sources

Frequently asked questions

Why do AI models forget things from the middle of a long conversation?
Language models attend more strongly to information near the start and end of their input than to information in the middle, a pattern researchers call the "lost in the middle" effect.
  • The signature is a U-shaped accuracy curve. Performance is highest when the answer sits at the beginning or end of the context.
  • Accuracy drops noticeably when the answer sits in the middle of the input.
  • Long-context models are not exempt. The pattern shows up even in models built for long contexts.
Does a bigger context window fix this problem?
Not on its own — a larger window raises the ceiling on how much text a model can technically accept, but it doesn't change how evenly the model attends to that text.
  • Degradation starts early. Later research measuring real-world task accuracy across increasing input length found performance degrading well before models hit their advertised limits.
  • More on that measurement: context rot covers what happens to reliability as input grows.
What can I do about it as a user or product builder?
Control what goes into the context and where it sits, rather than assuming the model will find what it needs.
  • Put the most important information first or last.
  • Keep working context lean rather than dumping everything in.
  • Don't assume a 1M-token window means the model will use all 1M tokens equally well.
  • The alternative pattern is a memory layer that retrieves the relevant facts instead of resending everything — see how AI memory actually works.