Why Retrying Fails: Context Contamination in LLM Agent Pipelines
Zhanfu Yang

TL;DR
This paper introduces the CCRM model to analyze how context contamination affects retry success rates in LLM agent pipelines, providing theoretical formulas and validation with real data.
Contribution
It offers a formal model and analytical results for understanding and optimizing retries in LLM pipelines affected by context contamination.
Findings
Exact success probability formula under contamination
Optimal pipeline depth formula for fixed budget
Validation shows CCRM fits real data better than IID model
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
