Error Propagation and Context Limits: The Technical Failure Modes of Prompt Chaining

ELI5
Prompt chaining breaks when errors from early steps get passed to later steps as facts, when the context window fills up and old instructions fade, or when the model loses focus on information buried in the middle of a long context. Each failure mode compounds — and most are invisible until the final output is wrong.
A chain of prompts looks like engineering. Each step has a clear input, a defined task, a clean output. The output feeds the next step. Repeat. You feel like you are writing a program.
The problem is that you are not writing a program. You are threading probabilistic outputs through a system that has no error-catching, no type-checking, and no memory beyond what you explicitly pass. When step three receives a subtly wrong answer from step two, it does not raise an exception. It reasons from the wrong premise — and does so with complete confidence.
This is not a configuration problem. It is a consequence of what these models actually are.
Where the Geometry of a Chain Goes Wrong
Prompt Chaining pipelines feel deterministic from the outside. You define the steps, you connect the outputs. But inside each step, the model is sampling from a probability distribution conditioned on everything in its context. That sampling process does not distinguish between facts and errors. A wrong number from step two looks, to step three, exactly like a right number from step two.
The failure modes are not random. They have geometry.
What are the failure modes and technical limitations of prompt chaining?
The most systematic account of what breaks in LLM systems at the pipeline level appears in a 2025 taxonomy (arXiv, Vinay 2025) that catalogues 15 distinct failure modes — including multi-step reasoning drift, context-boundary degradation, version drift, and cost-driven performance collapse. Each of these has a different shape in a prompt chain.
Multi-step reasoning drift is the clearest. Each step introduces a small positional shift in the probability distribution. The model in step one might frame a concept slightly differently than intended. Step two inherits that framing and amplifies it. Step five is working from a version of the original problem that no longer resembles what you started with. The chain has not crashed — it has drifted.
Context-boundary degradation is more architectural. Every turn in a chain accumulates tokens: the input, the output, the scaffolding between them. Anthropic’s platform documentation on context windows notes that each turn’s input and output accumulates, and that engineers should reserve 15–20% of the context budget for the response and a safety margin (Anthropic Docs). Hit that ceiling without planning for it and the model begins truncating earlier content — silently, without warning. The instructions you placed at the beginning of the chain may no longer be in the window when the final step executes.
Version drift is operational rather than mathematical. A chain that works today against Claude Sonnet 4.6 may behave differently if the underlying model changes. The intermediate steps are not versioned. Your chain’s behavior is a function of the specific model checkpoint serving each request — and that checkpoint is not guaranteed to be stable across deployments.
Cost-driven performance collapse is a subtler failure: you notice cost and switch to a cheaper model for certain steps. The cheaper model may have a significantly smaller context window or weaker instruction-following on complex steps, and the degradation propagates forward into all downstream steps.
How does error propagation compound across steps in a long prompt chain?
The compounding is multiplicative, not additive. Assume each step introduces a 5% probability of a meaningful error. In a three-step chain, the probability that at least one step introduced an error compounds — two uncorrelated error rates give you a failure probability higher than either alone. In a ten-step chain, the probability of a clean run shrinks geometrically with chain length.
The mechanism is that each downstream step treats its input as ground truth. There is no Bayesian updating across steps; the model in step five cannot introspect on whether step two was reliable. It can only sample from what is in its context.
Research on chain-of-thought perturbation makes this quantitative. Aravindan and Kejriwal (arXiv, 2026) injected small mathematical errors into reasoning chains and measured downstream accuracy collapse. In smaller models, accuracy dropped by 50–60% under introduced math errors. Even mid-sized models lost more than 5% accuracy under unit conversion errors that were subtle enough to be plausible (arXiv, Aravindan & Kejriwal 2026). The injected error was a proxy for what happens naturally when an early step in a real chain makes a plausible but wrong intermediate inference.
The chain does not alert you. The final step receives a well-formed, fluent input — it just reasons from a wrong premise.
The Attention Problem That Compounds Everything
Context window size is an often-cited solution to chain failures: a larger window means you can keep more history in context, maintain earlier instructions, and avoid truncation. But larger windows introduce a failure mode that is orthogonal to the ones above.
Liu et al. (ACL Anthology, TACL 2024) documented a U-shaped accuracy curve across context position. When critical information is placed in the middle of a long context — rather than at the beginning or end — model performance degrades significantly. The paper documents accuracy drops widely cited above 30% when relevant information sits at mid-context compared to edge positions, a finding replicated across architectures in subsequent work (ACL Anthology). A longer chain that passes intermediate results as mid-context text is not necessarily safer. It may be more vulnerable.
The mechanism is attention distribution. A model attending to a 1M-token context does not attend uniformly. Recency and primacy receive disproportionate attention weight in practice. Information that was critical in step four of a seven-step chain may be effectively invisible to step seven — not because it was truncated, but because it is buried in a region the model’s attention underweights.
Modern flagship models report near-perfect recall on Needle-in-a-Haystack benchmarks — GPT-4.1 claims 100% recall across 1M tokens, Claude 3 reports 99%+ (OpenAI Blog; Anthropic Docs). But these are single-fact retrieval tests. Multi-hop reasoning across a long context is a harder problem that remains less benchmarked. The models that claim 99% single-fact recall may still fail on “find fact A, find fact B, and reason about how they interact.” Chains depend on exactly this kind of multi-hop reasoning.

What the Failure Geometry Predicts
Understanding the failure modes as geometry rather than randomness lets you make concrete predictions about when a chain will fail and how.
If a chain step places its most critical output in the middle of a long context — not at the beginning or end — the next step is likely to underweight it. The fix is to restructure the handoff: either summarize the critical output at the end of each step’s response, or place it explicitly at the start of the next step’s context.
If a chain has more than five or six steps, the compounding error probability warrants measurement rather than intuition. A short ablation — running the chain with known inputs whose correct intermediate outputs you can verify — reveals which steps introduce drift. This is not optional for production chains; it is the minimum bar for knowing whether your chain works.
If cost pressure pushes you toward a smaller model for intermediate steps, the context window and instruction-following ceiling of that model becomes a constraint on every downstream step. Claude Haiku 4.5 has a 200k token context and $1/$5 per MTok pricing (Anthropic Docs); Claude Sonnet 4.6 and Claude Opus 4.8 both extend to 1M tokens at $3/$15 and $5/$25 respectively. The price difference is real. So is the capability ceiling for complex multi-step reasoning.
Token accumulation has a practical mitigation that carries a non-trivial tradeoff. Chain of Draft (CoD) reasoning reduces token usage by roughly 92% compared to full chain-of-thought, using approximately five words per reasoning step while matching accuracy on well-studied benchmarks (TokenOptimize). That compression ratio is real — but a single study across limited task types should be treated as a promising signal, not a universal result. Aggressive compression can trigger output token explosion on some tasks, producing longer outputs that consume more context than they saved.
The
Pydantic AI ecosystem for structured chain outputs added a significant breaking change with v2.0.0 (released June 23, 2026): the default execution end strategy changed from 'early' to 'graceful', and Bedrock, Groq, and Mistral providers are no longer included by default — they must be added explicitly (PydanticAI Docs). Any chain built on pydantic-ai v1 patterns will behave differently against v2 without code changes. This is version drift made concrete.
Framework compatibility notes:
- PydanticAI v2.0.0 (June 23, 2026): Breaking API changes from v1 — default execution strategy changed (
'early'→'graceful'), Bedrock/Groq/Mistral providers removed from default deps. Chains built on v1 patterns require explicit migration. See PydanticAI Docs.- LangGraph
langgraph.prebuilt: Deprecated in favor oflangchain.agents, but the migration breaksstream_mode="messages"token streaming. See GitHub Issue #6363.
Rule of thumb: treat each step in a prompt chain as a potential error source, not a reliable function. Verify intermediate outputs on known inputs before trusting the chain’s final output on unknown ones.
When it breaks: prompt chains fail silently when an intermediate step produces a plausible but wrong output — the model downstream reasons with high confidence from a wrong premise, and the final output looks fluent and well-formed. There is no exception, no warning, and no signal in the output format that an error has propagated.
The Data Says
Prompt chain failures are predictable from first principles: error compounding is multiplicative, attention degradation is geometric with context position, and version drift is an operational tax on every deployed chain. The research literature on CoT perturbation and the “Lost in the Middle” attention curve gives those failure modes quantitative shape. A chain that looks like engineering behaves like probability — and probability compounds in ways that intuition underestimates.
AI-assisted content, human-reviewed. Images AI-generated. Editorial Standards · Our Editors