arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2504.11536cs.CLcs.AI
收藏

ReTool:用于LLMs中策略性工具使用的强化学习

ReTool: Reinforcement Learning for Strategic Tool Use in LLMs

ByteDance Seed(字节跳动种子项目)

Jiazhan Feng, Shijue Huang, Xingwei Qu, Ge Zhang, Yujia Qin, Baoquan Zhong, Chengquan Jiang, Jinxin Chi, Wanjun Zhong

AI总结:

针对LLMs在结构化问题解决场景中的不足,提出ReTool,通过动态交错代码执行与自动化RL范式增强工具使用策略,在AIME基准上32B模型400步达67%准确率,扩展设置超o1-preview 27.9%,推动混合系统发展。

摘要:

尽管使用强化学习(RL)训练的推理模型(如DeepSeek R1)在文本推理方面表现出色,但在需要结构化问题解决的场景中仍存在困难,例如几何推理、简洁计算或复杂方程求解——这些领域中,代码解释器(CI)等计算工具展现出显著优势。为了弥合这一差距,我们提出ReTool,通过工具集成学习增强长文本推理,包含两个关键特征:(1)在自然语言推理过程中动态交错实时代码执行;(2)一种自动化RL范式,允许策略展开时进行多轮实时代码执行,并基于结果反馈教会模型学习何时以及如何调用工具。ReTool采用系统化训练框架,首先通过合成冷启动数据生成,为微调基础模型生成代码增强的长文本推理轨迹。随后的RL训练利用任务结果作为奖励,迭代优化模型的工具使用策略,使模型无需人类先验知识即可自主发现最优工具调用模式。在具有挑战性的数学奥林匹克基准AIME上的实验证明了ReTool的优越性:我们的32B模型在400个训练步骤中达到67%的准确率,在效率和性能上优于基于文本的RL基线(40%准确率,1080个步骤)。值得注意的是,ReTool-32B在扩展设置中达到72.5%的准确率,超过OpenAI的o1-preview 27.9%。进一步分析揭示了代码自我修正等涌现行为,标志着模型自主掌握自适应工具使用的“顿悟时刻”。这些发现突显了结果驱动的工具集成在推进复杂数学推理方面的潜力,并为混合神经符号系统提供了新见解。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑