Abstract
Large Language Models (LLMs) acting as agents often struggle with tool use in stateful environments where trial-and-error is costly or impossible. This paper introduces Dynamics Modelling (DyMo) and Self-Verification Sampling (SVS), a framework that enables LLMs to predict the consequences of their actions before execution. By internalizing environment dynamics, models can simulate multiple candidate tool calls and select the most likely to succeed, significantly improving performance and reliability.
Introduction
Scaling "test-time compute"—allowing a model to perform more computation during inference to improve reasoning—has seen great success in domains like mathematics. However, applying this to tool-using agents is difficult because real-world environments are often stateful. In such settings, an action (like a bank transfer) cannot be easily undone to try a different path. Existing methods typically rely on external verifiers or multiple environment interactions, which are impractical or dangerous in sensitive real-world applications.
Methodology: Dynamics Modelling (DyMo)
The authors propose turning the LLM into its own "world model" through Dynamics Modelling (DyMo). Instead of just generating a tool call, the model is trained to predict the resulting environment state (e.g., a success message or a specific error).
The training process involves two stages:
- Supervised Fine-Tuning (SFT): The model learns from triplets of
<prompt, tool call, environment result>. - Reinforcement Learning (RL): A multi-objective loss function optimizes for both successful tool use and the accuracy of state predictions.
Self-Verification Sampling (SVS)
At inference time, the model employs Self-Verification Sampling (SVS). This allows the agent to "mentally simulate" the outcomes of various actions before committing to one.
As shown in the figure above, the process follows three steps:
- Sample: The model generates $k$ candidate tool calls.
- Predict: For each candidate, the model predicts the resulting environment state.
- Proceed: A scoring function selects the candidate most likely to result in a successful ("pass") state.
This approach exploits the "discriminative-generative gap," where LLMs are often better at identifying if a tool call will fail than they are at generating a perfect one on the first attempt.
Evaluation and Results
The framework was evaluated using the Berkeley Function Calling Leaderboard V2 (BFCL-V2). Key findings include:
- Performance Parity: An 8B parameter model (Cohere R7B) using DyMo and RL matched the performance of GPT-4o.
- SVS Scaling: Increasing the number of candidates ($k$) significantly boosted success rates, reaching 90.69% at $k=64$.
- Hallucination Reduction: By predicting environment states, the model became much better at recognizing when no tool was suitable for a request, drastically reducing hallucinations.
- Reliability: A threshold-based refusal mechanism allowed the model to achieve ~94.5% precision by refusing tasks where all candidates were predicted to fail.
Conclusion
Dynamics Modelling and Self-Verification Sampling provide a robust path for scaling the reasoning capabilities of tool-using agents without requiring multiple environment interactions. While currently limited to single-turn tasks, this "mental simulation" capability brings AI agents closer to human-like deliberation. Future research will focus on multi-step planning and optimizing the computational cost of test-time sampling.
Summary updated