From Noisy Traces to Root Causes: Structural Trajectory Analysis and Causal Extraction for Agent Optimization
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 .
Community
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× success-rate improvement (42.5% to 58.5%). The code is available at https://github.com/moomight/STRACE.
I've spent enough nights staring at agent trace logs to know that the signal-to-noise ratio is brutal — most of what an agent does is irrelevant, and the one line that actually caused the failure is buried somewhere in 400 tokens of tool output. This approach of treating traces as structural trajectories and extracting causal chains from them makes sense to me. The key insight I'd want to test is whether the causal extraction actually survives real-world noise — my experience is that agents fail in ways that look like success until the very last step, and I'm curious if the method catches those. The lightweight, no-step-level-supervision angle is what makes this practical. I'd run this against my own failure logs before I'd trust it, but the framing is the right one.
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- Diagnosis-Driven Automatic Repair for Agentic Workflow via Symbolic Inference (2026)
- CausalFlow: Causal Attribution and Counterfactual Repair for LLM Agent Failures (2026)
- From Failed Trajectories to Reliable LLM Agents: Diagnosing and Repairing Harness Flaws (2026)
- FALAT: Tracing Failures in LLM Agent Trajectories via Dependency-Guided Search (2026)
- Meta-Agent: From Task Descriptions to Verified Multi-Agent Systems (2026)
- Repair the Amplifier, Not the Symptom: Stable World-Model Correction for Agent Rollouts (2026)
- AgentTether: Graph-Guided Diagnosis and Runtime Intervention for Reliable LLM Agent Operation (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2607.07702 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper