TL;DR
When complex AI agent systems fail, figuring out where things went wrong in a 300,000-token execution log is like finding a needle in a haystack. Instead of forcing an LLM to passively read the entire log at once, the authors built AgenTracer-v2—a tiny, 4B-parameter detective agent that skims logs, drills down into suspicious steps, and uses live web search and code sandboxes to verify where the trajectory derailed. Not only does it outperform frontier models like GPT-5.2 and Gemini-3-Pro at pinpointing errors, its critiques actually help broken agents fix themselves.
What Problem Does This Paper Address?
Modern LLM agents aren't just chatbots anymore; they are sprawling systems with planners, sub-agents, memory modules, and external tools. As systems engineers love to remind us, complexity is the enemy of reliability—popular multi-agent frameworks can suffer failure rates up to 86.7%.
When an agentic run fails after dozens of steps, we need agent failure attribution: pinpointing the decisive error step (the earliest mistake that causally doomed the run) and the agent responsible. Currently, automated "tracers" act like passive readers. They try to swallow the entire execution log in a single pass or follow rigid, pre-programmed scanning rules. That approach falls apart when logs stretch past hundreds of thousands of tokens. Worse, passive reading isn't how human engineers debug! Humans skim for anomalies, form hypotheses, zoom in on specific lines, and run quick tests to verify their hunches. This paper asks: Can we train an autonomous agent to debug other agents the way a human investigator would?
Methods
The authors tackle both the data bottleneck and the debugging architecture through two novel components:
- Tracer-Flywheel (The Data Engine): To train a debugger, you need ground-truth labels of exact error steps. Because most agent frameworks lack a "rewind" button, the authors built a virtual rollback operator that replays a trajectory deterministically from the start to restore any exact historical state. Using this, they generate training data in two ways:
- Counterfactual Rollback: Taking failed runs, rewinding step-by-step, and having an oracle propose fixes until the run flips to a success.
- Agentic Fault Injection: Taking successful runs, rewinding to a specific step, and injecting realistic, context-aware bugs (e.g., memory hallucinations or planning flaws) to see if they cause a crash.
- AgenTracer-v2 (The Proactive Investigator): Built on a lightweight
Qwen3-4B-Instructbase, this agent debugs in three human-like phases: - Global Overview: It reads the massive trace in small, fixed chunks (3 steps at a time), updating a compact running memory and discarding the raw text so its context window never overflows.
- Iterative Inward Inspection: Using an
InspectSteptool, it non-linearly jumps around to zoom in on raw tool I/O and states of suspicious steps. - Active Outward Exploration: To avoid hallucinating during diagnosis, it invokes external sub-agents (
OnlineSearchandCodingTestsandboxes) to fact-check claims or test code snippets in the real world.
Finally, the model is trained via Reinforcement Learning Leave-One-Out (RLOO). Because finding one exact step in a massive log is a sparse-reward nightmare, they use a clever Gaussian kernel reward—giving the agent "warmer/colder" partial credit the closer its guess gets to the true error step, alongside a bonus for an exact hit.
Datasets
- Newly Curated Training Dataset (Tracer-Flywheel 8K): The authors generated 8,396 precisely annotated failure trajectories (ranging from 1 to 400K tokens) by running five agent frameworks (ReAct, OpenHands, Flash-Searcher, CK-Pro, AgentOrchestra) across nine diverse benchmarks (GAIA, TaskCraft, ToolQA, WebWalkerQA, xBench-DeepSearch, DeepSearchQA, AssistantBench, Birds, and KodCode).
- Evaluation Benchmarks: They tested attribution accuracy on Who&When, AgentErrorBench (GAIA, ALFWorld, WebShop), and TRAIL. Downstream self-improvement was tested on held-out sets including CoSQL and TaskCraft, while RL reward-shaping was evaluated on GSM8K, MATH500, MBPP, and HumanEval.
Key Insights and Ideas
- Scale doesn't save passive readers: Throwing a massive context window at a giant proprietary model doesn't mean it can debug. On logs exceeding 300K tokens, GPT-5.2's step-level attribution accuracy collapses from 23.0% down to 2.3%. Active compression and targeted probing beat brute-force context ingestion.
- Debugging requires grounding in reality: Ablation studies show that stripping away AgenTracer-v2's ability to run live web searches or code tests noticeably hurts accuracy. Sometimes you can't tell if an agent made a mistake just by reading its thoughts—you have to verify the facts yourself.
- Failure tracers solve the RL credit-assignment problem: In multi-agent reinforcement learning, if a 50-step run fails at the end, who gets penalized? Using AgenTracer-v2 as a process-level reward model to penalize only the responsible agent's steps measurably boosts RL training.
Key Results
- Outperforming Frontier Giants: Despite having only 4B parameters, AgenTracer-v2 beats massive proprietary models and prior specialized tracers by up to 21.83% in attribution accuracy (hitting 52.80% step accuracy on Who&When-Algo vs. 46.83% for GPT-5.2 and Gemini-3-Pro).
- Long-Horizon Stability: On ultra-long trajectories (>300K tokens), it outperforms GPT-5.2 by 17.0% and Gemini-3-Pro by 14.5%.
- Downstream Self-Improvement & RL: Feeding AgenTracer-v2's diagnoses back to failing off-the-shelf agents over four retry rounds boosts task accuracy by +21.2% on Smolagents+GAIA and +13.4% on OpenHands+CoSQL. Embedding it into the MARTI multi-agent RL framework yields an average ~4.28% gain across math and coding benchmarks.
Limitations and Future Work
- Token and Latency Overhead: Proactive investigation isn't instant. Because AgenTracer-v2 summarizes chunks, loops over steps, and calls external tools, it consumes roughly 1.3x to 1.5x more tokens (53.6K on average) and takes longer (42.7s wall-clock time vs. ~31–35s for single-pass frontier models). The authors note this trade-off is practical since debugging is typically an offline task, and running a 4B model is vastly cheaper per token than frontier APIs.
- Virtual Rollback Overhead: Because agent frameworks lack native state snapshots,
Tracer-Flywheelmust deterministically replay runs from step zero to recreate intermediate states during dataset synthesis. - (Explicit future work directions are not discussed in the main text of the paper.)
Summary updated