Agentic System Performance Degrading? Use Trace Comparison to Locate Root Causes

IBM proposes trace comparison to locate agent fault root causes by comparing successful and failed traces, recovering ~40% of performance lost from model swaps.
The article introduces IBM AgMentor's trace comparison method for the pain point that agent systems degrade sharply after swapping in smaller models during productionization, while benchmark scores and raw logs cannot pinpoint the problem. Treating a successful run as a demonstration, it compares failed traces component by component to find the earliest behavioral divergence as the root cause rather than chasing downstream symptoms. Aggregating differences across runs distills recurring failure patterns with reviewable fix suggestions. In CUGA's backbone model migration, it recovered ~40% of AppWorld performance loss and improved run-to-run consistency. The authors stress its boundary: it works best when failures stem from behavioral unreliability, not fundamental capability gaps.
Why Does an Agent "Malfunction" When You Swap in a Smaller Model?
Many teams build agent systems with frontier large models during development, then switch to smaller, cheaper models at launch to cut costs—only to see performance plummet. What's trickier is that neither existing benchmark scores nor raw execution traces can tell developers which part of the system broke.
The Trace Comparison method proposed by the IBM AgMentor team addresses exactly this pain point. It treats a successful run as a "demonstration" and then identifies the point where a failed run first deviates from the successful trace, thereby locating the root cause instead of just observing downstream symptoms.

Core Idea: Compare Success and Failure to Find the Earliest Divergence Point
When debugging agent systems conventionally, developers face lengthy execution logs and struggle to determine whether the problem lies in planning, tool invocation, or the memory module. Trace comparison takes a direct approach: for the same task, collect successful and failed execution traces separately, then compare component by component to find the earliest behavioral difference.
This earliest difference point is often the source of the fault—subsequent errors cascade from here. For example, the planning stage selects the wrong tool, causing all subsequent steps to diverge, even though on the surface it may only look like a wrong final answer. By locating the earliest divergence point, developers can directly fix the planning logic rather than patching the final output.
According to the paper, aggregating these differences across multiple runs also yields recurring failure patterns with suggested fixes that developers can review, apply, and re-validate.
Execution Trace is the foundational concept for understanding this method. In an agent system, a single run produces a complete interaction record: the prompts the model receives, the planning steps it outputs, the tools it calls and their parameters, the results returned by tools, and how this information is fed back to the model for the next round. This chronologically ordered record is the trace. Trace granularity is typically fine-grained down to individual LLM calls or individual tool calls, so "component-by-component comparison" actually means aligning corresponding planning nodes, tool-call nodes, and memory read/write nodes in two traces and comparing their content differences one by one.
Agent component partitioning is also a key prerequisite. A typical agent architecture includes modules such as planning (deciding what to do next), tool use (executing concrete actions), and memory (storing and retrieving context). Trace comparison can locate root causes precisely because it attributes failures to specific component nodes rather than vaguely to "the model isn't good enough."
Measured Results: ~40% of Performance Lost from Model Swap Can Be Recovered
The paper validates trace-guided modifications on three agent systems, showing improvements in both task success rate and run-to-run reliability. The most compelling experiment is CUGA's backbone model migration: after swapping out the underlying model, performance on the AppWorld benchmark dropped, and trace-comparison-guided modifications recovered approximately 40% of the lost performance.
In self-comparison scenarios—i.e., comparing different runs of the same system—the method also significantly improves run-to-run consistency. This means it can fix not only hard failures but also reduce random fluctuations in output.
It should be noted that the paper points out this method is best suited for scenarios where failures reflect unreliable behavior rather than fundamental capability gaps. If a smaller model genuinely lacks the capability required to complete a task, trace comparison can only do so much—it optimizes behavioral consistency, not conjure capability out of thin air.
AppWorld is a benchmark for interactive coding agents that simulates API environments of everyday applications (such as email, banking, shopping, etc.), requiring agents to complete composite tasks through multi-step tool calls while evaluating both task success rate and adherence to execution protocols. CUGA is IBM's general-purpose agent framework, and its backbone model refers to the underlying large language model that drives agent decisions. The so-called "backbone model migration" means replacing CUGA's original large model with a smaller one, which corresponds exactly to the production cost-reduction scenario described at the beginning of this article. Therefore, the 40% recovery rate in this experiment was achieved under conditions closest to real pain points.
Self-comparison refers to trace comparison between different runs of the same model and same system. It improves run-to-run consistency because LLM sampling is stochastic—the same input may produce different traces. By identifying divergence points between successful and failed runs, system behavior can converge toward successful patterns.
Practical Implications for Developers
For teams moving agent systems from prototype to production, this research offers several actionable insights:
- Don't just look at scores: When benchmark scores drop, use trace comparison to pinpoint degradation in specific components—far more efficient than blindly tuning parameters.
- Build a library of successful traces: Use successful runs as reference standards and automatically compare on failure to form a diagnostic loop.
- Distinguish capability problems from reliability problems: If failure patterns are sporadic and inconsistent, trace comparison is more likely to help; if the system systematically gets things wrong, you may need to switch models or decompose tasks.
This method has been deployed in IBM AgMentor, representing a practical attempt to advance debugging from "reading logs and guessing at problems" to "structurally locating root causes." For engineering teams relying on agent systems, this comparison-centric diagnostic approach is worth incorporating into the production toolchain.
The distinction between capability gaps and behavioral unreliability deserves further elaboration. A capability gap means the model itself lacks the knowledge or reasoning level required to complete a task, manifesting as systematic, reproducible failures—rephrasing the question or re-running multiple times still fails. Behavioral unreliability means the model has the capability but produces unstable output, manifesting as sporadic failures and inconsistent results across multiple runs of the same task. This is precisely the effective boundary of trace comparison: it can identify and correct paths where "success was possible but deviation occurred," but it cannot teach a model skills it fundamentally lacks. In practice, the variance in success rate across repeated runs can be used as a rough indicator of which category a problem falls into.
One-line Summary
IBM proposes trace comparison to locate agent fault root causes by comparing successful and failed traces, recovering ~40% of performance lost from model swaps.
Paragraph Summary
The article introduces the trace comparison analysis method from IBM's AgMentor team, addressing the pain point that agent system performance plummets after swapping in smaller models during productionization, while benchmark scores and raw logs cannot locate the problem. The method treats a successful run as a demonstration, compares failed traces component by component, and identifies the earliest behavioral divergence point as the root cause rather than dwelling on downstream symptoms. Aggregating differences across multiple runs also distills recurring failure patterns with reviewable fix suggestions. In CUGA's backbone model migration experiment, the method recovered approximately 40% of AppWorld performance loss and improved run-to-run consistency in self-comparison scenarios. The authors emphasize its applicable boundary: it is best suited for scenarios where failures stem from behavioral unreliability rather than fundamental capability gaps, and they offer practical insights for developers such as building a library of successful traces.
Related articles

Small-Model Multi-Task Post-Training: SFT Cold Start and RL Fine-Tuning for Recruiting Match
A small-model multi-task post-training practice based on Qwen3-4B: SFT cold start and GSPO reinforcement learning complete resume screening and ad-invitation ranking without CoT reasoning, significantly improving exact-match rates on structured tasks, with online rules for opening LLM reranking by pCVR range and job family.

Pessimistic Process Supervision: A New Method for Error Tracing in Medical Reasoning
Early errors in medical reasoning propagate to later steps. This article introduces a pessimistic process reward model (PRM) that distinguishes original from inherited errors and predicts error sources, enabling correction at the root to improve answer accuracy.

Optio-Audio-Jev: A Unified Audio Decision Interface That Breaks the Option Limit
Optio-Audio-Jev proposes a unified audio decision interface that replaces fixed output heads with [OPT] token matching, breaking the option limit. Trained on only 13 options, it still maintains 86-90% accuracy on 50-option ESC-50 questions, far exceeding the Jev head's 22-24%, with code, models, and server open-sourced.