TL;DR
VerlTool is an open-source, modular framework that extends Reinforcement Learning with Verifiable Rewards (RLVR) to multi-turn, multi-modal Agentic RL with Tool use (ARLT). By decoupling the RL training engine from tool execution and enabling asynchronous, trajectory-level rollouts, VerlTool achieves up to a $2\times$ rollout speedup while matching or beating specialized state-of-the-art baselines across six diverse domains—from math coding and deep web search to visual reasoning and software engineering.
What Problem Does This Paper Address?
While RLVR has yielded breakthrough reasoning models like DeepSeek-R1 and OpenAI’s o-series, these models operate largely like "brains in a vat"—confined to single-turn, closed-loop text generation without environmental feedback.
Extending RLVR to multi-turn agentic environments with external tools (code sandboxes, search APIs, SQL databases, bash shells) introduces severe systems bottlenecks:
- Synchronous rollout stalls: Traditional frameworks process rollouts in synchronized batches. When one tool call takes seconds, the entire GPU batch sits idle.
- Brittle, fragmented codebases: Most existing tool-use RL implementations hard-code task-specific tools directly into the training loop, complicating extensibility and reproducibility.
- Stateless and text-only limits: Prior frameworks largely treat tools as stateless functions producing text-only strings, failing to support persistent trajectory state (e.g., terminal sessions, database cursors) or multi-modal observation tokens (images/video frames).
Methods
VerlTool resolves these bottlenecks through a modular, decoupled architecture:
- Upstream Alignment with VeRL: VerlTool integrates VeRL as a submodule, separating agent-interaction abstractions from core distributed RL updates (PPO/GRPO/DAPO).
- Decoupled Tool Server & Ray Execution: Tool execution is abstracted via an extensible
BaseToolplugin interface. Small I/O-bound tools run asynchronously viaasyncio, while resource-heavy, stateful tools (e.g., Python sandboxes, image transformations, SWE Docker containers) run as isolated Ray Actors or sandboxed subprocesses. - Fully Asynchronous Rollouts: Instead of waiting for batch-wide generation, each trajectory communicates with the tool server independently upon emitting a predefined tool stop token (e.g.,
</python>,</search>), cutting out GPU idle bubbles. - On-Policy Prefix Tokenization: Retokenizing concatenated text strings across turns can alter token boundaries (e.g., merging
</python>and\n<result>into single, unexpected token IDs). VerlTool preserves token IDs incrementally on-policy to prevent "retokenization drift" and training collapse. - Observation Masking & Error Handling: Non-model tool observation tokens are masked out during policy gradient computation. Step-level timeouts and trajectory-level error masking prevent failed or hung tool calls from corrupting advantage estimates.
[ VeRL Workflow (Actor / RL Update) ]
▲ │
Observation │ │ Action (e.g., </search>)
│ ▼
[ Tool Server (Async Dispatch / Ray Backend) ]
├── Python Sandbox (Firejail)
├── Web / FAISS Search
├── SQL Database Engine
└── Docker SWE Environment
Datasets
The authors evaluate VerlTool across six benchmark tasks:
- Mathematical Reasoning (VT-Math): Trained on DeepMath; evaluated on GSM8K, MATH-500, Minerva Math, OlympiadBench, AIME24, AMC23, and AIME25.
- Knowledge QA (VT-Search): Dense retrieval over the 2018 Wikipedia dump using FAISS/E5; evaluated on NQ, TriviaQA, PopQA, HotpotQA, 2WikiMultihopQA, MuSiQue, and Bamboogle.
- Multi-Turn Text-to-SQL (VT-SQL): Trained on SkyRL-SQL; evaluated on Spider-1.0 (Dev and Realistic), Spider-DK, and Spider-SYN.
- Visual Reasoning (VT-VisualReasoner): Trained on Pixel-Reasoner data; evaluated on V* Bench using image manipulation tools (zooming, cropping).
- Agentic Web Search (VT-DeepSearch): Trained on SimpleDeepSearcher and Web-Sailor data; evaluated on GAIA and Humanity’s Last Exam (HLE).
- Software Engineering (VT-SWE): Trained on R2E-Lite via R2E-Gym; evaluated on SWE-Bench Verified.
Key Insights and Ideas
- Retokenization Drift Breaks Agentic RL: Retokenizing complete prompt-action-observation strings across turns modified 98.6% of token IDs in ablation tests, inflating gradient norms by 132.9% and degrading policy rewards. Separate tokenization of actions and observations is required for stability.
- Divergent Tool Dynamics Across Tasks: In SQL tasks, the frequency of tool calls naturally decays over training as the model internalizes database schemas and requires fewer trial queries. In contrast, for deep search, tool invocations climb dramatically because the model cannot memorize extensive external web content.
- Multi-Tool Training Collapse: While training on two complementary domains (e.g., Math + SQL) worked smoothly, combining three or more heterogeneous tools from scratch led to training collapse. The authors note that diverse tool combinations require explicit cold-start phases or hierarchical routing to avoid destructive gradient interference.
Key Results
- Efficiency Gains: Trajectory-by-trajectory asynchronous rollouts delivered up to a $1.97\times$ speedup in wall-clock rollout execution (e.g., reducing per-batch rollout from 193s to 98s in DeepSearch). On Math-TIR, per-step time dropped to 83s, compared to 206s–268s in existing frameworks like verl-GEM and SimpleTIR.
- Domain Performance:
- Math: VT-Math (Qwen2.5-Math-7B) achieved a 62.2% average across math benchmarks, besting ToRL-7B (61.1%) and the instruction baseline (57.3%).
- Search QA: VT-Search reached 45.9% average accuracy on 7 QA benchmarks, outperforming Search-R1-base (GRPO at 35.0%, PPO at 43.1%).
- SQL & SWE: VT-SQL matched specialized systems with 83.9% (Dev) and 81.3% (Realistic) on Spider. VT-SWE reached a 19.5% pass rate on SWE-Bench Verified.
- Multimodal: VT-VisualReasoner reached 82.7% on V* Bench, proving that dynamic visual manipulation can be optimized directly via multi-modal agentic RL.
Limitations and Future Work
- Generalist Multi-Tool Scaling: The framework currently struggles with joint training across three or more divergent tool sets simultaneously without causing optimization collapse.
- Infrastructure Overhead: Scaling complex environments like SWE-Bench requires heavy disk I/O and significant CPU/RAM allocations to manage Docker containers reliably.
- Future Directions: Incorporating tool-specific warm-up phases, hierarchical policy routing, and native multi-modal observation streaming for richer real-time agent interactions.
Summary updated