M2A:在大型语言模型中协同数学与代理推理
M2A: Synergizing Mathematical and Agentic Reasoning in Large Language Models
AI总结:
本文提出M2A框架,通过模型融合协同数学与代理推理,提升多任务学习下的推理稳定性与性能。
摘要:
尽管推理已成为大型语言模型(LLMs)的核心能力,但不同场景所需的推理模式常不匹配。数学推理通常依赖内在逻辑解决封闭世界问题,而代理推理不仅需要内部推理,还需与外部环境多轮交互,交织思考与行动。这种不匹配阻碍了数学与代理推理相互受益,常导致不稳定推理行为和多任务学习下的有限性能提升。本文提出M2A,一种通过模型融合协同数学与代理推理的新范式。为避免联合训练下过度拟合表层推理模式,M2A直接在参数空间操作:识别对代理行为关键的特征子空间,并仅在数学推理任务向量的零空间内合并,从而在不扰动代理行为的方向注入推理能力。不同于SFT或RL,M2A无需额外梯度更新,且暴露合并系数作为简单调节 knob 控制推理长度。在具有挑战性的现实世界编码代理设置中的实验表明,本方法有效扩展了代理推理深度并带来显著性能提升。应用于微调后的Qwen3-8B模型,M2A将SWE-Bench验证通过率从44.0%提升至51.2%而无需重新训练模型。代码可在https://github.com/laplucky/M2A.git获取。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。