Manuscript Offprint

arXiv:2610.19614

Divergent Paths: Learning an Outcome-Predictive Representation of LLM Agent Trajectories

Alexander Gill, Guram Gogia, Francisco Guzmán

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In this work, we reframe agentic trajectories as paths through a shared embedding space of actions and environmental observations. We show that successful and failed rollouts of the same task separate in this space, with simple per-task discriminators predicting held-out rollout outcomes at up to 0.95 AUROC across three agent benchmarks and three policy models. To exploit this signal across tasks, we introduce PRECOG-RM, a transformer-based model that meta-learns a representation in which outcome prediction can be performed in a few-shot setting. We show that PRECOG-RM generalizes to unseen tasks and models, and gives confident predictions of trajectory success long before termination. Deployed as an early stopping controller for Group Relative Policy Optimization (GRPO) on Tau2-Bench, PRECOG-RM cuts training FLOPs by up to 47.3% while maintaining performance comparable to baseline GRPO.

Code — https://github.com/alexgill321/precog-rm

1 Introduction

The shift from language modeling to tool-using agentic systems has expanded the medium LLMs must operate over. An agentic trajectory is made up of a sequence of interactions, each pairing an action taken by the agent with an observation returned by the environment (Yao et al. 2022), often spanning 10–100+ turns and 100K–500K+ tokens (Merrill et al. 2026; Luo et al. 2025; Vidgen et al. 2026).

This structure has made agentic trajectories the central object of a growing set of problems such as credit assignment (Feng et al. 2026; He et al. 2026; Zhang 2026), failure diagnosis (Barke et al. 2026; Tayebati et al. 2026; Ou et al. 2025), and data filtering (Yang et al. 2026; Lin et al. 2026). Most methods read the raw token sequence, where the tokens that determine an outcome are a small fraction of the surface form that carries them. Workarounds either prompt an LLM to analyze the trajectory (Zhuge et al. 2024; Ou et al. 2025), inheriting the cost and failure modes of the system under study, or compress trajectories into hand-crafted features (Tayebati et al. 2026), deciding in advance which properties matter. Neither transfers beyond the problem and domain it was built for.

Recent works instead treat actions (Feng et al. 2026; He et al. 2026) or action–observation pairs (Yang et al. 2026) as states recurring across multi-trial rollouts, so that a rollout becomes a trajectory through a space of action-observation states. Collapsing the many token realizations of an action or observation into shared states strips away the surface variation that obscures analysis signals. Unlike a fixed feature set or a prompted judge, the representation itself can be learned, allowing a single model to serve these problems across tasks and domains. A representation only matters, however, if it retains the signal these problems depend on. What credit assignment, failure diagnosis and data filtering all share is that each must tie what happened in a trajectory to how it ended. A representation that loses the outcome serves none of them.

We ask how much of a trajectory’s outcome is recoverable from its actions and observations alone. We embed each action and observation with a frozen text encoder, a space we refer to as the action–observation space (AOS), and test whether same-task success and failure rollouts separate within it. We find that they do. Across three agentic benchmarks and three models, simple discriminators fit per-task on a handful of labeled rollouts predict held-out rollout outcomes at up to 0.95 AUROC. Figure 1 shows the effect directly, with success and failure trajectories separating as their histories grow.

Per-task fitting, however, transfers nothing, and its accuracy is bounded by the number of labeled rollouts a single task provides. We instead pose outcome prediction as a representation learning problem: learn an embedding of interaction histories under which same-task rollouts heading toward success separate from those heading toward failure, relating trajectories by outcome signal similarity rather than surface similarity. We introduce PRECOG-RM, a few-shot meta-learning model inspired by Prototypical Networks (Snell, Swersky, and Zemel 2017) which learns this embedding across tasks. On a new task, a single batch of labeled rollouts defines success and failure prototypes, and prediction reduces to distances against them, with no fitting at inference. PRECOG-RM separates better than per-task discriminators when labeled rollouts are plentiful and increasingly outperforms them as they grow scarce, and it transfers to unseen tasks and policy models. A variant predicts outcomes mid-rollout, abstaining when unsure. Finally, we deploy PRECOG-RM as an early stopping controller for GRPO (Shao et al. 2024) on τ2\tau^{2}-Bench retail (Barres et al. 2025): rollouts whose predicted success probability crosses the confidence threshold in either direction are

Figure

Figure 1: Trajectory flow through paired action–response state clusters for 100 retail/103 rollouts from Tau2-Bench. HDBSCAN over joint action–response embeddings yields one cluster assignment per rollout step; the first 30 steps are shown. Bar height encodes cluster occupancy, and bar color encodes empirical success probability (red = 0, yellow ≈ 0.5, green = 1). Within each step, clusters are ordered by success rate from failure-associated (bottom) to success-associated (top). Thin lines trace individual rollouts between steps, colored by final outcome. Grey bars with purple outlines denote states HDBSCAN designates as noise. The bottom axis gives rollout step and mean cumulative tokens generated by that step. For more information on this diagrams construction, see Appendix A.

terminated and assigned the predicted outcome as terminal reward, leaving the optimizer and advantage estimator untouched. The controller cuts training FLOPs by up to 47.3% while keeping pass@1 within one standard deviation of the baseline.

We make four contributions: (i) a systematic study showing that same-task rollout outcomes are separable in embedded action–observation sequences, across three benchmarks and three policy models; (ii) PRECOG-RM, a meta-learned few-shot discriminator that carries this signal to unseen tasks and policies from a single batch of labeled rollouts; (iii) variants that predict outcomes mid-rollout and abstain when the signal is absent; and (iv) an end-to-end evaluation of PRECOG-RM as a GRPO rollout controller, cutting training FLOPs by up to 47.3% at near-baseline pass@1.

References (82)