Attention Distribution (Start)

High Attention (60-100%)
Medium Attention (20-60%)
Low Attention (<20%)

Attention Distribution (End)

Query-Token Attention
U-Curve: Start & End high
Middle: Low (Problem!)

The "Lost in the Middle" Phenomenon

LLMs attend to the beginning and end of prompts with high attention, but the middle is neglected. System Prompt: 90% Attention. User Query (at the end): 85%. Middle info: only 20%!

U-Curve: Empirical Pattern

Lost-in-the-Middle Paper (2023): Measurable U-shape in attention. Position 0: ~100%. Position 50% (middle): ~15%. Position 100%: ~95%. Affects all common models (GPT, Llama, Claude).

System Prompt Advantage

System Prompt is ALWAYS placed at the beginning → receives maximum attention. User Message at the end → also high attention. Context documents in the middle: Lose! RAG integration problematic.

Mitigation Strategies

1. Important info at start/end. 2. Repetition in the middle. 3. Hierarchical structure (summary at top). 4. Newer models (Claude 4.5+) show better middle attention, but U-curve remains.

RAG Implications

When Retrieval positions 20 documents in the middle: quality suffers! Solution: Top-K Reranking based on attention patterns. Or: Most important documents at beginning/end.

Future Outlook

Longer contexts (1M+) exacerbate the problem. Research shows: Transformer architecture is responsible for this pattern. New attention mechanisms (e.g., linear) show better middle-preserving.