TRANSMISSION // 2612.05659v1

Why AI Agent Debugging May Start With the Trace

Source published

A preprint tests a lightweight trace-based model against reported baselines on two debugging benchmarks, with mixed results across metrics and important limits.

AI-generated conceptual illustration for Why AI Agent Debugging May Start With the Trace
AI-generated conceptual illustration; not documentary evidence.

When an AI agent fails, its final answer may not show where things went wrong. A preprint tests whether analyzing execution traces—the recorded steps, tool calls and system events—can help locate failures on benchmark tasks.

The debugging problem

AI agents may reason through a task, call tools, receive observations and update their state over many steps. An early mistake, such as a faulty tool call or a misread result, can affect what happens next. The final outcome may show that a task failed without revealing where the failure began.

This study asks whether diagnostics tied to an agent’s actual execution trace can identify and locate errors more effectively than high-level explanations generated by large language models (LLMs). The researchers define a trace as a structured sequence of “spans,” representing events such as reasoning steps, tool invocations and system operations. Their task is to classify errors and point to the span or spans associated with them.

A lightweight model of trace events

The researchers evaluated their approach on TRAIL, a benchmark containing 148 traces and 1,987 spans. The traces come from two settings: GAIA, focused on information-seeking and tool use, and SWE-bench, focused on software-engineering tasks. Of the spans, 575 were annotated with at least one error.

They converted traces into a consistent format and trained a lightweight logistic-regression classifier to assess spans individually. Its inputs included text from span metadata and recorded inputs and outputs, plus structural details and indicators of patterns such as exceptions, rate limits and authentication failures. The model could also use information from neighboring spans. It predicted error categories and ranked spans as candidate locations for each error.

The researchers compared its results with LLM-based results reported in TRAIL and follow-up work. They used category-level F1, which combines precision and recall, and localization accuracy (hit@1), which measures whether the top-ranked span matches the annotated error location. They also report hit@3 and hit@5: whether the correct location appears among the top three or five candidates.

Results depend on the metric

On GAIA, the trace-based model scored 0.476 on category F1 and 0.613 on localization accuracy. The highest category F1 among the listed LLM baselines was 0.389. But the trace-based model did not lead on every measure: the reported FAGI-AgentCompass baseline had higher localization accuracy, 0.657, while its category F1 was lower, at 0.309.

On SWE-bench, the trace-based model scored 0.594 on category F1 and 0.469 on localization accuracy, exceeding the reported baselines that produced valid predictions on both measures. Several LLM results were unavailable because those systems could not produce valid predictions under the benchmark’s context-length limits. In this implementation, processing spans individually avoided the need to fit an entire trace into one context window. That is an advantage in this setup, not evidence that all trace-based systems avoid context limits or that other LLM approaches could not address them.

The correct error location appeared among the model’s top five candidates about 86% of the time on GAIA and 78% on SWE-bench. These figures describe benchmark rankings; they do not establish that the model’s suggestions help developers debug more quickly or correctly in practice.

What remains uncertain

The results do not show that trace-based models are universally better than LLMs. The benchmark is relatively small, and the authors say results may be sensitive to data splits and threshold selection. Some failures may be easier to detect because traces contain explicit clues, such as error messages or status codes. The authors call for tests that mask these clues and examine subtler failures, including poor decisions that leave no visible error signal.

The LLM results were taken from prior work, rather than generated in a new comparison where every method was optimized under identical conditions. The authors note that fine-tuned or retrieval-augmented LLM systems might narrow the gap. They also report reduced performance when training on one domain and evaluating on another, indicating that diagnostic patterns learned in one type of workflow may not transfer readily to another.

The study measures benchmark performance, not whether diagnoses are actionable or useful to practitioners. The paper is a preprint, so its findings are preliminary rather than settled. A practical question for future work is whether grounding diagnostics in trace structure improves debugging beyond these benchmark comparisons—and whether developers find the resulting rankings useful in real workflows.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • RAGLog looks for hidden faults behind AI-generated answers

    Shared method: Both analyze recorded execution data to localize failures: the origin paper uses a span-level model on agent traces, while RAGLog maps API logs to RAG stages and applies rule-, embedding-, and LLM-based checks. Their shared execution-grounded approach does not make their results directly comparable; they study different systems, labels, and benchmarks.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2612.05659v1 — Original paper

      Excerpt reference: static/papers/2612.05659v1.md:177-246
      Basis: Paper text
      Source file SHA-256: a70ced02cd365186cdf5bdeb2d7fba88d68a66106a8824832fdb3cf9bffb1e97

    • 2611.03725v1 — Original paper

      Excerpt reference: static/papers/2611.03725v1.md:189-284
      Basis: Paper text
      Source file SHA-256: 375be9db2b0a3abad053068d1632bfb647f5ec8a04833d564a8059901bbc9147

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.