Recursive Semantic Divergence for LLM Agent Consistency
Harshavardhan Abichandani, Penny Chong, Atin Ghosh, Daniel Dahlmeier
Abstract
Large Language Model (LLM) agents with tool use can behave inconsistently across independent runs from identical states. They may call different tools, produce contradictory outputs, or follow 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), a 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 AUC coefficient of variation (CV) by up to 30.9% on tau2-bench and 50.5% on ToolSandbox. Across Qwen-2.5 and Qwen-3.5 models, RSD reduces AUC CV in seven out of eight model-benchmark settings, while improving the final task progress in all eight settings.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
- Comments
- Accepted as a conference paper in NeurIPS 2026. Source code is publicly available in the repository in https://github.com/SAP-samples/agent-consistency-rsd
Related papers
Beyond Self-Consistency: Recursive Self-Improvement at Test Time
Shared title terminologycs.CLJianyu Wu, Yizhou Wang, Encheng Su et al.
IRTIQA: Evolving in English, Evaluated in Urdu -- Does Agent Self-Evolution Transfer from English to Urdu and Code-Switched Input?
Shared title terminologycs.CLAbdullah Hashmat, Danish Javed, Usman Naseem et al.
Sports Agent: A Self-Evolving System for Conversational Data Analytics
Shared title terminologycs.CLChao Chen, Fuqi Lin, Ze Chen et al.
Failure Broadens, Success Sharpens: Continual Adaptation of Tool-Use Agents Across Diverse Tasks with Dual-Polarity Memory
Shared title terminologycs.CLTianmai M. Zhang, Hoda Shajari, Amr Hendy et al.
LogToPersona: New Benchmark and Efficient Persona Prediction through Semantic Log Filtering
Shared title terminologycs.CLAhmed Alajrami, Ondrej Bohdal, Seokwoo Song et al.
AI-human hybrid conversations: Can AI Agents Improve Discourse Quality?
Shared title terminologycs.CLIshita Chakraborty, Xingjian You, Shrabastee Banerjee