Leveraging Trajectory Graphs for Pre-Execution Error Diagnosis in Agentic LLM Systems

📅 2026-07-29
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge that large language model (LLM) agents often fail in long-horizon interactive tasks due to error accumulation stemming from suboptimal single-step actions. Inspired by software debugging practices, the study introduces a novel approach that models historical trajectories as probabilistic graph structures, constructing a trajectory graph to serve as a diagnostic sandbox. Prior to action execution, a graph neural network actively predicts potential errors within this sandbox, enabling the agent to self-correct proactively. By integrating this pre-execution diagnostic mechanism with a collaborative LLM agent framework, the method achieves an average improvement of 14.69% in task success rate across four benchmark tasks, significantly enhancing both robustness and performance in long-horizon settings.
📝 Abstract
Large Language Model~(LLM)-based agents have demonstrated exceptional performance across a wide range of complex interactive tasks. However, they often struggle with long-horizon interactive tasks common in domains, such as embodied AI. The complexity and vast action spaces in these settings lead to compounding errors, where a single suboptimal action can derail an entire trajectory, causing the agent to exhaust its limited step budget on inefficient or unrecoverable paths. To overcome this without costly fine-tuning, we draw inspiration from software debugging, where execution logs are analyzed to preemptively catch errors. We propose \textit{Trajectory Graph Copilot}, a novel framework that acts as a ``copilot'' for LLM agents by diagnosing potential action errors before they are executed. At its core,\textit{Graph Debugger} models historical trajectories as a probabilistic graph and uses a Graph Neural Network to identify sequential action patterns that frequently lead to failure. Functioning as a proactive diagnostic sandbox, our method provides early warnings on potentially flawed actions, prompting the agent to self-correct. This pre-action error diagnosis prevents costly mistakes, significantly enhancing the agent's ability to complete long-horizon tasks successfully. The extensive experiments on four benchmarks with three LLM agents demonstrate a $14.69\%$ pass ratio improvement on average.
Problem

Research questions and friction points this paper is trying to address.

long-horizon tasks
error compounding
action space complexity
trajectory failure
pre-execution diagnosis
Innovation

Methods, ideas, or system contributions that make the work stand out.

Trajectory Graph
Pre-execution Diagnosis
Graph Neural Network
LLM Agent
Error Prevention