從雜亂軌跡到根本原因:面向智能體優化的結構軌跡分析與因果萃取
From Noisy Traces to Root Causes: Structural Trajectory Analysis and Causal Extraction for Agent Optimization
July 8, 2026
作者: Ying Chang, Jiahang Xu, Xuan Feng, Chenyuan Yang, Peng Cheng, Yuqing Yang
cs.AI
摘要
長期任務智能體的優化越來越依賴於基於反思的機制,其中大型語言模型(LLM)充當優化器,用以診斷智能體失敗並改進其策略。然而,真實的執行軌跡難以直接用於優化:大量軌跡資料集往往冗餘且異質,導致優化效率低下且容易對低價值失敗產生過擬合;同時,每個單獨的軌跡也包含許多不相關的步驟,而諸如截斷或滑動窗口等簡略的上下文縮減方法可能丟失因果關鍵的證據,進而產生誤導性的優化信號。為了解決這一困境,我們提出了STRACE(結構化軌跡分析與因果提取)框架,該框架能夠構建高信噪比的優化上下文,實現更精準且有效的優化。在批次層面上,STRACE挖掘失敗模式以過濾冗餘軌跡,保留具有代表性的失敗案例;在每個選定軌跡內部,它通過文本依賴圖進行因果定位,去除無因果關係的步驟,並識別出真正的根因模組以進行優化。實驗結果表明,STRACE顯著優於標準的上下文過濾基線。值得注意的是,在一項具有挑戰性的形式驗證任務(VeruSAGE-Bench)中,它成功優化了人類專家設計的智能體,將成功率提升了1.4倍(從42.5%提升至58.5%)。程式碼已於 https://github.com/moomight/STRACE 公開。
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.4times success-rate improvement (42.5% to 58.5%). The code is available at https://github.com/moomight/STRACE .