mlsanityData to 7 Oct 2026

Why Retrying Fails: Context Contamination in LLM Agent Pipelines

arXiv 2605.08563 ↗First posted 8 May 2026cs.AIcited by 3

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

When an LLM agent fails a multi-step tool-augmented task and retries, the failed attempt typically remains in its context window -- contaminating the next attempt and elevating the per-step error rate beyond the base level. This context-contaminated restart phenomenon is widely observed in practice yet entirely lacks formal treatment. We introduce the Context-Contaminated Restart Model (CCRM): a chain of T tool-call steps, each failing with base rate epsilon_0; after any failed attempt, the subsequent attempt operates in contaminated context with elevated error rate epsilon_1 > epsilon_0. Under this model we derive five main results. (R1) An exact closed-form formula for P(succeed in at most K attempts). (R2) A cascade-overhead theorem giving the additional attempts Delta K incurred by contamination versus the clean-restart baseline. (R3) An optimal budget-allocation theorem identifying the pipeline depth T* that maximises success probability for a fixed total budget B=KT; we prove the closed form T* = sqrt(B * log(1/(1-epsilon_1)) / log(1/(1-epsilon_0))), with K*=B/T*. (R4) An information-theoretic lower bound via Le Cam's method showing K_CCRM is tight up to O(1). (R5) A clean-restart dominance theorem quantifying the exact benefit of context-clearing before retry. We validate CCRM on real SWE-bench Verified data: the IID model overestimates pass@3 by 17.4 percentage points (98.6% vs. 81.2%), while CCRM fits with error less than 0.001, implying a cascade ratio of epsilon_1/epsilon_0 = 7.1. Monte Carlo experiments confirm all theoretical predictions.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 15 of its 32 references that are in the map. First posted on arXiv 8 May 2026.

Builds on

15 of 32 references.

Closest ancestors · 4

Same direction, newest first

  1. 2026Measuring the Unmeasurable: Markov Chain Reliability for LLM Agents27 Apr
  2. 2026Beyond pass@1: A Reliability Science Framework for Long-Horizon LLM Agents31 Mar
  3. 2025Where LLM Agents Fail and How They can Learn From Failures29 Sep
  4. 2025Why Do Multi-Agent LLM Systems Fail?17 Mar

Other references · 11

  1. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  2. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
  3. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  4. 2023A Survey on Large Language Model based Autonomous Agentscited by 2,203
  5. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
  6. 2025Budget-Aware Tool Use Enables Effective Agent Scalingcited by 42
  7. 2026The Long-Horizon Task Mirage? Diagnosing Where and Why Agentic Systems Breakcited by 25
  8. 2026Benchmark Test-Time Scaling of General LLM Agentscited by 24
  9. 2026Spend Less, Reason Better: Budget-Aware Value Tree Search for LLM Agentscited by 10
  10. 2026Agentic Test-Time Scaling for WebAgentscited by 7
  11. 2025Catching Contamination Before Generation: Spectral Kill Switches for Agentscited by 1

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Diagnosis Is Not Prescription: Linguistic Co-Adaptation Explains Patching Hazards in LLM Pipelines
  2. 2026From Confident Closing to Silent Failure: Characterizing False Success in LLM Agents
  3. 2026Beyond Task Completion: Revealing Corrupt Success in LLM Agents through Procedure-Aware Evaluation
  4. 2026Repair or Resample? Rethinking Failure Debugging in LLM Multi-Agent Systems
  5. 2026Loud Failures, Quiet Failures: Fault Detection and Recovery in Tool-Using Language Model Agents
  6. 2026Verified Tool Calls Improve LLM Agent Reliability Under Non-Atomic Failures
  7. 2026Maintaining Benchmarks Against Increasingly Capable Agents: Detection and Remediation of Unearned Passes
  8. 2026Early Diagnosis of Wasted Computation in Multi-Agent LLM Systems via Failure-Aware Observability