Zenaique

Define the lost-in-the-middle effect and the empirical pattern it describes

Flashcard·Easy·4.0 · 0·~30s·Asked atInduced AiOracleUnity
Attempt it
TL;DR

lost-in-the-middle names the U-shaped accuracy curve LLMs show across context position: good at the start, good at the end, weak in the middle.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine handing a friend a 50-page printed report and asking, somewhere in there is one paragraph about Tuesday's meeting, what did it say? Most people will skim the first few pages, flip to the last few pages, and shrug at the middle. Their attention is naturally pulled to the edges. Long-context language models behave the same way. Drop the answer in the first page or the last page and they nail it. Bury it on page 25 of 50 and they often miss it, even though every word was right there in front of them. The curve of their hit rate against where the answer sits looks like a U: high on the left, low in the middle, high on the right.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Long context windows feel like the obvious answer to retrieval failure: just put everything in. lost-in-the-middle is the result that broke that hope. A 2023 study moved a single gold passage through positions 1 to 20 of a retrieval-augmented QA prompt and measured how often the model produced the right answer. The curve was not flat and it was not monotonic. It was a U.

The finding survived replication, model upgrades, and a generation of long-context training tricks. In 2026, with Claude Opus 4.7, GPT-5.5, and Gemini 3.1 Pro all sporting hundred thousand token plus windows, the U is still there. The window grew. The position bias did not go away.

This card walks through what the effect is, why it matters for context engineering, and what you do about it.

The U-curve in one figure

The Liu et al. 2023 setup is small enough to hold in your head. Take an open-book QA question. Build a 20-document context where 19 are distractors and 1 is the gold passage that actually contains the answer. Run the same model, same question, same documents, but slide the gold passage through each of the 20 positions. Measure exact-match accuracy at each position.

The resulting curve has a characteristic shape. Position 1 is high. Position 20 is high. The middle positions, roughly 8 through 14, dip noticeably. Plot it and the line forms a wide U.

Why the shape matters more than the number

The shape, not the absolute height, is the diagnostic. Models with stronger absolute recall raise the whole curve, but the dip remains. The U-curve says context position is itself a feature the model is using, whether you intended it as one or not.

Where the bias comes from
Why bigger windows do not flatten the curve
What context engineering does about it
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Liu et al. 2023, Lost in the Middle: How Language Models Use Long Contexts. The paper that named the effect on a 20-document retrieval QA setup.
  • RULER (Hsieh et al. 2024) extends needle-in-a-haystack to multi-needle and multi-hop variants; midcontext positions still underperform on Claude Opus 4.7 and GPT-5.5 in 2026 runs.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QWhy does increasing the context window from 32k to 200k not flatten the curve?
A

Bigger windows widen the interior; the head and tail bias is architectural, not capacity-bound. Cite RULER and BABILong 2026 numbers.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Assuming a bigger context window fixes it. Frontier 2026 models with 200k-plus windows still show the U-curve on RULER and BABILong.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Define lost-in-the-middle in one sentence

  • Sketch the U-curve and label primacy versus recency

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Pick the most effective intervention when an agent's context grows by 8KB every iteration
MCQ·Medium