ReTool: Reinforcement Learning for Strategic Tool Use in LLMs

Jiazhan Feng, Shijue Huang, Xing-Wei Qu, Ge Zhang, Yu-Jia Qin, Bao-Quan Zhong, Chengquan Jiang, Jin-Xin Chi, Wan-Jun Zhong

arXiv:2504.11536 · 2026-11-15 공개 · arXiv · PDF

reinforcement-learning mathematical-reasoning llm-training tool-use synthetic-data neuro-symbolic code-execution math-olympiad

Abstract

While reasoning models (e.g., DeepSeek R1) trained with reinforcement learning (RL), excel in textual reasoning, they struggle in scenarios requiring structured problem-solving, such as geometric reasoning, concise computation, or complex equation solving-areas where computational tools like code interpreters (CI) demonstrate distinct advantages. To bridge this gap, we propose ReTool, which enhances long-form reasoning with tool-integrated learning, including two key features: (1) dynamic interleaving of real-time code execution within natural language reasoning processes, and (2) an automated RL paradigm that allows policy rollouts with multi-turn real-time code execution and teaches the model in learning when and how to invoke tools based on outcome feedback. ReTool employs a systematic training framework, beginning with synthetic cold-start data generation to produce code-augmented long-form reasoning traces for fine-tuning base models. Subsequent RL training leverages task outcomes as rewards to iteratively refine the model's tool use strategy, enabling autonomous discovery of optimal tool invocation patterns without human priors. Experiments on the challenging MATH Olympiad benchmark AIME demonstrate ReTool's superiority: Our 32B model achieves 67% accuracy with 400 training steps, outperforming text-based RL baseline (40% accuracy, 1080 steps) in efficiency and performance. Remarkably, ReTool-32B attains 72.5% accuracy in extended settings, surpassing OpenAI's o1-preview by 27.9%. Further analysis reveals emergent behaviors such as code self-correction, signaling an ''aha moment'' in which the model autonomously masters adaptive tool use. These findings highlight the promise of outcome-driven tool integration for advancing complex mathematical reasoning and offer new insights into hybrid neuro-symbolic systems.

한국어 요약

한 줄 요약

ReTool은 강화학습을 활용해 LLM이 코드 해석기와 협업하는 전략적 도구 사용 능력을 향상시킨다.

핵심 기여도

핵심 아이디어

기존 LLM은 텍스트 기반 추론에서는 우수하지만, 구조화된 문제 해결에서는 한계가 있다. ReTool은 이 문제를 해결하기 위해 강화학습과 코드 해석기를 통합한 새로운 학습 패러다임을 제시한다. 핵심은 **실시간 코드 실행과 자연어 추론의 동적 결합**이며, 이는 모델이 도구를 언제, 어떻게 사용할지를 스스로 학습하게 한다. ReTool은 **결과 기반 학습**(outcome-driven learning)을 통해 도구 사용 전략을 반복적으로 개선하며, 인간의 사전 지식 없이 최적의 패턴을 자동으로 발견한다.

기술적 접근법

주요 결과

의의 및 한계

ReTool은 복잡한 수학적 추론에서 LLM의 도구 활용 능력을 획기적으로 향상시켰으며, **신경-기호적 하이브리드 시스템**(neuro-symbolic hybrid system)의 새로운 가능성을 제시한다. 특히, **결과 기반 학습**을 통해 인간의 사전 지식 없이도 도구 사용 전략을 자동으로 개선할 수 있다는 점에서 학술적 가치가 크다. 그러나, **복잡한 도구 체인**(multiple tool chaining)이나 **다중 도구 간 상호작용**에 대한 실험은 명시되지 않았으며, 이는 향후 연구 주제로 남는다.

실용적 활용

ReTool은 수학 문제 해결, 과학적 계산, 엔지니어링 설계 등 구조화된 문제 해결이 필요한 산업 및 연구 분야에서 활용 가능하다. 특히, **자동화된 시스템 설계**, **교육용 AI**, **연구 보조 도구** 등에서 실용적 가치가 높다.