---
title: 'Trajectory Verification: Methods & Applications'
url: https://www.emergentmind.com/topics/trajectory-verification
type: topic
---

# Trajectory Verification: Methods & Applications

Trajectory verification denotes the problem of determining whether a realized, predicted, or planned trajectory satisfies a specification, contract, safety requirement, or evidential criterion. In current literature, the term spans formal checking of LLM agent rollouts against Lean4-encoded workflow contracts, predictive runtime verification of stochastic system trajectories against bounded STL, test-time verification and refinement of motion plans in autonomous driving and video generation, certification of safety and robustness for dynamical systems, and post-hoc monitoring of long-horizon agent behavior [2606.06523][2211.01539][2607.00399][2511.17450][2110.00233][2606.07054].

## 1. Scope and objects of verification

The object called a “trajectory” is not uniform across domains. In Lean4Agent, a workflow is the designed graph of typed steps and transitions, while an execution trajectory is the realized rollout
$$
\mathcal{T} := s_0 \rightarrow s_1 \rightarrow \cdots \rightarrow s_l,
$$
with trajectory state
$$
s_i := \langle pre_i, v_{j_i}, gen_i, pos_i \rangle,
$$
where \(pre_i\) and \(pos_i\) are the pre- and post-execution states, \(v_{j_i}\) is the executed workflow node, and \(gen_i\) stores the LLM reasoning/tool-call trace for that step [2606.06523]. In MAG-V, by contrast, a trajectory is the sequence of tool calls
$$
T_Q = [t_1, \ldots, t_n],
$$
where each \(t_i\) is a structured tool invocation consisting of a tool name and its arguments [2412.04494].

In predictive runtime verification, the trajectory is a stochastic signal
$$
X := (X_0,X_1,\dots)\sim \mathcal D,\qquad X_\tau\in\mathbb R^n,
$$
of which only a prefix is observed at runtime; verification asks whether the full trajectory will satisfy a bounded STL formula with probability at least \(1-\delta\) [2211.01539]. In TRACE, the monitored object is a long-horizon LLM agent trajectory
$$
\tau = (x_1, x_2, \dots, x_T),
$$
where \(x_t\) are reasoning steps, tool calls, environment observations, and generated actions, and the verification task is the binary classification problem \(f(\tau)\rightarrow\{benign,\text{ malicious}\}\) under covert sabotage [2606.07054].

Other literatures shift the meaning again. In motion-graphics verification, a prompt specifies a shape family
$$
\mathcal{F}(o, W) = \{w(o) \mid w \in W\},
$$
and a query trajectory is valid iff \(t\in \mathcal{F}(o,W)\), operationalized by a warp-invariant distance threshold \(d_W(o,t)<\tau\) [2603.29301]. In autonomous driving, DriveVer treats a trajectory as the planner output
$$
\tau_{\text{init}} = \{(x_t, y_t, \theta_t)\}_{t=1}^T \in \mathbb{R}^{T \times 3},
$$
to be checked and, if necessary, geometrically refined at inference time [2607.00399]. This heterogeneity is central: “trajectory verification” may target semantic contracts, temporal-logic satisfaction, geometric family membership, safety under uncertainty, or evidential support.

## 2. Agent trajectories: formal contracts, synthesized verification behavior, and tool-call consistency

The most explicit formalization appears in "Lean4Agent" [2606.06523]. Layer 1 represents a workflow as the typed graph
$$
\mathcal{W} = (V, E, v_{entry}, X, P),
$$
and Layer 2 maps steps to Hoare-style semantic nodes
$$
s_i = \langle\rho^{(pre)}_i, v_i, \rho_i^{(post)}\rangle,
$$
assembled into the semantic workflow graph
$$
\mathcal{S} = \langle \mathcal{G}, s_{para}, S, L, C\rangle.
$$
The paper states the well-formedness invariant
$$
\forall v_i \in \mathcal{G}.V, v_i.needSemanticSpec \Rightarrow \exists s_j \in S,\text{ s.t. } i = j.
$$
Trajectory verification is performed in Layer 3 against a formal environment
`SemanticEnv := String → Option Value`, with predicates drawn from an inductive `PredicateType` universe including `nameExists`, `isNonEmptyString`, `isValidJson`, `matchesJsonSchema`, `toolExists`, `moduleExists`, `custom`, and `ext`. Its key assumption is the Lean axiom
```lean
axiom llmExecAxiom (semanticNode : SemanticWorkflowNode) (env : SemanticEnv) (precond: semanticNode.precond env) : ∃ env', semanticNode.postcond env env'
```
and runtime checking compares observed rollout states against required predicates for the executed step. The same stack supports failure localization: the point is not merely to label a run “good” or “bad,” but to localize the first failing step. Experimentally, verification-passing workflows outperform failing ones by an average of 14.80% on SWE and 9.07% on ELAIP, with overall averages reported in the abstract as 11.94%; LeanEvolve improves SWE performance by an additional 7.47% on average [2606.06523].

"Marco DeepResearch" generalizes verification from runtime checking to data and training pipeline design [2603.28376]. Its verification-centric framework has three levels: QA Data Synthesis, Trajectory Construction, and Test-time scaling. The trajectory-construction level introduces two mechanisms: **Multi-agent with Verification** and **Verification-Reflection Re-rollout on Failed Trajectories**. The first uses a main agent, a search sub-agent, and a verifier sub-agent, so that intermediate sub-results and final answers are independently checked and revised if verification fails; the second starts from failed trajectories, has a verifier agent diagnose the failure, and then re-rolls out the trajectory conditioned on that feedback. The paper reports that **Single-agent ReAct only** versus **Single-agent + Multi-agent (verified)** yields an average improvement of **+2.03**, and that verifier-guided test-time scaling produces an average gain of **+12.1** points [2603.28376]. This suggests that in agent settings, verification is increasingly treated as behavior to be learned, not only as an external audit.

MAG-V frames trajectory verification as consistency of tool-use behavior under reverse-engineered alternate questions [2412.04494]. Starting from a response, a reverse engineer generates 3 alternate questions, the assistant answers them, and the resulting alternate trajectories are compared with the base trajectory using EM, EDIT, GEDIT, SS, AO, and LCSS, together with TF-IDF features from the base question. The paper states that its trajectory verification methodology, inspired by distant supervision and using traditional machine learning models, outperforms a GPT-4o judge baseline by 11% accuracy and matches the performance of a GPT-4 judge on the constructed dataset. A broader implication is that, for tool-using agents, verification can target the action path itself rather than the final answer alone.

## 3. Predictive runtime verification under uncertainty

"Conformal Prediction for STL Runtime Verification" formulates trajectory verification as a predictive runtime verification problem for an unknown stochastic system [2211.01539]. Given an observed prefix \(x_{\text{obs}}=(x_0,\dots,x_t)\) and a bounded STL specification \(\phi\) enabled at time \(\tau_0\), the goal is to decide whether
$$
P\big((X,\tau_0)\models \phi\big)\ge 1-\delta.
$$
Because STL admits robust semantics, the paper works with the robustness measure
$$
\rho^\phi(X,\tau_0)\in\mathbb R,\qquad (X,\tau_0)\models\phi \Longleftrightarrow \rho^\phi(X,\tau_0)>0.
$$
A learned predictor
$$
\textsf{Predict}:\ (x_0,\dots,x_t)\mapsto (\hat x_{t+1|t},\dots,\hat x_{t+H|t})
$$
is combined with conformal prediction to quantify uncertainty without distributional assumptions. The direct method constructs a conformal region for the robustness error
$$
R := \rho^\phi(\hat x,\tau_0)-\rho^\phi(X,\tau_0),
$$
with threshold
$$
C := R^{(p)},\qquad p=\left\lceil (|D_{\text{cal}}|+1)(1-\delta)\right\rceil,
$$
so that if \(\rho^\phi(\hat x,\tau_0)>C\), then Theorem 1 yields
$$
P\big((X,\tau_0)\models\phi\big)\ge 1-\delta.
$$
The indirect method first constructs statewise prediction regions, then lower-bounds STL robustness by worst-case robust semantics \(\bar\rho^\phi\). The paper emphasizes that these are distribution-free, finite-sample guarantees and that the predictor can be any measurable trajectory predictor, including RNNs and LSTMs.

A related but distinct predictive verification problem appears in "Predictive Importance Sampling Based Coverage Verification for Multi-UAV Trajectory Planning" [2603.01687]. Here verification asks whether a mobile user remains continuously in line-of-sight coverage during an entire decision interval, not merely at snapshot endpoints. The mobility set is the circle
$$
C=\{z\in\mathbb{R}^2:\|z-u_t\|\le r\},\qquad r=v_u\Delta t,
$$
and failure probability is
$$
P_f=\frac{\int_C I_F(z)\,dz}{\int_C dz} =\mathbb{E}_p[I_F(Z)].
$$
The proposal density for predictive importance sampling is the defensive mixture
$$
q_{\text{pis}}(z)=\alpha\,q_{\text{pred}}(z)+(1-\alpha)\,p(z),
$$
where \(q_{\text{pred}}\) is produced by an LSTM-MDN and \(p\) is uniform over \(C\). The resulting estimator
$$
\hat P_{\text{PIS}}=\frac{1}{N}\sum_{i=1}^{N} I_F(Z_i)\frac{p(Z_i)}{q_{\text{pis}}(Z_i)}
$$
is proved unbiased, and the paper proves lower variance than uniform sampling under the stated condition \(q_{\text{pis}}(z)\ge p(z)\) on the failure set. Reported verification ablation numbers include latency **0.57 ms** for the proposed method with \((\alpha=0.6,N=100)\) and **11 ms** for uniform sampling with \(N=1000\) [2603.01687].

## 4. Test-time verification and refinement of candidate trajectories

A prominent recent pattern is to place verification between initial trajectory generation and expensive downstream execution. "SketchVerify" does this for physics-aware video generation by verifying and refining object trajectories before any full video is synthesized [2511.17450]. For each sub-instruction \(\mathcal P_i\), the planner samples \(K\) candidate trajectories
$$
\left\{ \Pi_i^{(1)}, \dots, \Pi_i^{(K)} \right\} = \mathcal{F}(\mathcal{P}_i, \mathcal{O}, \mathbf{C}_i),
$$
where each \(\Pi_i^{(k)}\) is a sequence of bounding boxes. These candidates are rendered as lightweight video sketches and scored by a vision-language verifier for semantic correctness and physical plausibility, using the ranking rule
$$
\Pi_i^* = \arg\max_k \left( \lambda_{\text{sem}} s_k^{\text{sem}} + \sum_{l \in \mathcal{L}} \lambda_l s_k^{(l)} \right),
$$
with \(\mathcal{L} = \{\text{Newton}, \text{Penetration}, \text{Gravity}, \text{Deformation}\}\). The appendix states \(K=5\), planner temperature \(1.0\), and an \(\ell_2\) diversity threshold of at least \(0.05\). Sketch verification reaches comparable or better quality than generation-based verification with about a **10× speedup** [2511.17450].

"Self-Consistency for LLM-Based Motion Trajectory Generation and Verification" converts verification into cluster membership under geometric transformation groups [2603.29301]. A prompt specifies a family
$$
\mathcal{F}(o, W) = \{w(o) \mid w \in W\},
$$
where \(W\) may be \(\mathrm{SE}(2)\), \(\mathrm{E}(2)\), \(\mathrm{Sim}^{+}(2)\), \(\mathrm{Sim}(2)\), \(\mathrm{Aff}(2)\), or \(W_{\text{sim-ani}}\). The warp-invariant distance is
$$
d_W(t_1, t_2) = \min_{w \in W} \frac{1}{n}\sum_{i=1}^{n} \|w(t_{1,i}) - t_{2,i}\|^2,
$$
computed after resampling trajectories by arc length to \(n=100\) points and aligning them with a generalized ICP procedure. Clustering is performed with DBSCAN, and verification accepts a query iff \(d_W(o,t)<\tau\). Reported verification results show precision **85.8** and F1 **74.6** for Majority-Consensus, precision **80.5**, recall **89.0**, and F1 **84.6** for Hierarchical-Consistency, and an **11.8 percentage point precision gain** over GPT-4.1 [2603.29301].

DriveVer instantiates the same verifier-refiner pattern in autonomous driving [2607.00399]. Given multi-view images, ego kinematics, a navigation command, and an initial trajectory \(\tau_{\text{init}}\), DriveVer predicts a confidence score \(\hat p\) and a refinement direction vector \(\hat u\). If \(\hat p>p_{th}\), refinement is triggered and
$$
\tau_{\text{refined}} = \tau_{\text{init}} + \alpha \cdot \hat{u}.
$$
The confidence branch is trained with
$$
\mathcal{L}_{conf} = \mathbb{E}\left[\text{BCE}(\hat{p}, p_{gt})\right],
$$
the refinement branch with
$$
\mathcal{L}_{dir} = \mathbb{E}\left[1 - \langle \hat{u}, u_{gt} \rangle \right],
$$
and the total loss is
$$
\mathcal{L} = \lambda \cdot \mathcal{L}_{dir} + (1-\lambda) \cdot \mathcal{L}_{conf},
$$
with \(\lambda=0.5\). The method has only **34M parameters** and adds about **80 ms** latency per trajectory on a single NVIDIA 4090 GPU. On NAVSIMv1, PDMS improves from **88.1** to **89.0** for DiffusionDrive and from **90.3** to **90.9** for AdaThinkDrive; on NAVSIMv2, EPDMS improves from **84.5** to **85.5** for DiffusionDrive [2607.00399].

## 5. Safety, robustness, and reachability verification in autonomous and dynamical systems

One major branch of the literature treats trajectory verification as certification of robustness for learned predictors. TrajPAC formalizes two notions for pedestrian trajectory prediction models [2308.05985]. **Label robustness** requires that, for all admissible perturbations in the \(L^\infty\) disturbance region \(B(\hat X,r)\), every attacked prediction remains within a safety constant \(s\) of the ground-truth future trajectory under ADE. **Pure robustness** instead requires proximity to the model’s own unperturbed prediction distribution. TrajPAC learns an affine PAC surrogate
$$
\widetilde{\Delta}(\mathbf X)=\mathbf X \cdot \alpha + \beta
$$
for the robustness-relevant distance function and proves that if
$$
K \geq \frac{2}{\epsilon}\left(\ln \frac{1}{\eta}+2T_{\mathrm{p}}(N+1)+1\right),
$$
then with confidence at least \(1-\eta\),
$$
\mathbb{P}\left(|\widetilde\Delta(\mathbf X)-\Delta(\mathbf X)|\ge \lambda^* \right) \leq \epsilon.
$$
Operationally, TrajPAC returns **YES**, **NO**, or **UNKNOWN**, can produce true counterexamples, and gives sensitivity-based analyses through critical steps and critical paths.

A second branch develops analytic or convex certificates over continuous time. "Real-Time Risk-Bounded Tube-Based Trajectory Safety Verification" considers a polynomial trajectory \(\mathbf{x}(t)=\mathcal P(t)\) under uncertain time-varying nonlinear safety constraints \(g_i(\mathbf{x},\omega_i,t)\ge 0\) and defines risk by
$$
\Pr\!\left(\mathcal{P}(t)\notin \mathcal{X}_{s_i}(\omega_i,t)\right)\le \Delta.
$$
Using moments of the uncertainty distribution, it constructs the deterministic inner approximation
$$
\hat{\mathcal{C}_{r_i}^{\Delta}}(t)= \left\{ \mathbf{x}\in\mathcal{X}: 
\frac{P_{1i}(\mathbf{x},t)-P_{2i}(\mathbf{x},t)^2}{P_{1i}(\mathbf{x},t)}\le \Delta,\ 
P_{2i}(\mathbf{x},t)\ge 0 \right\},
$$
with \(P_{1i}=\mathbb{E}[g_i^2]\) and \(P_{2i}=\mathbb{E}[g_i]\), and then verifies the resulting polynomial inequalities over the full planning horizon via SOS certificates without time discretization. The same framework extends to an ellipsoidal tube
$$
\mathcal{Q}(\mathcal{P}(t)) = \left\{ \mathbf{x}: (\mathbf{x}-\mathcal{P}(t))^TQ(\mathbf{x}-\mathcal{P}(t))\le 1 \right\}.
$$
Reported runtimes include **0.45 s** for autonomous vehicle lane-changing trajectory verification, **0.88 s** for lane-changing tube verification, **0.36 s** for autonomous flight trajectory verification, and **0.77 s** for autonomous flight tube verification [2110.00233].

Other methods derive trajectory certificates from geometric structure or system order. "Vandermonde Trajectory Bounds for Linear Companion Systems" represents companion-dynamics trajectories in a Vandermonde basis and proves containment in a convex hull, the **Vandermonde simplex**, yielding a state-specific analytic outer bound for collision checking and safe-region containment [2302.10995]. "Feedback Motion Plan Verification for Vehicles with Bounded Curvature Constraints" verifies all trajectories induced by a feedback motion plan offline by computing backward reachable sets on cell borders for Dubins-like vehicles with minimum turning radius \(r=v/\omega\) and cell size \(d<r\) [1910.06797]. "Trajectory-based Safety of Monotone Systems" introduces upper and lower dominance functions \(P\) and \(Q\) from collected trajectories, proves monotonicity, dissipation, and invariance of their sublevel sets, and constructs robust or control barrier certificates as nonnegative affine combinations of these basis functions directly from trajectory data [2605.16660].

Trajectory verification also appears in model checking and SLAM. The ballistic rocket report models flight as a probabilistic transition system
$$
\mathcal{M} = (S, s_0, Act, P, L)
$$
with state
$$
s = \langle t,\ v,\ p,\ \theta,\ \phi,\ \psi \rangle,
$$
labels states as `GoodState`, `BadState`, `Disengaged`, and `Finish`, and verifies PATL properties such as
$$
\varphi_{1p} = \langle\langle \text{Rocket} \rangle\rangle^{\ge p} \mathbf{F}(\text{GoodState} \land \text{Finish})
$$
under several probability thresholds [2511.22572]. ROVER verifies loop closures by adding each candidate to pose-graph optimization, aligning the original and optimized trajectories, and scoring the RMS difference
$$
s_{ij} = \sqrt{\frac{1}{N}\sum_{i=0}^{N-1} \left\| \mathbf{p}_i - (a\mathbf{R}\mathbf{p}^*_i + \mathbf{t}) \right\|^2}.
$$
Its reported average performance is **99.25 AP / 87.39 MR**, and integration into ORB-SLAM2 and VINS-Fusion improves localization in repetitive environments [2508.13488].

## 6. Monitoring, evidence extraction, and the fragility of trajectory-dependent verification

When trajectories are long and semantically diffuse, verification itself becomes an evidence-aggregation problem. TRACE addresses long-horizon LLM agents with a TIJ loop—**Triage**, **Inspect**, **Judge**—that identifies suspect windows, performs structured analysis actions (`InspectStep`, `CompareSteps`, `CheckPolicy`, `AnalyzeDecisions`), maintains persistent evidence state across windows, and synthesizes a final suspicion score on a **1–5 scale**, with scores \(\ge 4\) classified as malicious [2606.07054]. On SHADE-Arena, TRACE achieves aggregate **F1 0.713** and **recall 0.844**, compared with **F1 0.577 / recall 0.405** for a Full-Trajectory Monitor and **F1 0.700 / recall 0.580** for a Sequential Monitor, while using about **12.3 LLM calls per trajectory** versus **18.8** for the sequential monitor. The paper’s central point is that sabotage may be temporally sparse, ambiguous, and distributed across distant steps.

HANSEL shifts emphasis from classifier outputs to interactive evidence extracted from web-agent trajectories [2606.18671]. It standardizes raw logs into
$$
T = [(o_1, r_1, a_1), \dots, (o_n, r_n, a_n)],
$$
uses an LLM to identify evidence pages and snippets, reconstructs each evidence page as a live interactive webpage with preserved state such as search queries, filters, sort order, and scrolling, and explicitly flags cases where the final answer cannot be traced to any visited page. On 45 tasks from AssistantBench and Online-Mind2Web, HANSEL achieves **83.7% precision**, **88.8% recall**, and **0.861 F1** in identifying evidence pages while reducing trajectory volume by **61.6%**. In the user study, for correct submissions, HANSEL reduces completion time from **167.7 sec** to **130.4 sec**, and all 14 participants preferred HANSEL over the baseline.

The same literature also exposes a structural limitation: some verification schemes are only as reliable as their trajectory assumptions. SHIFT argues that diffusion watermark verification depends on faithful reconstruction of the watermark-bearing generative trajectory and exploits this dependence by stochastic hidden-trajectory deflection [2603.29742]. After partial forward diffusion and stochastic ancestral resampling, the attacked image remains visually plausible while the latent trajectory becomes a different random path, breaking the coupling required by inversion-based verification. Across nine representative diffusion watermarking methods, SHIFT reports **95%–100% ASR**, with average ASR **97.8%**. This does not negate the value of trajectory verification; rather, it identifies a concrete controversy in provenance settings, namely that verification tied to a single reconstructable trajectory may be structurally fragile.

Across these literatures, trajectory verification is less a single technique than a family of formalisms for making sequential behavior inspectable. The common thread is that trajectories are treated as first-class technical objects: typed execution traces, stochastic signals, candidate plans, policy-induced state paths, or evidence-bearing logs. The verification question then becomes domain-specific—contract satisfaction, probabilistic temporal correctness, safety under disturbances, consistency under transformation groups, or evidential support—but the underlying aim is stable: to determine whether sequential behavior is not merely produced, but justified.

Source: https://www.emergentmind.com/topics/trajectory-verification