S^3cMath: Spontaneous Step-level Self-correction Makes Large Language Models Better Mathematical Reasoners

📄 arXiv: 2409.01524v3 📥 PDF

作者: Yuchen Yan, Jin Jiang, Yang Liu, Yixin Cao, Xin Xu, Mengdi Zhang, Xunliang Cai, Jian Shao

分类: cs.CL, cs.AI

发布日期: 2024-09-03 (更新: 2025-06-28)

备注: AAAI 2025: https://ojs.aaai.org/index.php/AAAI/article/view/34749


💡 一句话要点

提出S^3c-Math,赋予大语言模型自发式步骤级数学推理自纠错能力

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

关键词: 大语言模型 数学推理 自纠错 步骤级推理 模型训练

📋 核心要点

  1. 现有自纠错方法依赖后验生成、外部知识或多模型协作,未能体现大语言模型内在的自纠错能力。
  2. S$^3$c-Math通过步骤级采样构建自纠错数据,并设计训练策略,使模型具备自发式步骤级自纠错能力。
  3. 实验证明,该方法在GSM8K、MATH等数学基准测试中,显著提升了各种基础大语言模型的性能。

📝 摘要(中文)

本文提出了一系列名为S$^3$c-Math的数学大语言模型,该模型能够进行自发式步骤级自纠错的数学推理。这种能力帮助大语言模型识别其正在进行的推理是否倾向于包含错误,并同时纠正这些错误,从而产生更可靠的响应。本文提出了一种方法,该方法采用步骤级采样方法来构建逐步自纠错数据,以实现这种能力。此外,本文还实现了一种训练策略,该策略使用上述构建的数据来使大语言模型具备自发式步骤级自纠错能力。实验表明,本文的数据和方法在各种基础大语言模型上均有效,并在GSM8K、MATH和其他数学基准测试中持续显示出显著的进步。据我们所知,我们是第一个在大语言模型的数学推理中引入自发式步骤级自纠错能力的。

🔬 方法详解

问题定义:现有的大语言模型在解决数学推理问题时,虽然可以通过自纠错来提升性能,但现有的自纠错方法往往依赖于外部信息或多模型的协作,无法充分激发和利用大语言模型自身内在的推理和纠错能力。因此,如何让大语言模型在推理过程中自发地、逐步地检测并纠正错误,是一个亟待解决的问题。

核心思路:本文的核心思路是,通过构建包含错误和对应修正的训练数据,训练大语言模型识别并纠正自身推理过程中的错误。具体来说,模型在每一步推理后,都会评估当前步骤是否可能出错,如果认为可能出错,则尝试进行修正。这种自发式的纠错机制,能够更有效地提升模型的推理能力。

技术框架:S$^3$c-Math的技术框架主要包含两个阶段:数据构建和模型训练。在数据构建阶段,采用步骤级采样方法,对模型的推理过程进行采样,并标注出错误步骤和对应的修正。在模型训练阶段,利用构建好的自纠错数据,训练大语言模型,使其具备自发式步骤级自纠错能力。

关键创新:本文最重要的创新点在于提出了自发式步骤级自纠错的概念,并设计了相应的数据构建和训练方法。与以往的自纠错方法相比,S$^3$c-Math不需要外部知识或多模型的协作,而是完全依赖于模型自身的推理能力,从而更有效地提升了模型的性能。

关键设计:在数据构建方面,采用了步骤级采样方法,确保训练数据能够覆盖各种类型的错误。在模型训练方面,设计了特定的损失函数,以鼓励模型在推理过程中进行自纠错。具体的参数设置和网络结构细节在论文中未详细说明,属于未知信息。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,S$^3$c-Math在GSM8K、MATH等数学基准测试中取得了显著的性能提升。具体的数据提升幅度在摘要中提到“consistently showing significant progress”,但未给出具体数值,属于未知信息。该方法在各种基础大语言模型上均有效,表明其具有良好的泛化能力。

🎯 应用场景

S$^3$c-Math的自发式步骤级自纠错能力,可以应用于各种需要复杂推理的场景,例如自动定理证明、代码生成、智能问答等。该研究有助于提升大语言模型在这些领域的应用效果,并推动人工智能技术的发展。

📄 摘要(原文)

Self-correction is a novel method that can stimulate the potential reasoning abilities of large language models (LLMs). It involves detecting and correcting errors during the inference process when LLMs solve reasoning problems. However, recent works do not regard self-correction as a spontaneous and intrinsic capability of LLMs. Instead, such correction is achieved through post-hoc generation, external knowledge introduction, multi-model collaboration, and similar techniques. In this paper, we propose a series of mathematical LLMs called S$^3$c-Math, which are able to perform Spontaneous Step-level Self-correction for Mathematical reasoning. This capability helps LLMs to recognize whether their ongoing inference tends to contain errors and simultaneously correct these errors to produce a more reliable response. We proposed a method, which employs a step-level sampling approach to construct step-wise self-correction data for achieving such ability. Additionally, we implement a training strategy that uses above constructed data to equip LLMs with spontaneous step-level self-correction capacities. Our data and methods have been demonstrated to be effective across various foundation LLMs, consistently showing significant progress in evaluations on GSM8K, MATH, and other mathematical benchmarks. To the best of our knowledge, we are the first to introduce the spontaneous step-level self-correction ability of LLMs in mathematical reasoning.