[Paper Review] Learning From Mistakes Makes LLM Better Reasoner
This paper proposes LeMa, a method that improves few-shot reasoning in large language models (LLMs) by fine-tuning on mistake-correction data pairs, where models learn from incorrect reasoning paths and their corrections. By generating high-quality correction data using GPT-4 and applying a correction-centric evolution strategy, LeMa boosts reasoning performance across multiple LLMs and tasks, achieving state-of-the-art results on GSM8K and MATH benchmarks.
Large language models (LLMs) recently exhibited remarkable reasoning capabilities on solving math problems. To further improve their reasoning capabilities, this work explores whether LLMs can LEarn from MistAkes (LEMA), akin to the human learning process. Consider a human student who failed to solve a math problem, he will learn from what mistake he has made and how to correct it. Mimicking this error-driven learning process, LEMA incorporates mistake-correction data pairs during fine-tuning LLMs. Specifically, we first collect inaccurate reasoning paths from various LLMs, and then employ GPT-4 as a ''corrector'' to identify the mistake step, explain the reason for the mistake, correct the mistake and generate the final answer. In addition, we apply a correction-centric evolution strategy that effectively expands the question set for generating correction data. Experiments across various LLMs and reasoning tasks show that LEMA effectively improves CoT-alone fine-tuning. Our further ablations shed light on the non-homogeneous effectiveness between CoT data and correction data. These results suggest a significant potential for LLMs to improve through learning from their mistakes. Our code, models and prompts are publicly available at https://github.com/microsoft/LEMA.
Motivation & Objective
- To investigate whether large language models (LLMs) can improve reasoning capabilities by learning from their own mistakes, akin to human error-driven learning.
- To generate high-quality mistake-correction data pairs by collecting inaccurate reasoning paths from LLMs and using GPT-4 as a corrector to identify, explain, and fix errors.
- To develop a correction-centric evolution strategy that expands the training data by focusing on moderately difficult questions for better generalization.
- To evaluate the effectiveness of LeMa across diverse open-source LLMs and reasoning tasks, including mathematical and commonsense reasoning.
- To analyze the contribution of different correction components—mistake step, explanation, and corrected solution—to model performance.
Proposed method
- Collect inaccurate reasoning paths from various LLMs (e.g., LLaMA, GPT series) on math problems to serve as mistake examples.
- Use GPT-4 as a 'corrector' to generate three-part correction data: (1) the incorrect step, (2) an explanation of why it is wrong, and (3) the corrected reasoning path with the right final answer.
- Filter out corrections with incorrect final answers through human evaluation to ensure data quality.
- Apply a correction-centric evolution strategy that selects moderately difficult questions as seeds to generate new correction data, improving data diversity and utility.
- Fine-tune LLMs using a blended dataset of chain-of-thought (CoT) data and correction data, enabling the model to learn from both correct reasoning and error correction.
- Conduct ablation studies to isolate the contribution of each correction component and evaluate data selection strategies.
Experimental results
Research questions
- RQ1Can LLMs improve their reasoning capabilities by learning from their own mistakes, similar to human error-driven learning?
- RQ2How does the performance of LeMa compare to standard CoT fine-tuning across different LLMs and reasoning tasks?
- RQ3What is the relative contribution of different components in correction data—mistake step, explanation, and corrected solution—to the final model performance?
- RQ4Does focusing data augmentation on moderately difficult questions yield better results than random sampling in correction data generation?
- RQ5How does mixing CoT data and correction data compare to using a single data source when training data size is controlled?
Key findings
- LeMa with LLaMA-2-70B achieves 83.5% on GSM8K and 25.0% on MATH, outperforming CoT-only fine-tuning (81.4% and 23.6%, respectively).
- Applying the correction-centric evolution strategy improves LLaMA-2-70B’s MATH performance from 25.0% to 29.3%.
- LeMa enhances specialized models like WizardMath and MetaMath, demonstrating broad applicability.
- The ablation study shows that removing the corrected solution or explanation significantly degrades performance, while omitting the mistake step has less impact, suggesting implicit error localization.
- Mixing CoT and correction data outperforms using either data type alone when training data size is held constant, indicating complementary benefits.
- Moderately difficult questions are more effective than randomly selected ones for evolving correction data, as they yield higher-quality and more useful corrections.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.