通过分析轨迹中的因果关系,精准定位智能体失败根源,提升优化效率。
From Noisy Traces to Root Causes: Structural Trajectory Analysis and Causal Extraction for Agent Optimization

- 构建文本依赖图,识别并剔除无关步骤,保留关键因果路径。
- 在VeruSAGE-Bench上使成功率从42.5%提升至58.5%,提升1.4倍。
- 适合需要高精度优化的复杂任务,如形式化验证与长时序智能体训练。
长时序智能体的优化日益依赖基于反思的机制,即大语言模型(LLM)作为优化器诊断失败并改进策略。然而真实执行轨迹难以直接用于优化:大规模轨迹集合常冗余且异质,导致优化效率低且易过拟合于低价值失败;同时单条轨迹中存在大量无关步骤,而简单的截断或滑动窗口方法可能丢弃因果关键证据,产生误导性优化信号。为此,我们提出STRACE(结构化轨迹分析与因果提取)框架,构建高信噪比的优化上下文以实现更精确有效的优化。在批量层面,STRACE挖掘失败模式以过滤冗余轨迹并保留代表性失败;在每条选定轨迹内,通过文本依赖图进行因果定位,移除非因果步骤并识别真正的根因模块用于优化。实验表明,STRACE显著优于标准上下文过滤基线。值得注意的是,在挑战性形式化验证任务VeruSAGE-Bench上,它成功优化了人类专家设计的智能体,成功率从42.5%提升至58.5%,提升1.4倍。代码已公开于https://github.com/moomight/STRACE。
原文摘要 · Abstract (English)
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 .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。