So Long and Thanks for All the Context

AI-generated summary of reporting by Oreilly AI ML Blog. Read the original for the full story.

Why it matters

Engineers running long AI agent sessions lose information buried mid-context regardless of window size, and this piece offers concrete workarounds like curated briefs and edge-positioning of key data.

Read this as

This article explains why AI chatbots sometimes ignore information placed in the middle of a long conversation, a problem researchers call the 'lost in the middle' or U-shape effect. Tests by Stanford's Nelson Liu showed models recall best what's at the start or end of their context. Research suggests it's built into the architecture itself, not fixable by training. The author shares five practical workarounds, like writing key details to files and starting fresh sessions.

Teams relying on AI coding agents should not assume bigger context windows (Gemini 3 claims strong single-needle recall at 1M tokens) make long sessions reliable. The U-shape attention bias appears to be structural, so middle-of-context instructions get ignored. The author recommends running many short sessions that read curated briefs from disk rather than one long session. Adopters of agentic engineering gain most; no vendor is named as having fixed the underlying issue.

The U-shaped position bias, primacy and recency preference with mid-context degradation, persists across model families and large windows. A 2025 ICML paper attributes it to equilibrium between causal-mask primacy and RoPE-driven recency; Chowdhury's 2026 paper proves the U-shape exists at random initialization, pre-training. Liu's 'Lost in the Middle' paper established the empirical pattern. Workarounds: externalize-recognize-rehydrate, curated context briefs, --append-system-prompt edge placement, short sessions reading from disk, and externalized state instead of in-context bookkeeping.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Quality Playbook BUGS.md Claude Code Gemini 1.5 Pro Gemini 3 Haiku 4.5 ICML

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading