arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.11684cs.CLcs.AI
收藏

MathFimer: 通过填空中间任务扩展推理步骤以增强数学推理

MathFimer: Enhancing Mathematical Reasoning by Expanding Reasoning Steps through Fill-in-the-Middle Task

Zhejiang University(浙江大学);Meituan Group(美团集团);Peking University(北京大学);Hong Kong University of Science and Technology(香港科技大学)

Yuchen Yan, Yongliang Shen, Yang Liu, Jin Jiang, Xin Xu, Mengdi Zhang, Jian Shao, Yueting Zhuang

AI总结:

MathFimer通过填空中间任务扩展推理步骤,提升大语言模型的数学推理能力,无需依赖强大外部模型或昂贵计算资源。

摘要:

数学推理是推动大语言模型(LLMs)发展的重要前沿。虽然逐步方法已成为LLMs中数学问题解决的主导范式,但训练数据中推理步骤的质量从根本上限制了模型的性能。最近的研究表明,更详细的中间步骤可以提高模型性能,但现有步骤扩展方法要么需要更强大的外部模型,要么会带来显著的计算成本。在本文中,我们介绍了一个名为MathFimer的新框架,该框架受代码推理中的''填空中间''任务启发。通过将解决方案链分解为前缀-后缀对,并训练模型重建缺失的中间步骤,我们开发了一个专门的模型MathFimer-7B,基于我们精心编写的NuminaMath-FIM数据集。然后,我们将这些模型应用于增强现有的数学推理数据集,通过在解决方案链中插入详细的中间步骤,创建MathFimer扩展版本。通过在多个数学推理数据集上的全面实验,包括MathInstruct、MetaMathQA等,我们证明了在MathFimer扩展数据上训练的模型在GSM8K和MATH等各种基准测试中均优于在原始数据上训练的模型。我们的方法提供了一种实用、可扩展的解决方案,用于增强LLMs中的数学推理能力,而无需依赖强大的外部模型或昂贵的推理过程。

英文摘要:

Mathematical reasoning represents a critical frontier in advancing large language models (LLMs). While step-by-step approaches have emerged as the dominant paradigm for mathematical problem-solving in LLMs, the quality of reasoning steps in training data fundamentally constrains the performance of the models. Recent studies have demonstrated that more detailed intermediate steps can enhance model performance, yet existing methods for step expansion either require more powerful external models or incur substantial computational costs. In this paper, we introduce MathFimer, a novel framework for mathematical reasoning step expansion inspired by the ''Fill-in-the-middle'' task from code reasoning. By decomposing solution chains into prefix-suffix pairs and training models to reconstruct missing intermediate steps, we develop a specialized model, MathFimer-7B, on our carefully curated NuminaMath-FIM dataset. We then apply these models to enhance existing mathematical reasoning datasets by inserting detailed intermediate steps into their solution chains, creating MathFimer-expanded versions. Through comprehensive experiments on multiple mathematical reasoning datasets, including MathInstruct, MetaMathQA and etc., we demonstrate that models trained on MathFimer-expanded data consistently outperform their counterparts trained on original data across various benchmarks such as GSM8K and MATH. Our approach offers a practical, scalable solution for enhancing mathematical reasoning capabilities in LLMs without relying on powerful external models or expensive inference procedures.

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

↑