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 calls.Extensive 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 capabilities.These 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%的准确率,展现了卓越的能力。这些结果验证了我们方法的有效性,并为构建更复杂、可扩展的数学推理智能体铺平了道路。