Recursive Semantic Divergence for LLM Agent Consistency

Harshavardhan Abichandani, Penny Chong, Atin Ghosh, Daniel DahlmeierNeurIPS 2026

TL;DR

Give an LLM agent the exact same task twice, and it might call completely different tools, invent divergent strategies, or contradict itself—even with temperature set to zero. To tame this chaos, the authors introduce Recursive Semantic Divergence (RSD), a metric borrowed from reinforcement learning that predicts how much an agent's future trajectory will butterfly-effect from its current state. Better yet, using RSD as an unsupervised reward signal during fine-tuning makes agents dramatically more reliable without needing a single ground-truth label.

What Problem Does This Paper Address?

Imagine deploying an autonomous healthcare or coding agent. You don't just want it to get the right answer sometimes; you want predictable, repeatable behavior every time it runs. Yet, multi-step LLM agents suffer from a severe butterfly effect. Even under greedy decoding (temperature = 0), tiny sources of randomness—like floating-point quirks, hardware variance, or slightly varied tool outputs—can nudge an agent onto wildly different paths over a 10-turn conversation.

Current benchmarks mostly check whether an agent crossed the finish line (task correctness), completely ignoring how erratically it behaved along the way. Existing uncertainty metrics look at token-level probabilities or cluster single responses by meaning, which is myopic: an agent can look confident on turn one while setting up a massive divergence by turn five. We lacked a way to measure—and enforce—behavioral consistency across an entire multi-turn trajectory.

Figure 1: Diagram illustrating Recursive Semantic Divergence (RSD) in LLM agents. The first three panels display trajectory spreads for perfectly consistent, mostly consistent, and highly inconsistent agents over time. The final panel maps an agent’s expanding and converging semantic action space alongside its corresponding RSD score, demonstrating how the metric tracks the variance of semantic divergence at each turn.

Methods

To look ahead in time, the authors adapt bisimulation metrics from classical reinforcement learning (RL). In standard RL, two states are "bisimilar" if they yield the same immediate reward and lead to states that also yield the same future rewards.

Here’s how the authors reinvent this for LLM agents without needing human labels:

  1. Swapping Rewards for Meaning: Instead of comparing scalar RL rewards, they compare agent actions (text responses and tool calls) using Natural Language Inference (NLI). If two independent actions from the same history entail each other (e.g., calling the same API with equivalent arguments, regardless of phrasing), their distance is 0. Contradictions score 1; neutral overlaps score 0.5.
  2. Recursive Lookahead: RSD defines consistency recursively: the divergence of a state is the expected NLI disagreement right now, plus the discounted divergence of the future states those actions lead to.
  3. Fast Neural Approximation: Unrolling infinite future trees at test time is impossible. Using a sampling-based RL technique called MICo (Matching under Independent Coupling) and temporal-difference learning, they train a lightweight neural network on paired agent rollouts.
  4. Self-Distance as a Reward: Because MICo computes a "diffuse" metric, measuring the distance between a state and itself ($U(s,s)$) isn't necessarily zero—it actually measures the width of the agent's future tree of possibilities! At inference or during Group Relative Policy Optimization (GRPO) fine-tuning, a single forward pass gives an instant consistency score to optimize against.

Datasets

No new benchmarks were introduced. The authors evaluate RSD on two existing multi-turn, tool-use agent benchmarks using Qwen-2.5 (3B and 7B) and Qwen-3.5 models:

  • ToolSandbox: Evaluates stateful, multi-step tool calling and implicit dependencies.
  • $\tau^2$-bench: Tests conversational agents in complex, dual-control environments (such as multi-turn airline customer service) where early choices heavily compound.

Key Insights and Ideas

  • Consistency $\neq$ Correctness: An agent that reliably crashes on turn one is 100% consistent! Interestingly, RSD fine-tuning didn't collapse into "consistently failing" modes because the RSD network is trained on rollouts from an already-competent base model, keeping policy updates anchored in useful behavior space. (Though in one 7B experiment, RSD did lock onto a failing path on a tricky sample—proving the theoretical point!)
  • Local Confidence Doesn't Buy Global Stability: Minimizing standard token entropy or single-turn semantic entropy often failed—and sometimes made trajectory variance worse. Being super confident about the next word doesn't stop an agent from drifting across turns.
  • Pure Consistency Beats Hybrid Rewards: Surprisingly, mixing the unsupervised RSD reward with actual task-progress rewards degraded both consistency and task performance compared to pure RSD. Why? Task progress in multi-turn setups is sparse (often zero until the final step), injecting noise into the smooth, dense RSD training signal.
  • Mathematical Guarantees: The authors prove that low RSD directly bounds worst-case behavior: for example, an RSD score of 0.1 guarantees at least 80% of the agent's policy mass is concentrated on one dominant semantic action class.

Key Results

Measuring consistency via the Coefficient of Variation (CV = standard deviation / mean, where lower means tighter, more repeatable runs) across 8 trials per task:

  • Big Drops in Behavioral Variance: Fine-tuning with RSD slashed Area Under the Progress Curve (AUC) CV by 50.5% on ToolSandbox (0.90 down to 0.44) and 30.9% on $\tau^2$-bench (1.32 down to 0.91) for Qwen-2.5-3B. Smaller models saw the biggest gains because they start out much more erratic than 7B models.
  • Broad Wins Without Labels: Across Qwen-2.5 and Qwen-3.5, RSD lowered AUC variance in 7 out of 8 model-benchmark pairings and boosted final task progress in all 8—rivaling Supervised Fine-Tuning (SFT) without needing expert demonstrations.
  • Direct Semantic Alignment: When GPT-4.1 directly audited outputs across runs on ToolSandbox (7B), RSD-tuned agents cut semantic disagreement by 52.8%, whereas SFT barely budged inconsistency (-1.1%) despite memorizing right answers.
Table 1: Performance and consistency, measured by the coefficient of variation (CV), across different fine-tuning strategies. The upwards and downwards arrows ↑↓show relative change from the baseline. The blue downwards arrow ↓indicates reduction in variation, while the red upwards arrow ↑indicates increase in variation.

Limitations and Future Work

  • Garbage In, Garbage Out on Competence: Because RSD measures stability rather than truth, applying it to a weak or randomly initialized model could reinforce consistently bad habits; weak policies would need RSD paired with dense correctness rewards.
  • NLI Bottlenecks: The entire metric leans on an underlying NLI classifier. If the NLI model misjudges whether two subtle tool calls are functionally equivalent, the RSD signal degrades.
  • Domain Transfer: The learned RSD estimator is tied to the rollout distribution it was trained on and may need retraining or adaptation when moved to brand-new agent environments.

Summary updated

Abstract

Large Language Model (LLM) agents with tool use exhibit inconsistent behavior across independent runs from identical states, calling different tools, producing contradictory outputs, or pursuing divergent strategies. This variability compounds over time and undermines deployment reliability. Existing evaluation metrics primarily measure task correctness via completion-based scores and do not capture consistency in agent behavior across executions. Separately, agent behavior is analyzed either at the token level using probability distributions or at the single-response level using semantic clustering, but neither captures how inconsistency propagates across future turns of a trajectory. We introduce Recursive Semantic Divergence (RSD), an unsupervised trajectory-level consistency metric adapted from bisimulation metrics in reinforcement learning. RSD measures the expected cumulative semantic disagreement between two independent rollouts of the same agent from the same state, using natural language inference to detect logical inconsistency. It is defined recursively over future states and approximated by a neural network trained on independent rollouts. The learned metric estimates future divergence from the current state, providing a consistency score at each turn without requiring the full trajectory to complete. When used as a reward signal for fine-tuning, RSD reduces the variation in task progress from 132% to 91% on $\tau^2$-bench and from 90% to 44% on toolsandbox, while improving performance across benchmarks and model scales. Training with RSD as an additional reward signal matches supervised fine-tuning performance with substantially lower variance, without requiring ground-truth labels.
BibTeX
@inproceedings{abichandani2026recursive,
  author = {Harshavardhan Abichandani and Penny Chong and Atin Ghosh and Daniel Dahlmeier},
  title = {{Recursive Semantic Divergence for LLM Agent Consistency}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=TNqJkEOsuA},
}
Figure