Sc-Math: Spontaneous Step-level Self-correction Makes Large Language Models Better Mathematical Reasoners

Yuchen Yan, Jin Jiang, Yang Liu, Yixin Cao, Xin Xu, Mengdi Zhang, Xunliang Cai, Jian Shao · OpenReview

TL;DR

Large Language Models (LLMs) often make mistakes when solving complex math problems. This paper introduces "S³c-Math," a novel approach that enables LLMs to spontaneously detect and correct errors as they reason, step-by-step. By training LLMs on specially crafted self-correction data, S³c-Math significantly improves their mathematical reasoning accuracy across various benchmarks.

What Problem Does This Paper Address?

LLMs have shown impressive capabilities in various tasks, including mathematical reasoning. However, they are prone to errors, especially in multi-step problems where an early mistake can cascade and lead to an incorrect final answer. Existing "self-correction" methods often rely on external tools, more capable models, or multi-stage processes, which aren't truly intrinsic to the LLM's reasoning process. The core challenge is to make LLMs capable of internalizing the ability to identify and fix their own reasoning errors in real-time, without external intervention.

Methods

The paper proposes a two-pronged approach:

  1. Constructing Self-Correction Data (S³C-MATHQA):
    • Wrong Step Sampling: They use an instruction-tuned LLM to generate potentially erroneous steps for existing correct reasoning chains (from MetaMathQA). This is done using a cross-validation strategy to maintain data diversity.
  2. Correctness Validation: They employ a "pass@k" metric to rigorously check if a sampled step is indeed incorrect.
  3. Reflection and Improvement Generation: For each identified error, they use a powerful LLM (Meta-Llama-3-70B-Instruct) to generate "reflection" (explaining why the error occurred) and "improvement" (explaining how to correct it). This detailed feedback is crucial for teaching the LLM.
  4. The resulting dataset, S³C-MATHQA, contains these self-correction instances with reflections and improvements.
  5. Training Strategy (S³c-Math):
    • Supervised Fine-Tuning (SFT): They fine-tune LLMs using a combined dataset of original MetaMathQA and the newly created S³C-MATHQA.
  6. Loss Masking: Crucially, they use a loss mask to prevent the model from learning from the erroneous steps during training. This ensures the model learns to correct errors, not to reproduce them.

Datasets

  • MetaMathQA: Used as the seed dataset for constructing self-correction data. It provides existing step-by-step mathematical reasoning examples.
  • S³C-MATHQA: A newly constructed dataset containing 532K self-correction instances, including erroneous steps, reflections, and improvements. This dataset is central to training the spontaneous self-correction capability.
  • Evaluation Datasets: GSM8K, MATH, SVAMP, and Mathematics.

Key Insights and Ideas

  • Spontaneity is Key: The paper argues that true self-correction should be an intrinsic, spontaneous capability of the LLM, not an add-on process. This is the core innovation.
  • Step-Level Correction Matters: Correcting errors at the step-by-step inference stage is more effective than waiting until the end of the entire reasoning process (instance-level correction). This prevents error propagation.
  • Reflection and Improvement are Crucial: Simply identifying an error isn't enough. Providing detailed explanations of why an error occurred and how to fix it significantly enhances the LLM's learning and ability to self-correct.
  • Data Construction is a Bottleneck: Creating high-quality self-correction data is challenging. The proposed method offers an efficient way to generate such data from existing reasoning datasets.

Key Results

  • Consistent Performance Gains: S³c-Math models consistently outperform their baselines across multiple mathematical reasoning benchmarks (GSM8K, MATH, SVAMP, Mathematics).
  • Significant Accuracy Improvements: For example, on GSM8K, Meta-Llama-3-8B improved from 81.12% to 82.94% (Pass@1) with S³C-MATHQA. On MATH, it improved from 30.58% to 33.14%.
  • Generalization: The method shows effectiveness across various foundation LLMs, including both generalist models (Meta-Llama-3, Mistral) and specialized math models (DeepSeek-Math, Qwen2-Math).
  • Ablation Studies:
    • Step-level correction is shown to be superior to instance-level correction.
  • Generating self-correction data from existing paths (as they do) is more effective than generating entirely new paths (e.g., via MCTS), suggesting that aligning with existing reasoning structures aids in learning spontaneous correction.

Limitations and Future Work

  • Generating Diverse Steps: The authors acknowledge that generating more diverse erroneous steps during the sampling phase could further improve the method.
  • Quality of Reflection/Improvement: Further research could explore ways to enhance the quality and diversity of the generated reflections and improvements.
  • Broader Applications: The authors aim to extend this spontaneous self-correction ability to more reasoning tasks beyond mathematics.

Summary updated

BibTeX
@inproceedings{yan2025sc,
  author = {Yuchen Yan and Jin Jiang and Yang Liu and Yixin Cao and Xin Xu and Mengdi Zhang and Xunliang Cai and Jian Shao},
  title = {{Sc-Math: Spontaneous Step-level Self-correction Makes Large Language Models Better Mathematical Reasoners}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i24.34749},
}
Figure