Case & CodeA FIELD GUIDE TO AI
Start learning
Beginner

Context rot

Also: long-context degradation

In plain words

A drop in answer quality as the context grows or fills with clutter. It does not happen in the same way in every model or task.

The fuller definition

Context rot is the informal name for declining output quality as a conversation or task context grows long. Earlier instructions get dropped and corrected facts creep back in.

One illustrative context budget
Instructions
2,000
Sources and history
8,000
Output reserve
4,000
Unused
2,000

A hypothetical 16,000-token budget. Real limits and token accounting depend on the model. Saving a file outside this budget does not mean it is present in the current context, and a passage inside it is not guaranteed equal attention.

A concrete example

After forty exchanges, an assistant stops following a formatting rule given at the start and reintroduces a date you corrected.

The distinction that matters

Fitting inside the context window does not mean every passage is used equally. Start a fresh session or compact the history when quality slips.

Related terms

Where it is taught

Does AI learn from your corrections?

Source and further reading

Anthropic · Context engineering

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC