← Back to glossary
+Suggest a term
Concept·AI Models & Capabilities·Added 1 day ago

Lost in the middle

Also known as: middle context degradation, long context recall problem, context position bias

The observed tendency of LLMs to pay more attention to information at the beginning and end of a long context, and less attention to information buried in the middle. Relevant when you're stuffing large documents into a prompt: the model may effectively ignore key sections.

Research showed that even when models have long context windows, their ability to actually use information isn't uniform across that window. Information placed at the very start or end of the context is recalled reliably. Information placed in the middle of a long document is often effectively invisible: models perform significantly worse on questions whose answers are buried there.

This has practical implications for RAG system design and for how you structure prompts that include long documents. If you need the model to attend carefully to a specific piece of information, putting it at the beginning or end of the context is safer than burying it in the middle. Chunking and reranking strategies in RAG systems partly exist to avoid this problem by surfacing only the most relevant passages, rather than feeding entire documents.

Newer models have improved substantially on this problem. Gemini 2.5 Flash, for example, shows much more uniform recall across its context window. But the issue isn't fully solved across all models, and it's worth knowing about when you're debugging a system where the model 'should know' something you gave it but keeps getting it wrong.

This definition is AI-generated and refreshed weekly. It may contain inaccuracies. Use your own judgment, especially for production decisions.
Related terms
Context windowNeedle in a haystackContext engineeringChunkingRAG