Skip to the document
Madhuopen lab
Outcome School · Other AI topics22 min read

by Amit Shekhar · 19 August 2026

The Lost in the Middle Problem in LLMs

The Lost in the Middle problem in LLMs, the strange behaviour where a model reads a very long text, uses the beginning and the end very well, and quietly ignores whatever is sitting in the middle. We will also see what a context window really means, how the accuracy forms a U-shaped curve, why the middle gets forgotten, how this silently breaks RAG systems and long conversations, how we can test our own model for it, and what we can do to fix it.

4,313 words#llm#ai#system-design4 recall cards

The Lost in the Middle Problem in LLMs
Read on Outcome School ↗then come back to lock it in
Before you read, guess

What phenomenon describes an LLM prioritizing information at the start and end of a long input while neglecting the middle?

Ten seconds, a guess, then read — a wrong guess still makes the answer stick.

What this article covers

  1. What is a context window
  2. What is the Lost in the Middle problem
  3. Let's understand it with an example
  4. The U-shaped curve
  5. Why does this happen
  6. Where this hurts us in real life
  7. How to test for the Lost in the Middle problem
  8. How to solve the Lost in the Middle problem
  9. Key points to remember

The article lives on outcomeschool.com. Read it there, then come back: the tutor in the margin has read it and will answer questions, and the questions below check what stayed.

Before you go

In one sentence, what was this chapter about?

From memory, without scrolling up. Writing it is what makes it yours; the grade is only to show you what you had.

How sure?