Masked Thought: Simply Masking Partial Reasoning Steps Can Improve Mathematical Reasoning Learning of Language Models

📄 arXiv: 2403.02178v2 📥 PDF

作者: Changyu Chen, Xiting Wang, Ting-En Lin, Ang Lv, Yuchuan Wu, Xin Gao, Ji-Rong Wen, Rui Yan, Yongbin Li

分类: cs.CL, cs.AI, cs.LG

发布日期: 2024-03-04 (更新: 2024-07-10)

备注: Accepted by ACL 2024


💡 一句话要点

提出随机遮蔽部分推理步骤以提升语言模型的数学推理能力

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 语言模型 数学推理 数据增强 模型微调 长距离依赖 推理任务 遮蔽技术

📋 核心要点

  1. 现有的推理任务方法在处理细微错误时表现不佳,导致模型性能下降。
  2. 本文提出通过随机遮蔽推理链中的部分标记,来增强模型的推理能力,避免依赖外部资源。
  3. 在GSM8K数据集上,应用该方法的模型在准确率上分别提高了5%和10%,显示出显著的效果提升。

📝 摘要(中文)

在推理任务中,即使是微小的错误也可能导致不准确的结果,从而影响大型语言模型的性能。以往的微调方法通过人类标注、使用更大的模型或自我采样来缓解这一问题,但成本较高。本文提出了一种新方法,通过对输入进行扰动,随机遮蔽推理链中的某些标记,特别适用于推理任务。应用于Llama-2-7B模型的GSM8K微调时,该方法在GSM8K准确率上提高了5%,在GSM-IC准确率上提高了10%。此外,该方法与现有的显式数据增强方法相辅相成,能够在多个数据集和不同基础模型上实现性能提升。通过案例研究和定量分析,探讨了该方法改善模型捕捉长距离依赖关系的机制,尤其是与问题相关的依赖关系。

🔬 方法详解

问题定义:本文旨在解决大型语言模型在推理任务中因细微错误导致的性能下降问题。现有方法依赖于昂贵的外部资源,如人类标注和更大的模型,难以普遍适用。

核心思路:论文提出通过随机遮蔽推理链中的部分标记,来增强模型的推理能力。这种设计旨在减少对外部资源的依赖,同时提高模型在推理任务中的表现。

技术框架:整体方法包括数据预处理、随机遮蔽标记的生成、模型训练和评估阶段。首先对输入数据进行处理,然后随机选择需要遮蔽的标记,最后进行模型的微调和性能评估。

关键创新:最重要的创新点在于通过简单的遮蔽技术提升了模型的推理能力,与传统的依赖外部标注的微调方法形成鲜明对比。

关键设计:在参数设置上,遮蔽的比例和选择策略是关键设计因素。损失函数采用标准的交叉熵损失,网络结构基于Llama-2-7B进行微调,确保模型在推理任务中能够有效捕捉长距离依赖关系。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,采用随机遮蔽方法的模型在GSM8K数据集上准确率提高了5%,在GSM-IC数据集上提高了10%。此外,该方法与现有的显式数据增强方法结合使用时,能够在多个数据集和不同基础模型上实现性能提升,展示了其广泛的适用性。

🎯 应用场景

该研究的潜在应用领域包括教育、自动化问答系统和智能助手等。通过提升语言模型的推理能力,可以在更复杂的数学问题和逻辑推理任务中提供更准确的解答,具有重要的实际价值和广泛的应用前景。

📄 摘要(原文)

In reasoning tasks, even a minor error can cascade into inaccurate results, leading to suboptimal performance of large language models in such domains. Earlier fine-tuning approaches sought to mitigate this by leveraging more precise supervisory signals from human labeling, larger models, or self-sampling, although at a high cost. Conversely, we develop a method that avoids external resources, relying instead on introducing perturbations to the input. Our training approach randomly masks certain tokens within the chain of thought, a technique we found to be particularly effective for reasoning tasks. When applied to fine-tuning with GSM8K on Llama-2-7B, this method achieved a 5\% improvement in GSM8K accuracy and a 10\% improvement in GSM-IC accuracy over standard supervised fine-tuning with a few codes modified. Furthermore, it is complementary to existing methods. When integrated with related explicit data augmentation methods, it leads to improvements across five datasets of various augmentation methods, as well as two different base models. We further investigate the mechanisms behind this improvement through case studies and quantitative analysis, suggesting that our approach may provide superior support for the model in capturing long-distance dependencies, especially those related to questions. This enhancement could deepen understanding of the premises in questions and prior steps. Our code is available at Github.