Large Reasoning Models (LRMs) like o3 and DeepSeek-R1 have achieved remarkable progress in natural language reasoning with long chain-of-thought. However, they remain computationally inefficient and struggle with accuracy when solving problems requiring complex mathematical operations. In this work, we present AgentMath, an agent framework that seamlessly integrates language models' reasoning capabilities with code interpreters' computational precision to efficiently tackle complex mathematical problems. Our approach introduces three key innovations: (1) An automated method that converts natural language chain-of-thought into structured tool-augmented trajectories, generating high-quality supervised fine-tuning (SFT) data to alleviate data scarcity; (2) A novel agentic reinforcement learning (RL) paradigm that dynamically interleaves natural language generation with real-time code execution. This enables models to autonomously learn optimal tool-use strategies through multi-round interactive feedback, while fostering emergent capabilities in code refinement and error correction; (3) An efficient training system incorporating innovative techniques, including request-level asynchronous rollout scheduling, agentic partial rollout, and prefix-aware weighted load balancing, achieving 4-5x speedup and making efficient RL training feasible on ultra-long sequences with scenarios with massive tool invocation. The evaluations show that AgentMath achieves state-of-the-art performance on challenging mathematical competition benchmarks including AIME24, AIME25, and HMMT25. Specifically, AgentMath-30B-A3B attains 90.6%, 86.4%, and 73.8% accuracy respectively, achieving advanced performance. The results validate the effectiveness of our approach and pave the way for building more sophisticated and scalable mathematical reasoning agents.
翻译:以o3和DeepSeek-R1为代表的大型推理模型(LRMs)在自然语言长链推理方面取得了显著进展。然而,在处理需要复杂数学运算的问题时,这些模型仍存在计算效率低下和准确性不足的问题。本文提出AgentMath,一种将语言模型的推理能力与代码解释器的计算精度无缝集成的智能体框架,以高效解决复杂数学问题。我们的方法引入了三项关键创新:(1)一种自动化方法,可将自然语言思维链转换为结构化工具增强轨迹,生成高质量监督微调(SFT)数据以缓解数据稀缺问题;(2)一种新颖的智能体强化学习(RL)范式,能够动态交织自然语言生成与实时代码执行。这使得模型能够通过多轮交互反馈自主学习最优工具使用策略,同时培养代码优化和错误修正的涌现能力;(3)一种高效训练系统,融合了多项创新技术,包括请求级异步推演调度、智能体部分推演和前缀感知加权负载均衡,实现了4-5倍的加速,使得在超长序列和大规模工具调用场景下进行高效RL训练成为可能。评估结果表明,AgentMath在包括AIME24、AIME25和HMMT25在内的挑战性数学竞赛基准测试中取得了最先进的性能。具体而言,AgentMath-30B-A3B模型分别达到了90.6%、86.4%和73.8%的准确率,实现了卓越性能。这些结果验证了我们方法的有效性,并为构建更复杂、可扩展的数学推理智能体开辟了道路。