๐ค AI Summary
This work addresses the challenge of optimizing long-horizon agents, where raw execution trajectories are often redundant, heterogeneous, and cluttered with irrelevant stepsโleading to inefficient optimization and overfitting when used directly, or loss of critical causal information when naively truncated. To overcome this, the authors propose STRACE, a novel framework that first clusters failure modes at the batch level to select representative trajectories and then performs causal localization within individual trajectories using textual dependency graphs to prune non-causal steps and precisely extract root-cause modules. By integrating failure-mode mining with causal analysis on textual dependency structures, STRACE constructs high signal-to-noise optimization contexts, substantially improving both the efficiency and accuracy of policy learning. Evaluated on VeruSAGE-Bench, STRACE boosts expert agent success rates from 42.5% to 58.5%, significantly outperforming standard context-filtering baselines.
๐ Abstract
The optimization of long-horizon agents increasingly relies on reflection-based mechanisms, where a large language model (LLM) acts as an optimizer to diagnose agent failures and improve agent policies. However, real execution traces are difficult to use directly for optimization: large trace collections are often redundant and heterogeneous, making optimization inefficient and prone to overfitting to low-value failures; meanwhile, each individual trajectory also contains many irrelevant steps, while naive context reduction methods such as truncation or sliding windows can discard causally important evidence and produce misleading optimization signals. To resolve this dilemma, we introduce STRACE (Structural TRajectory Analysis and Causal Extraction), a framework that constructs high signal-noise optimization contexts for more precise and effective optimization. At the batch level, STRACE mines failure patterns to filter redundant traces and retain representative failures; within each selected trace, it performs causal localization over a textual dependency graph to remove non-causal steps and identify the true root-cause module for optimization. Empirical results demonstrate that STRACE significantly outperforms standard context-filtering baselines. Notably, on a challenging formal verification task (VeruSAGE-Bench), it successfully optimizes human-expert designed agents, delivering $1.4\times$ success-rate improvement (42.5% to 58.5%). The code is available at https://github.com/moomight/STRACE .