
What is Trajectory Refinement?
Trajectory refinement is a technique for improving AI agent performance by treating an agent's planned sequence of actions — its trajectory — as an optimizable object that can be iteratively corrected before and during execution, rather than executed once as-generated.
Why It Matters
AI agents frequently fail not because their model is weak, but because of a gap between what they plan and what actually happens when they execute. A plan that looks correct in the abstract breaks down when tools return unexpected results, environment states differ from assumptions, or constraints are violated mid-sequence.
PIVOT, the leading trajectory refinement framework, achieves up to 94% relative improvement in constraint satisfaction on DeepPlanning and GAIA benchmarks while using 3–5× fewer tokens than competing refinement approaches — making it both more accurate and more efficient.
How It Works
A trajectory refinement cycle has four stages:
- Plan — the agent generates an initial multi-step trajectory
- Inspect — the agent executes part of the trajectory and observes real environment responses
- Calculate discrepancy — using textual gradients (natural language descriptions of what went wrong and why), the agent identifies where the plan diverged from execution
- Evolve — the agent generates an updated trajectory incorporating those corrections, then re-inspects
This cycle repeats until the trajectory passes a global constraint verification check. Because feedback is captured as natural language gradients rather than numeric loss values, no backpropagation or weight updates are required.
Practical Example
An agent tasked with booking a meeting room plans: search calendar → check room availability → send invite. On inspection, the calendar tool returns a permissions error. The textual gradient identifies: "Step 1 failed: calendar read access not scoped." The agent evolves a corrected trajectory: request calendar permission → search → check availability → send invite. The refined trajectory executes successfully on the next attempt.
Source
Zhang, Popa, Xu, Song, Dimitriadis (2026): PIVOT: Bridging Planning and Execution in LLM Agents — arXiv:2605.11225