让大模型同时具备数学推理和智能体推理能力,提升代码任务表现。
M2A: Synergizing Mathematical and Agentic Reasoning in Large Language Models
- 通过参数空间融合,将数学推理能力注入智能体模型而不破坏原有行为。
- 在不重新训练的情况下,代码任务解决率从44.0%提升至51.2%。
- 无需梯度更新,仅用一个参数即可控制推理深度,适合实际部署。
尽管推理已成为大语言模型的核心能力,但不同场景下的推理模式常存在错位:数学推理依赖内在逻辑,在单次响应中解决封闭世界问题;而智能体推理不仅需要内部思考,还需与外部环境进行多轮交互,交替执行思考与行动。这种错位导致数学与智能体推理难以互相促进,常引发推理不稳定,且在多任务学习下性能提升有限。本文提出M2A,一种通过模型融合实现数学与智能体推理协同的新范式。为避免联合训练中对表层推理模式的过拟合,M2A直接在参数空间操作:识别影响智能体行为的关键特征子空间,并仅沿其零空间合并数学推理任务向量,从而在不扰动智能体行为的方向上注入推理能力。相比SFT或RL,M2A无需额外梯度更新,且将合并系数作为简单调节旋钮以控制推理长度。在具有挑战性的真实世界编码智能体设置中,该方法有效扩展了智能体推理深度,带来显著性能提升。应用于微调后的Qwen3-8B模型,其SWE-Bench Verified解决率由44.0%提升至51.2%,且无需重训练。代码已开源。
原文摘要 · Abstract (English)
While reasoning has become a central capability of large language models (LLMs), the reasoning patterns required for different scenarios are often misaligned. Mathematical reasoning typically relies on intrinsic logic to solve closed-world problems in a single response, whereas agentic reasoning requires not only internal reasoning but also multi-turn interaction with external environments, interleaving thought and action. This misalignment prevents mathematical and agentic reasoning from effectively benefiting from each other, often yielding unstable reasoning behavior and only limited performance gains under multi-task learning. In this paper, we propose M2A, a novel paradigm that synergizes mathematical and agentic reasoning via model merging. To avoid overfitting to superficial reasoning patterns under joint training, M2A operates directly in parameter space: it identifies the feature subspace critical for agent behavior, and merges the mathematical reasoning task vector only along its null space, thereby injecting reasoning capability along directions that do not perturb agent behavior. Unlike SFT or RL, M2A requires no additional gradient-update and exposes the merging coefficient as a simple knob for controlling reasoning length. Experiments in a challenging real-world coding agent setting show that our method effectively extends agentic reasoning depth and delivers substantial performance improvements. Applied to a fine-tuned Qwen3-8B, M2A improves its SWE-Bench Verified resolved rate from 44.0% to 51.2% without retraining the model. Code is available at https://github.com/laplucky/M2A.git.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。