Error Trace Regression: Localizing Root Causes in Long-Horizon LLM Agent Trajectories
Abstract
Long-horizon LLM agents fail in ways that final-outcome metrics cannot detect: a subtle planning error at step 3 may silently corrupt memory and tool calls for the next fifty steps before producing a visible failure. We introduce Error Trace Regression (ETR), a diagnostic framework that formalizes the notion of a root-cause step and provides a statistically principled method to localize it from a full execution trace. ETR models the probability that an agent trajectory is failure-bound as a function of the step index and the step’s residual anomaly score, derived from a reference distribution of healthy trajectories. We prove that the ETR estimator is consistent and derive its asymptotic variance. Experiments on ALFWorld, GAIA, and WebShop show that ETR achieves sensitivity 0.81 for root-cause step identification, compared to 0.23 for final-outcome evaluation and 0.47 for step-level log-probability baselines, with median localization error reduced by 4.1 steps.