# Attention degradation

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: context rot, context degradation, long context degradation, lost in the middle

The drop in an [agent](https://ecosystem.samcarlton.com/ai-agent)'s sharpness as a [session](https://ecosystem.samcarlton.com/session) gets long. Each [token](https://ecosystem.samcarlton.com/token)'s [attention](https://ecosystem.samcarlton.com/attention) is spread over more material, important connections weaken, and the agent misses details it handled well earlier.

**For example:** Two hours into one [session](https://ecosystem.samcarlton.com/session), the [agent](https://ecosystem.samcarlton.com/ai-agent) ignores a rule it followed perfectly in the first ten minutes.

## Connects to (7)

- [Attention budget](https://ecosystem.samcarlton.com/attention-budget): A way of picturing attention as a fixed amount each token can spread across everything else in the input.
- [Smart zone](https://ecosystem.samcarlton.com/smart-zone): A name for the early part of a session, when an agent is focused and accurate.
- [Session](https://ecosystem.samcarlton.com/session): One stretch of work with an AI agent, from a blank start until it is cleared, closed or compacted.
- [Context window](https://ecosystem.samcarlton.com/context-window): How much text an LLM can take into account at one time.
- [Clearing](https://ecosystem.samcarlton.com/clearing): Ending a session and starting a completely empty one.
- [Compaction](https://ecosystem.samcarlton.com/compaction): Shrinking a long session by replacing its history with a summary and carrying on from that summary in a fresh context window.
- [Attention relationship](https://ecosystem.samcarlton.com/attention-relationship): The link between two tokens in the input, measured by how much one shapes the model's reading of the other.

Map view: https://ecosystem.samcarlton.com/attention-degradation
