Tacnode™
Glossary
Machine Learning

What Is Context Distraction?

Context distraction is the failure in which a language model's context grows so long that the model over-relies on what the context contains, such as its own history of past actions, and neglects what it learned in training. In long-running agents it shows up as repetition: the agent replays earlier moves instead of forming new plans. It is a length effect that can begin well before the context window is full, and it is separate from irrelevant content misleading the model or from parts of the context contradicting each other.

Updated

What is context distraction?

Drew Breunig defined it in How Long Contexts Fail (June 2025): "Context Distraction is when a context grows so long that the model over-focuses on the context, neglecting what it learned during training." It is the second of his four context failures, after poisoning and before confusion and clash.

His main evidence is the Pokémon-playing agent in the Gemini 2.5 technical report. The report says that "as the context grew significantly beyond 100k tokens, the agent showed a tendency toward favoring repeating actions from its vast history rather than synthesizing novel plans." The report flags the observation as anecdotal and says it "highlights an important distinction between long-context for retrieval and long-context for multi-step, generative reasoning" (§4.1). A model can find a fact in a long context and still plan badly from one.

Breunig also cites a Databricks study of long-context RAG (Leng et al., August 2024), which found that "Llama-3.1-405b performance starts to decrease after 32k tokens, GPT-4-0125-preview starts to decrease after 64k tokens." He calls the point where a model starts to slip its "distraction ceiling." The Databricks test added more retrieved documents as context grew, so it measures length and extra material together. Chroma's Context Rot report (July 2025) kept tasks deliberately simple, tested 18 models, and found that "performance grows increasingly unreliable as input length grows."

How context distraction works

An illustrative progression in a long-running agent:

  1. 1.The agent appends every observation and action to its history.
  2. 2.Early on, the history is short, and the model plans from the task and its general knowledge.
  3. 3.As the history grows, past actions take up most of the prompt. The most available answer to "what next?" becomes "what I did before."
  4. 4.The agent loops: it retries a move that failed, revisits the same place or reruns the same search.
  5. 5.Nothing in the history is false or irrelevant. There is simply too much of it.

Because the ceiling varies by model and task, measure it on your own traces:

python
# Find the history length where the agent starts repeating itself (illustrative).
for cutoff in [8_000, 16_000, 32_000, 64_000, 128_000]:
    runs = [run_task(t, history=truncate(trace_for(t), cutoff)) for t in eval_set]
    print(cutoff, success_rate(runs), repeated_action_rate(runs))

The remedy Breunig pairs with distraction is summarization. In How to Fix Your Context, he writes that as the context grows, "it becomes distracting and causes the model to rely less on what it learned during training." Other remedies keep history out of the prompt: store it outside the window where the agent can query it, split long tasks into subtasks with their own contexts, and detect repeated actions in the harness instead of waiting for the model to notice.

Why context distraction matters in real-time systems

Context distraction is an in-prompt failure, driven by how much history the prompt carries. It is unrelated to whether the facts in that history are current. A short, focused prompt can still hold a balance that trails its source or an order status a cache has not yet updated. That is context lag, a property of the store the value came from, and trimming history does not touch it.

Diagnosis follows from that split. If an agent repeats itself more as sessions grow, look at length and compaction. If it acted on a value that did not match the source when it was read, look at how that value was retrieved. Agents that act on live state need both fixes: a compact working context, and live values re-read at the step that uses them rather than carried in history. The two failure classes are compared in context rot vs. context lag.

FAQ

Related terms

Further reading