AI · 05

Context rot

Why a long chat or a huge prompt makes AI less reliable — even when the answer is right there in front of it.

The one idea

More context is not free. As the context window fills up, a model gets worse at finding, weighing and using what's in it. The right fact can be sitting in the prompt and still be missed.

A bigger window means it fits more — not that it uses it all well.

What it looks like

  • Missed details — something buried in the middle of a long prompt gets ignored.
  • Contradictions — it goes against an instruction or fact you gave earlier.
  • Drift — over a long conversation it wanders from the original task.
  • Distraction — similar-looking but irrelevant content pulls the answer off course.

Likely causes

Researchers still debate the exact mix; these are the usual explanations.

Spread-thin attention
More tokens compete for the same focus, so the signal has more noise to fight.
Lost in the middle
Models tested in 2023 favoured the start and end of the input and gave the middle less weight. Newer models vary — test your own.
Distractors
Near-duplicates and look-alikes hurt more the longer the input gets.
Training
Models see far more short texts than very long ones while learning.

How to keep it sharp

  • Start fresh for a new task instead of letting one thread sprawl.
  • Summarise, don't carry — compact earlier history into the key points and continue from that.
  • Put what matters at the start or end, and restate key instructions when you need them.
  • Retrieve, don't stuff — give it the relevant passages (RAG), not whole documents.
  • Trim the noise — cut logs and pasted output down to what the task needs.

If you work with an AI coding assistant

A model can't reliably feel rot from the inside — it doesn't know what it has stopped paying attention to. So give it outside signals, and ask it to watch for visible symptoms in its own work rather than trusting it to sense the decline.

Measure
Keep the context fill level visible (a status line showing % used). Quality often slips well before the window is full. A common rule of thumb (not a measured limit): treat roughly half-full as the "be careful" zone, and lower on very large windows.
Raise an alarm
Some coding assistants (Claude Code, for example) support hooks — small scripts that run on each message. One that checks the context size and, past a threshold, adds a warning to the conversation means the assistant "hears" it and can suggest a reset.
Write a self-check rule
It can't sense the rot, but it can spot the symptoms. In the assistant's standing instructions: "If you notice you're repeating mistakes, forgetting constraints or re-reading the same files, stop and tell me the context may be degraded."
Make recovery cheap
Keep a progress or plan file the assistant updates as it goes, so a fresh session loses nothing. Compact with clear "what to keep" instructions, and hand noisy work (big searches, long logs) to sub-agents.

Symptoms to watch for:

  • Forgetting earlier decisions or re-asking questions you already answered.
  • Contradicting its own plan, or repeating a mistake it already fixed.
  • Re-reading the same files or editing the wrong one.

The term was popularised by Chroma's 2025 research, which found that models with very large context windows still get worse at simple tasks as the input grows.

Go deeper (free, vendor-neutral)