From Noisy Traces to Root Causes: Structural Trajectory Analysis and Causal Extraction for Agent Optimization
Summary
STRACE (Structural Trajectory Analysis and Causal Extraction) is a novel framework designed to optimize long-horizon agents by creating high signal-noise optimization contexts. It addresses the challenges of redundant and heterogeneous execution traces, which often lead to inefficient LLM-based reflection and overfitting to low-value failures. At the batch level, STRACE filters traces by mining failure patterns to select representative failures. Within individual traces, it employs causal localization on a textual dependency graph to eliminate non-causal steps and pinpoint the true root-cause module for targeted optimization. Empirical results demonstrate STRACE's superior performance over standard context-filtering baselines, notably achieving a 1.4x success-rate improvement (from 42.5% to 58.5%) on the challenging formal verification task, VeruSAGE-Bench. The framework's code is publicly available at https://github.com/moomight/STRACE.
Key takeaway
For AI/ML engineers developing or deploying long-horizon LLM agents, traditional optimization methods often struggle with noisy, extensive execution traces, leading to inefficient debugging and suboptimal policy updates. You should consider STRACE's dependency-guided approach, which systematically filters redundant failures and pinpoints true root causes. This framework enables more precise and cost-effective policy improvements by focusing optimization efforts on the logical origin of errors, rather than just their symptoms.
Key insights
STRACE distills causal context from noisy agent traces to enable precise, efficient LLM-based policy optimization.
Principles
- Treat execution logs as structured causal evidence, not monolithic linear text.
- Distinguish between error manifestation nodes and upstream root cause nodes.
- Prioritize representative failures and compact causal slices for optimization.
Method
STRACE constructs an Execution Dependency Graph, mines failure patterns for trace filtering, performs causal localization via backward slicing, and synthesizes generalized heuristics for inductive policy optimization.
In practice
- Construct textual dependency graphs from agent codebases for structural priors.
- Implement diversity-based sampling to select representative failure traces.
- Apply backward slicing on dependency graphs to extract minimal causal contexts.
Topics
- LLM Agents
- Agent Optimization
- Causal Localization
- Execution Traces
- Context Management
- Formal Verification
Code references
- moomight/STRACE
- anthropics/claude-agent-sdk-python
- NousResearch/hermes-agent
- algorithmicsuperintelligence/openevolve
- gepa-ai/gepa-artifact
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.CL updates on arXiv.org.