Learning to Use Tools: Reinforcement Learning for Tool-Integrated Mathematical Reasoning
Organizations: Department of Energy Science and Engineering Stanford University
Abstract
Current large language models (LLMs) increasingly benefit from external tool integration, especially for tasks requiring reliable computation and verification. Motivated by this, we study calculator tool calling for improving mathematical reasoning on the Countdown task. We first analyze reasoning failures and find that calculation errors account for a substantial portion of incorrect responses. We then construct supervised fine-tuning datasets to teach the model useful tool-use patterns and how to interpret returned outputs. Building on this tool-formatted policy, we apply several on-policy reinforcement learning methods, including RLOO, RLOO++, GRPO, and DAPO, using automatically verifiable final-answer rewards. To enable a more reliable evaluation, we construct a fresh 1,024-problem held-out Countdown benchmark with no exact overlap with the training data. Our results show that calculator tool integration consistently improves both SFT and RL baselines, yielding roughly 10 percentage-point gains across pass@k. Among the RL methods, Tool-DAPO achieves the strongest performance, improving pass@1 from 35.8% for Tool-SFT to 66.0%. Further analysis shows that RL encourages more effective tool use even when only final-answer rewards are provided. These findings suggest that tool integration reduces arithmetic and verification errors, while RL increases the probability of correct reasoning traces.
Figures & tables
| Method | 1024-sample test set | 50-sample test set | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Tool-SFT | 35.8 | 48.9 | 59.6 | 67.6 | 73.7 | 40.1 | 56.0 | 68.5 | 76.1 | 82.0 |
| Tool-RLOO | 56.6 | 62.8 | 67.0 | 70.6 | 74.0 | 61.1 | 66.5 | 69.5 | 72.0 | 74.0 |
| Tool-RLOO++ | 56.8 | 61.8 | 65.2 | 68.2 | 70.8 | 63.2 | 68.4 | 71.1 | 72.8 | 74.0 |
| Tool-GRPO | 44.8 | 54.5 | 63.0 | 70.3 | 76.7 | 41.1 | 50.6 | 58.1 | 64.3 | 72.0 |
| Tool-DAPO | 66.0 | 70.1 | 72.7 | 74.7 | 76.6 | 68.5 | 73.1 | 76.3 | 79.1 | 82.0 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Numbers | |
|---|---|
| Target | |
| Reference solution | |
| RLOO pass@16 | |
| Tool-RLOO pass@16 |
| Hyperparameter | Value |
|---|---|
| Initial policy | SFT checkpoint |
| Dataset | Countdown / Tool-Countdown |
| Tool execution | No / Yes |
| Max turns | – / 10 |
| Training steps | 100/200 |
| Batch size | 128 |
| Hyperparameter | Value |
|---|---|
| Initial policy | Tool-SFT checkpoint |
| Dataset | Tool-Countdown |
| Tool execution | Yes |
| Max turns | 10 |
| Training steps | 100 |
| Batch size | 128 |
| Hyperparameter | Value |
|---|---|
| Initial policy | SFT checkpoint |
| KL reference | Frozen SFT checkpoint |
| Dataset | Tool-Countdown |
| Tool execution | Yes |
| Max tool calls | 5 |
| Training steps | 250 |
| Hyperparameter | Value |
|---|---|
| Initial policy | Tool-SFT checkpoint |
| Dataset | Tool-Countdown |
| Tool execution | Yes |
| Max turns | 10 |
| Training steps | 100 |
| Batch size | 128 |
LLM Mathematical Reasoning
Large language model mathematical reasoning studies how AI systems solve, explain, verify, and generalize across mathematical problems and proofs.
See all 270 papers