Definitions
Context Rot: Definition, Behavioral Signals, and How It Differs from Context Drift
Context rot is the degradation, and increasingly non-uniform reliability, of model performance as context grows longer. What causes it, the behavioral signals that reveal it, and how it differs from context drift.

Context rot is the worsening, and increasingly non-uniform, reliability of a language model's performance on a task as its input context grows longer. The model's weights are unchanged and the needed information is often still present in the window; what decays is the model's ability to use that information reliably. Stale, redundant, or irrelevant material aggravates the effect, but is not required for it: a 2025 Chroma technical report associated with the term showed, across 18 models and controlled tasks without any stale agent state, that performance on even simple tasks declines as input length increases, contradicting the assumption that a model handles the 10,000th token as reliably as the 100th (Context Rot, Chroma, 2025).
Context rot is an input-side phenomenon. It is one of the main mechanisms behind the broader runtime degradation this site calls behavioral state decay, and it typically surfaces as the semantic form of agent drift.
Mechanism
Three factors combine to rot a long context.
Length alone degrades retrieval. The Chroma evaluations found that model performance becomes less reliable as input grows even when the task stays constant, and that the effect worsens when the target information is only semantically related to the query rather than a literal match. Position can compound the problem: earlier work measuring task performance found a U-shaped curve in which models often used information at the beginning and end of a long input better than information in the middle (Liu et al., 2023). Where the system prompt and original task statement actually sit in an agent session depends on the runtime's serialization and compaction strategy; the robust practical point is that longer inputs, accumulated distractors, and compaction all make instructions given early in a session harder for the model to use.
Distractors gain weight. The same Chroma report found that plausible but wrong passages, which a model shrugs off in short contexts, increasingly pull answers off course as context lengthens. Agent sessions manufacture distractors constantly: failed attempts, superseded plans, and error dumps all remain in the window as competing evidence.
Accumulation is unselective. Tool outputs, retries, and boilerplate pile up regardless of continued relevance. The signal-to-noise ratio of the window can fall steadily unless something actively curates it, and lossy summarization used to reclaim space risks deleting the quiet constraints, a compaction-loss failure worth testing for in your specific compactor rather than assuming either way.
How to measure
Context rot shows up in behavior before it shows up in metrics. Watch for these signals, then instrument them.
- Instruction loss: the agent violates a constraint stated early in the session that it previously honored. Track constraint adherence over turn number.
- Repetition: the agent redoes completed work or re-asks answered questions, indicating failed retrieval from its own history.
- Contradiction: outputs conflict with earlier decisions recorded in the same window.
- Distractor capture: the agent cites a superseded plan or a failed attempt as if current.
- Quantitatively: replay a fixed probe task at intervals with the live session context prepended, and plot accuracy against context length, per drift regression tests. Falling probe accuracy at constant probe difficulty points at the context but does not isolate it by itself: pair each aged-context run with a contemporaneous clean-context control, pin model and tool versions, and repeat enough samples to estimate variance before attributing the decline.
Two of these signals deserve early attention. Instruction loss is cheap to check deterministically: enumerate the brief's hard constraints once, then verify each output against the list. Distractor capture is a strong candidate signal for rot specifically, though not conclusive on its own: a superseded plan can also arrive from stale external memory or a tool response, so inspect the provenance of the cited material before attributing the failure to the window.
Mitigation
Treat the context window as a curated budget, not a log file. Keep durable facts, decisions, and goals in external artifacts and re-read them on demand, per state externalization. Compact deliberately: summarize completed work into short verified notes and drop raw transcripts, rather than letting truncation choose what survives. Re-inject the goal and constraints periodically so they sit in the high-attention recent region, per re-anchoring patterns. And prefer starting a fresh session with a small, clean state file over pushing a polluted session further; rot is cheaper to prevent than to reverse.
Related terms
- Behavioral state decay: the umbrella runtime phenomenon; context rot is a primary mechanism.
- Agent drift: the research taxonomy; rot usually manifests as semantic drift.
- Goal drift: frequently caused by rot, when the goal statement loses attention weight.
- State externalization: the main preventive pattern.
FAQ
How does context rot differ from context drift? Context rot is degradation of the model's ability to use a growing, noisier window: the information may still be there, but retrieval and weighting fail. Context drift is the window's contents diverging from present reality: summaries, cached results, and assumptions that were true at capture time but no longer are. Rot is a model-behavior problem; drift is a data-freshness problem. A session can suffer either alone or both at once.
Does context rot mean long-context models are useless? No. It means advertised window size is a capacity claim, not a reliability claim. The Chroma results show degradation well within supported lengths, so long windows are best treated as room for curated state, not as license to append everything.
Is context rot permanent within a session? Distinguish two levels. For any single inference, the serialized prompt is fixed: whatever noise it contains will condition that call. Across calls, the application owns the prompt and can rebuild, filter, or replace content between turns; compaction, for instance, removes content outright rather than merely reducing its weight. The most reliable reset remains a fresh session seeded from externalized state.