LLMs Forget Instructions Like ADHD Brains - Instruction Decay in Long Sessions
LLMs Forget Instructions Like ADHD Brains - Instruction Decay in Long Sessions
Give an LLM a system prompt with 20 rules. For the first few interactions, it follows all of them. By interaction 50, it is following maybe 12. By interaction 200, it has quietly dropped half your instructions and is making up its own approach.
This is instruction decay - the tendency for LLMs to gradually lose adherence to initial instructions as the conversation grows longer. If you have ever managed ADHD, the pattern is familiar: the instructions are there, but maintaining focus on all of them simultaneously becomes harder as the session stretches on.
Why It Happens
LLMs process context through attention mechanisms. As the conversation history grows, the system prompt - which sits at the very beginning of the context - competes with an increasing amount of recent content for attention weight. The model naturally attends more to recent messages because they are usually more relevant to the immediate task.
Your instruction to "always confirm before deleting files" made at the start of the session gets drowned out by 50K tokens of subsequent conversation about building a new feature.
How It Manifests in Agents
For AI agents, instruction decay creates dangerous drift:
- Safety rules fade first - Instructions like "never run rm -rf" or "always ask before sending emails" are the first to be forgotten because they are negative constraints, not active tasks.
- Style guidelines slip - Output formatting, naming conventions, and communication preferences gradually revert to defaults.
- Scope boundaries blur - An agent told to "only modify files in the src/ directory" starts editing test files, configs, and documentation.
Mitigation Strategies
- Periodic instruction re-injection - Every N steps, re-insert the most critical instructions into the conversation. Treat them like medication that needs regular doses.
- Checkpoint and restart - After a set number of interactions, summarize progress and start a new session with fresh instructions plus the summary.
- Instruction verification - Before critical actions, have the agent explicitly restate the relevant rules. If it cannot, it has probably forgotten them.
- Shorter sessions - The most reliable fix. Break long tasks into shorter sessions with explicit handoffs.
- Priority-ordered instructions - Put the most critical rules last in the system prompt (recency effect) and first (primacy effect). Repeat the truly critical ones in both positions.
The best instruction is one the model encounters right before it needs it, not 100K tokens ago.
Fazm is an open source macOS AI agent. Open source on GitHub.