From Noisy Traces to Root Causes: Structural Trajectory Analysis and Causal Extraction for Agent Optimization

Ying Chang, Jiahang Xu, Xuan Feng, Chenyuan Yang, Peng Cheng, Yuqing Yang

arXiv:2607.07702 · 2026-07-19 공개 · arXiv · PDF

trajectory-analysis formal-verification llm-optimization failure-patterns verusage-bench textual-dependency-graph root-cause-identification causal-extraction

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.4times success-rate improvement (42.5% to 58.5%). The code is available at https://github.com/moomight/STRACE .

한국어 요약

한 줄 요약

STRACE는 실행 추적의 잡음을 줄이고 근본 원인을 추출하여 에이전트 최적화 성능을 1.4배 향상시키는 구조적 분석 프레임워크이다.

핵심 기여도

핵심 아이디어

기존 에이전트 최적화는 실행 추적을 전체 텍스트로 사용하지만, 이는 불필요한 정보와 잡음을 포함하여 최적화 효율을 저하시킨다. STRACE는 이 문제를 해결하기 위해 실행 추적을 **의존성 그래프**로 모델링하고, **Causal Localization**을 통해 실제 근본 원인을 식별한다. 예를 들어, 단계 50에서 발생한 코드 인터프리터 오류는 단계 5에서 발생한 잘못된 매개변수로 인한 결과일 수 있으나, 기존 방법은 이 관계를 파악하지 못한다. STRACE는 **의존성 그래프**를 기반으로 **비인과적 단계를 제거**하고, **근본 원인 모듈**을 정확히 추출하여 최적화를 집중적으로 수행한다.

기술적 접근법

주요 결과

의의 및 한계

STRACE는 실행 추적의 잡음을 줄이고, 근본 원인을 정확히 식별함으로써 에이전트 최적화의 **정확성과 효율성**을 동시에 향상시킨다. 특히, **의존성 그래프 기반 분석**은 기존 텍스트 기반 방법의 한계를 극복하며, **정책 최적화의 안정성**을 높인다. 그러나, 의존성 그래프 생성 과정에서 **추적 데이터의 질**에 따라 성능이 영향을 받을 수 있으며, **복잡한 시스템에서는 의존성 추론이 어려울 수 있음**이 한계로 제시된다.

실용적 활용

STRACE는 **복잡한 장기적 에이전트 시스템**(예: 자율 소프트웨어 엔지니어링, 코드 인터프리터)의 최적화에 적용 가능하다. 특히, **툴 사용 정책**, **스킬 모듈**, **편집 가능한 하이퍼파라미터** 등에 국한된 최적화가 가능하며, **코드 수정 없이 안정적인 성능 향상**을 도모할 수 있다.