Start studying
Module 7 · Prompt Engineering Module contents
Module 7  ·  Card 5 / 17intermediate

Lost in the Middle

Models attend most reliably to the beginning and the end of a long context.

Material buried in the middle is measurably more likely to be missed.

The same document can answer the question at the top and be ignored halfway down.

Longer contexts make it worse, so filling the window is not the same as being read.

Put what matters first or last, keep the context short, and rerank before you send it.

Learn in depth ↓
Module 07 · Prompt Engineering · 17 concepts
In depth  /  15 lines

Lost in the Middle, in more detail

Long context is not read evenly, and the middle is the weak part.

The finding is consistent: material at the start or end is used far more reliably.

Put the answer in document one and the model finds it, and put it in document ten and it may not.

The same model, the same question and the same text produce different results by position alone.

The effect grows with length, so a longer window makes it worse rather than better.

A model advertising 200,000 tokens does not use all 200,000 with equal care.

Benchmarks that hide a single fact in a long document expose it directly.

It resembles the way people remember the beginning and end of a list.

The practical consequence is that filling the window is not the same as being read.

Rerank before you send, so the strongest material sits at the top.

Placing the most important document last also works, since the end is attended to well.

Repeating the question after the context is a cheap and effective trick.

Cutting from twenty documents to five usually beats any prompt rewording.

If the answer was present and missed, suspect position before blaming the model.

It is the main reason retrieval quality still matters in the era of very long contexts.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
You paste twenty documents and the model ignores the one that answers the question. What is the cheapest thing to try first?
Prompt Engineering

17 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close