Saasworld
← Research
How LLMs and coding tools work8 min read

Lost in the Middle: How Language Models Use Long Contexts

Nelson F. Liu, Kevin Lin, John Hewitt, Ashwin Paranjape, Michele Bevilacqua, Fabio Petroni, Percy Liang · 2023 · Transactions of the Association for Computational Linguistics 12 (2024), 157–173

Models find information at the start and end of a long input far more reliably than information in the middle — and a bigger context window does not fix it.

The short version
  • Move the one relevant document around inside a long prompt, change nothing else, and accuracy swings dramatically.
  • The shape is a U-curve: best when the needed information is at the beginning or the end, worst in the middle.
  • This held on explicitly long-context models too — having room for the tokens is not the same as using them.
  • A context window is a capacity, not a promise. Where you put things inside it is a design decision.
Subscription

The Library

Everything running a software business asks of you and none of it is code: onboarding that activates, churn you can actually see coming, marketing with no budget, SEO that finds buyers, and the AI-plus-Ahrefs workflow for writing the blog that feeds it. One new playbook a week, plus the whole archive from day one.

$9/ month · cancel any time
  • A new playbook every week — onboarding, churn, growth, SEO, content
  • The full back catalogue the moment you join, not drip-fed
  • Vendor explainers: Stripe, Supabase, Resend, Vercel, the AI APIs
  • The research shelf — real papers, decoded, on learning and on LLMs
  • One email when a new one lands, off by default in one click
  • Cancel any time; you keep reading to the end of the month

first — it takes ten seconds.

No card is asked for yet — the subscription is recorded and really opens your account. See all plans →