Tracing Agentic Failure from the Flow of Success

Samuel Yeh, Yiwen Zhu, Shaleen Deep, Sharon LiNeurIPS 2026

TL;DR

When an AI agent fails a complex, multi-step task, figuring out where it went off the rails is notoriously expensive and tedious. Instead of burning money prompting massive LLMs to play detective—or manually labeling thousands of errors—researchers propose OAT, a tiny model that learns the continuous "flow" of successful runs in latent space. By training on just ~100 successes and zero failures, OAT spots the exact steps where an agent stumbles up to 5,000$\times$ faster than frontier LLMs, and with higher accuracy.

What Problem Does This Paper Address?

Picture an LLM-based agentic system trying to write code or conduct research. It orchestrates sub-agents, calls tools, reads outputs, and takes dozens or hundreds of steps. And then... it fails.

Finding the root cause—known as failure attribution—is a major bottleneck. A bad decision at step 4 might be partially masked by a clever workaround at step 12, only to crash the whole task at step 50. Currently, you have two unappealing options to automate this diagnosis:

  1. Prompting frontier LLMs to read the massive log and guess what went wrong (slow, expensive, and surprisingly inaccurate—often below 15% accuracy).
  2. Supervised post-training, where you train a model on failed trajectories with human-annotated, step-by-step error labels (painstaking to collect, ambiguous, and nearly impossible to scale).

The authors ask a refreshing question: What if we never show our diagnostic model a single failure during training? Since successful runs are easy to collect as a natural byproduct of normal operation, they formulate unsupervised failure attribution—learning strictly from what right looks like.

Methods

Think of a successful agent's execution not as a choppy list of text logs, but as a smooth, goal-directed current flowing from an initial query to a final solution. OAT (One-class Agent Tracing) models this current inside the LLM's internal representation space.

Here is how it works:

  • Step Representations: For every step an agent takes, OAT extracts the last-layer hidden states from an LLM (mean-pooled across tokens and compressed via PCA to 64 dimensions).
  • Continuous Dynamics (Standard meets Novel): Rather than using discrete sequence models like RNNs, OAT treats these steps as points along a continuous path normalized to the interval $[0, 1]$, using Neural Controlled Differential Equations (Neural CDEs). Unlike basic Neural ODEs (which depend only on the starting point), Neural CDEs use a cubic spline of the actual observations to continuously steer the latent state, making them sensitive to local, step-by-step behavior.
  • Gated Control Path (Novel): If OAT encounters an unfamiliar, out-of-distribution (OOD) task at test time, wild derivatives along that spline could destabilize the math. The authors introduce a learnable neural gating function that acts like a surge protector, dampening unfamiliar control signals while letting normal signals pass through.
  • Anomaly Detection: Because OAT's lightweight 3-layer MLP is trained only to reconstruct successful paths, it expects normal progress. At test time, if an agent hallucinates or botches a tool call, its actual hidden state snaps away from OAT's predicted path. High reconstruction error = high anomaly score. Steps are flagged using either a simple Top-$k$ cutoff or Conformal Prediction (CP), which uses held-out successes to set a statistically principled threshold.

Datasets

  • MCP-Atlas (In-Domain): A single-agent tool-calling benchmark. The authors sampled trajectories using Qwen3.5-27B, collecting 103 clean successes (80% train, 20% calibration) and manually annotating sets of failure-contributing steps across 88 failed runs.
  • Who&When (Out-of-Distribution): An existing benchmark of 184 failed multi-agent trajectories generated by GPT-4o on GAIA and AssistantBench tasks, labeled with the earliest decisive error step.

Key Insights and Ideas

  • Success has a universal geometry: Even when OAT is trained on single-agent Qwen trajectories (MCP-Atlas) and tested on multi-agent GPT-4o trajectories (Who&When)—using Qwen as a proxy to read GPT-4o's text and aligning basic statistics via CORAL—it still beats GPT-5. Coherent reasoning and steady progress toward a goal share underlying dynamical patterns regardless of the task or generator model.
  • Continuous beats discrete: Neural CDEs substantially outperform both Neural ODEs and discrete RNNs, proving that modeling the continuous rate of change between agent steps is crucial for catching localized mistakes.
  • Look deep into the LLM: Ablations across Qwen's 64 layers show a steady climb in diagnostic accuracy the deeper you go; late layers hold the abstract, task-relevant semantics needed to tell a smart move from a blunder.

Key Results

Trained on fewer than 100 successful trajectories and requiring less than 1 GB of VRAM, OAT outperforms prompting baselines (GPT-4o and GPT-5) and classical anomaly detectors (OC-SVM, Isolation Forest):

  • In-Domain (MCP-Atlas): OAT (CP) achieves a 0.435 F1 score and 0.324 AUPRC, beating GPT-4o (0.212 F1) and GPT-5 (0.181 F1) by over +20% F1 and +10% AUPRC.
  • Out-of-Distribution (Who&When): OAT hits 0.225 F1 (Top-$k$) and 0.758 AUROC, outperforming GPT-5 (0.152 F1, 0.584 AUROC) by +7% F1.
Table 3: OAT costs much less than prompting-based base- lines. We report the number of output tokens and detection latency for each approach. The lowest cost is marked as bold.
  • Speed & Cost: Prompting GPT-5 takes ~38–40 seconds and ~3,000 output tokens per trajectory. OAT uses 0 tokens and runs in 7–16 milliseconds once hidden states are in hand (200–5,000$\times$ faster)—and even if you have to run a proxy LLM from scratch to extract hidden states, it takes ~1 second (still 4–35$\times$ faster).
  • Qualitative: OAT cleanly spikes on hallucinations, code bugs, and unfaithful assumptions, while keeping scores flat on benign steps.

Limitations and Future Work

  • Subtle root causes vs. obvious symptoms: In qualitative failure cases, OAT sometimes misses a quiet, annotated root-cause error early in a run, though it assigns gradually rising anomaly scores to suboptimal plans and reliably catches later steps where the failure becomes explicitly verbalized.
  • Thresholding trade-offs: Top-$k$ requires guessing how many errors exist (tending to over-detect), while Conformal Prediction is more conservative. Developing more adaptive detection strategies is a promising next step.
  • Cross-model representation shifts: Evaluating trajectories from closed-source models (like GPT-4o) requires running an open-weights proxy model to extract hidden states and applying statistical alignment (CORAL) to bridge style differences.

Summary updated

Abstract

Failure attribution for LLM-based agentic systems, i.e., identifying which steps in a failure trajectory caused the task to fail, is critical for debugging and improving these systems. Existing approaches either rely on prompting-based pipelines, which are computationally expensive, or require post-training on failure trajectories with step-level error annotations, which are costly to collect and difficult to scale. We argue that a practical failure attribution model should be lightweight and trainable without step-level supervision on failure data. To this end, we address unsupervised failure attribution, i.e., training exclusively on successful trajectories and identifying error steps at inference time given a failure trajectory. We propose OAT, which casts this problem as one-class learning with neural controlled differential equations, modeling the dynamical pattern of successful trajectories in latent space. At inference time, each step in a failure trajectory is assigned an anomaly score based on its deviation from the dynamics learned on successful trajectories, which is then used to form a set of error steps. With training on only 100 successful trajectories, experiments show that OAT is 200--5000$\times$ faster than prompting-based baselines, and, at the same time, consistently outperforms them in both in-domain and out-of-distribution datasets with +20% and +7% F1 scores, respectively, demonstrating that OAT is a promising and efficient direction for diagnosing agentic system failures.
BibTeX
@inproceedings{yeh2026tracing,
  author = {Samuel Yeh and Yiwen Zhu and Shaleen Deep and Sharon Li},
  title = {{Tracing Agentic Failure from the Flow of Success}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=dPFKov09YE},
}
Figure