Context Rot is the progressive degradation of a language model's output quality as its context window accumulates stale, redundant, or mutually contradictory information over the course of a long agent session, degrading reasoning even when the window is nowhere near its token limit. The failure is not about running out of space; it is about signal-to-noise. As an agent loops—reading files, calling tools, retrying, backtracking—the transcript fills with obsolete plans, superseded file versions, dead-end tool outputs, and half-corrected assumptions. The model attends over all of it at once, so an early wrong turn or a since-deleted code snippet keeps exerting pull on later steps. Symptoms include the agent re-solving finished subtasks, citing values that were already overwritten, contradicting its own earlier conclusions, and drifting off the original instruction. The term gained currency through 2024–2025 as multi-step coding and research agents made long sessions routine and exposed how quality erodes well before any hard limit.
How it works
Transformer attention weighs every token in the window against every other, with no built-in notion that later information supersedes earlier information. When two passages conflict—an old file state and its edited version—both remain live inputs, and the model may blend or pick the wrong one. Long contexts also dilute attention: the relevant instruction competes with thousands of low-value tokens, and empirically models retrieve less reliably from the crowded middle of a long window. Each agent turn appends more history, so noise compounds monotonically unless something removes it.
Why it matters for AI engineers
Rot raises cost and latency directly—every turn reprocesses a growing transcript—while lowering reliability, which is the worse tax. It is why compaction (summarizing and pruning old turns) and context engineering (deciding what to load, retrieve, or drop each step) are now standard agent-design concerns rather than optimizations. Left unmanaged, agents fail silently late in a run, making bugs hard to reproduce. Stale content can also carry security weight: an outdated or attacker-planted instruction lingering in context can steer later actions.
Related terms
Definitions are the start. Ask the Research Desk for a cited, multi-source brief on Context Rot — real sources, verified claims, delivered in minutes.
Ask the Research Desk →