Skip to main content

Envisioning is an emerging technology research institute and advisory.

LinkedInInstagramGitHub

2011 — 2026

research
  • Reports
  • Newsletter
  • Methodology
  • Origins
  • Vocab
services
  • Research Sessions
  • Signals Workspace
  • Bespoke Projects
  • Use Cases
  • Signal Scanfree
  • Readinessfree
impact
  • ANBIMAFuture of Brazilian Capital Markets
  • IEEECharting the Energy Transition
  • Horizon 2045Future of Human and Planetary Security
  • WKOTechnology Scanning for Austria
audiences
  • Innovation
  • Strategy
  • Consultants
  • Foresight
  • Associations
  • Governments
resources
  • Pricing
  • Partners
  • How We Work
  • Data Visualization
  • Multi-Model Method
  • FAQ
  • Security & Privacy
about
  • Manifesto
  • Community
  • Events
  • Support
  • Contact
  • Login
ResearchServicesPricingPartnersAbout
ResearchServicesPricingPartnersAbout
  1. Home
  2. Vocab
  3. Lost-in-the-Middle

Lost-in-the-Middle

LLMs systematically underuse information positioned in the middle of long contexts.

Year: 2023Generality: 104
Back to Vocab

Lost-in-the-Middle is a documented failure mode in large language models where performance degrades when relevant information is located in the middle of a long input sequence, as opposed to near the beginning or end. Empirical studies have shown that models consistently perform better on retrieval and reasoning tasks when the key information appears at the edges of the context window, suggesting that attention mechanisms do not distribute focus uniformly across long inputs. The phenomenon was formally characterized in a 2023 paper by Liu et al., which systematically tested models across varying context lengths and key-information positions, finding a pronounced U-shaped performance curve.

The root cause lies in how transformer attention operates over long sequences. While transformers theoretically attend to all positions, in practice the attention weights learned during training tend to favor recency and primacy — patterns reinforced by the structure of training data and the way positional encodings interact with attention scores. As context length grows, the signal from middle tokens becomes increasingly diluted relative to tokens at the boundaries, making it harder for the model to surface and integrate that information during generation.

This limitation has significant practical consequences for applications that depend on processing long documents, such as multi-document question answering, legal and scientific document analysis, retrieval-augmented generation, and long-form summarization. When a system retrieves multiple passages and concatenates them as context, the ordering of those passages can dramatically affect answer quality — a subtle but critical engineering consideration that is easy to overlook.

Addressing Lost-in-the-Middle has become an active area of research. Proposed mitigations include reranking retrieved passages to place the most relevant content at context boundaries, training models with explicit objectives that reward attending to middle positions, and architectural modifications such as sliding-window attention or memory-augmented transformers. As context windows continue to expand — reaching hundreds of thousands of tokens in some models — ensuring uniform and reliable utilization of the full context remains an open and important challenge.

Related

Related

Long-Context Modeling
Long-Context Modeling

Architectures and techniques enabling AI models to process and reason over very long sequences.

Generality: 694
Context Anxiety
Context Anxiety

The degraded performance of language models as inputs approach their maximum context length.

Generality: 94
L2M (Large Memory Model)
L2M (Large Memory Model)

A decoder-only Transformer with addressable auxiliary memory enabling reasoning far beyond its attention window.

Generality: 189
LLM (Large Language Model)
LLM (Large Language Model)

Massive neural networks trained on text to understand and generate human language.

Generality: 905
LRM (Large Reasoning Models)
LRM (Large Reasoning Models)

Large-scale neural systems explicitly optimized for multi-step, structured reasoning tasks.

Generality: 384
MLLMs (Multimodal Large Language Models)
MLLMs (Multimodal Large Language Models)

AI systems that understand and generate content across text, images, audio, and more.

Generality: 794