One Bad Step, N Bad Steps: How LLM Agent Failures Cascade
Why a 10% per-step error rate in AI agents snowballs into total failure and how to stop context-driven contamination.

Stock photo for illustration only, not from the actual event
- Agent errors are not independent events but are coupled through the running context.
- A contaminated context increases the probability of failure for every subsequent step (p_c > p).
- Cascade severity scales super-linearly with the run length (N).
- The leverage lies in stopping the first mistake from propagating, not in achieving zero errors.
Many developers who reason about AI agents statistically often misjudge how errors behave. They measure a per-step error rate—such as 10% of steps producing incorrect outputs—and assume errors are entirely independent. Under this assumption, a single wrong step stays contained while the rest of the run proceeds normally. However, observing a real execution trajectory reveals a starkly different reality.
In practice, if step 4 gets a fact slightly off, step 5 reasons on top of that erroneous premise and commits to it even harder. Step 6 then takes an action based on both accumulated flaws, and by step 8, the agent is executing a doomed plan with absolute confidence. One mistake transforms into five because the errors are coupled through the context, turning a modest 10% step-error rate into a severely corrupted run.
This phenomenon is known as a cascade: a single fault amplifying vertically down a trajectory. Unlike the horizontal spread seen in distributed retry patterns where a bad condition hits multiple workers simultaneously, a cascade spreads through time within a single run because an agent's past output serves as its future input.
<
Stock photo for illustration only, not from the actual event
A stateless function that fails simply returns an error. An agent that fails does something far more dangerous: it writes the failure down into its transcript where it can read it again. The exact mechanism that makes agents functional—accumulating transcripts where every step conditions on prior history—is the exact channel down which mistakes travel.
From a software architecture perspective, cascades stem from the in-context learning nature of LLMs, where past outputs become treated as immutable ground truth by downstream steps. Mitigation requires active runtime interruption points rather than relying solely on baseline model accuracy.
"One bad step is not one bad step. It's a starting condition, and the agent will faithfully build on it until something makes it stop."
Loop & Retry
The severity of cascades worsens with run length (N), distinguishing it clearly from independent noise:
- N=4: 1.5x amplification
- N=8: 2.0x amplification
- N=16: 2.7x amplification
- N=25: 3.2x amplification
Independent faults scale linearly with N, whereas cascading faults scale super-linearly because a longer run gives an early fault more downstream steps to poison. This shares the same curve shape as the O(N²) token curve.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment