Lost in the Middle: How Language Models Use Long Contexts

Lost in the Middle, published by Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, and Percy Liang in July 2023, exposed an uncomfortable limitation of long-context language models: having a big context window does not mean a model uses all of it well.

Using controlled tasks like multi-document question answering and key-value retrieval, the authors placed the relevant piece of information at different positions in a long input. They found a U-shaped performance curve. Models did best when the needed information sat near the beginning or the end of the context and noticeably worse when it sat in the middle. Strikingly, this held even for models explicitly built for long contexts.

The finding reshaped how practitioners think about feeding documents to models. It cautioned that simply dumping more text into a longer window can backfire, and it influenced retrieval-augmented design, where the order and placement of retrieved passages within the prompt turns out to matter.

For a business, the lesson is concrete: a model advertised with a huge context window may still overlook details buried in the middle of a long document, so where you put the important material in a prompt can change the answer you get.

Sources

Last verified June 7, 2026