The Cost of Failure: Quantifying the Downstream Impact of Error Histories in LLM Agents

Jiahao Wang, Ruichuan An, Xinru Jiang, Sihan Yang, Hao Liang, Bohan Zeng and 3 more

TL;DR

This paper measures how leftover failure text in an agent's context, called Error Token Density, hurts later decisions. On Qwen3-8B ALFWorld rollouts, success falls from 40.1% at zero ETD to 6.7% when ETD is at least 40%.

Read this as a

Why builders care

Editor's note

Failure traces are not just a record of a miss: they drag down later turns even when the environment state is held fixed. Training with Tool-Feedback Advantage Shaping cut ETD by 26.5-67.7% versus outcome-only RL.

How to apply it

Editor's note
  1. 1Track Error Token Density in agent traces, the share of history taken up by execution-failure content.
  2. 2After a failed tool call, try removing or summarizing the failure turn rather than leaving the raw error in context.
  3. 3Prefer training signals that reward execution validity, not only final task success. TFAS reduced ETD by 26.5-67.7% versus outcome-only RL.
  4. 4Confirm the effect in your stack by inserting and deleting failure turns with state and budget held fixed, as the authors did.

Code

Not found

No verified code link yet. We checked the abstract, arXiv comments and Hugging Face; if the authors release code later it will show up here.

Key results

From the abstract
  1. 1

    On natural ALFWorld rollouts from Qwen3-8B, success is 40.1% at zero ETD and 6.7% when ETD is at least 40%.

  2. 2

    Controlled continuations separate this association from the effect of retained failure content: with environment state and remaining action budget fixed, inserting failure turns lowers success by 1.9-3.8 percentage points more than token-matched neutral insertions.

  3. 3

    Deleting existing failure turns yields complementary gains.

  4. 4
    67.7% relative to outcome-only

    Across all six model-environment settings, TFAS improves overall accuracy and achieves the lowest ETD among the compared policies, reducing ETD by 26.5-67.7% relative to outcome-only RL.

  • When an action fails, an LLM agent retains the action text and its feedback in the context used for subsequent decisions.
  • We study the downstream impact of this retained content as the Cost of Failure.

  • We define Error Token Density (ETD) as the fraction of an interaction history occupied by execution-failure content.
  • Failure-conditioned evaluations across planning, code execution, and visual tool use establish the broader relevance of the problem.
  • We test this principle with Tool-Feedback Advantage Shaping (TFAS), which combines separately normalized task-success and trajectory-level execution-validity advantages.

When an action fails, an LLM agent retains the action text and its feedback in the context used for subsequent decisions. We study the downstream impact of this retained content as the Cost of Failure. We define Error Token Density (ETD) as the fraction of an interaction history occupied by execution-failure content. On natural ALFWorld rollouts from Qwen3-8B, success is 40.1% at zero ETD and 6.7% when ETD is at least 40%. Controlled continuations separate this association from the effect of retained failure content: with environment state and remaining action budget fixed, inserting failure turns lowers success by 1.9-3.8 percentage points more than token-matched neutral insertions. Deleting existing failure turns yields complementary gains. Failure-conditioned evaluations across planning, code execution, and visual tool use establish the broader relevance of the problem. These findings motivate training agents to reduce the introduction of execution failures. We test this principle with Tool-Feedback Advantage Shaping (TFAS), which combines separately normalized task-success and trajectory-level execution-validity advantages. Across all six model-environment settings, TFAS improves overall accuracy and achieves the lowest ETD among the compared policies, reducing ETD by 26.5-67.7% relative to outcome-only RL. These measurements connect the intervention to lower failure-context density.

Everything on this page is written from this abstract. For methods and full results, read the paper PDF.

Ask the paper

Answers come from the paper summary and abstract.

Ask anything about “The Cost of Failure: Quantifying the Downstream Impact of Error Histories in LLM Agents”, or start with one of these:

Closest matches across the feed and every collection, by shared words in titles, topics and abstracts.