acceptodds
Under review as a conference paper at ICLR 2027

The Cost of Failure: Quantifying and Mitigating the Impact of Trajectory Errors on Agent Robustness

Abstract

Large Language Model (LLM) agents solve long-horizon tasks by repeatedly acting, observing feedback, and conditioning later decisions on the accumulated interaction history. This trial-and-error process creates a Cost of Failure: invalid actions, execution errors, and low-value feedback persist in the context, polluting later decision making, though models try to recover from mistakes. We quantify this effect with Error Token Density (ETD), controlled context interventions, and failure-conditioned evaluations. On natural ALFWorld rollouts from Qwen3-8B, success drops from 71% with no error-token accumulation to 6.7% when error tokens occupy more than 40% of the trajectory context. Controlled interventions provide causal evidence that accumulated failure context substantially reduces task success, while removing it improves performance. Across ReTool, OpenThinkImg, and ALFWorld, the same failure-conditioned gap appears even for advanced closed-source models. To reduce this failure-induced context pollution, we propose Tool-Feedback Advantage Shaping (TFAS), which combines an accuracy advantage with a tool-feedback advantage estimated from trajectory-level tool-use quality. Unlike outcome-only reinforcement learning, this objective preserves final task credit while separately discouraging invalid intermediate actions. Experiments across three environments and both 4B/8B text and vision-language models show that TFAS achieves the best overall accuracy in all six model-environment settings; notably, on ALFWorld with Qwen3-8B, it improves outcome-only RL from 31.2% to 41.2% overall accuracy and from 21.0% to 52.4% accuracy on error-containing trajectories.

open until 14 Dec 2026

est. 32% chance this paper gets accepted at ICLR 2027.

Reject 68%Accept 32%

What do you think this paper will get?

All positions stay anonymous.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.