Physics of Language Models: Part 2.2, How to Learn From Mistakes on Grade-School Math Problems

Tian Ye, Zicheng Xu, Yuanzhi Li, Zeyuan Allen-Zhu
8/29/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: facebookresearch/iGSM (91 stars, MIT, last commit 2025-01-12).

Abstract

Language models have demonstrated remarkable performance in solving reasoning tasks; however, even the strongest models still occasionally make reasoning mistakes. Recently, there has been active research aimed at improving reasoning accuracy, particularly by using pretrained language models to "self-correct" their mistakes via multi-round prompting. In this paper, we follow this line of work but focus on understanding the usefulness of incorporating "error-correction" data directly into the pretraining stage. This data consists of erroneous solution steps immediately followed by their corrections. Using a synthetic math dataset, we show promising results: this type of pretrain data can help language models achieve higher reasoning accuracy directly (i.e., through simple auto-regression, without multi-round prompting) compared to pretraining on the same amount of error-free data. We also delve into many details, such as (1) how this approach differs from beam search, (2) how such data can be prepared, (3) whether masking is needed on the erroneous tokens, (4) the amount of error required, (5) whether such data can be deferred to the fine-tuning stage, and many others.

View on arXivView PDF

Code Implementations(1)

MIT

The code for creating the iGSM datasets in papers "Physics of Language Models Part 2.1, Grade-School Math and the Hidden Reasoning Process" (arxiv 2407.20311) and "Physics of Language Models Part 2.2, How to Learn From Mistakes on Grade-School Math Problems" (arxiv 2408.16293)

919Python, Jupyter NotebookJan 12, 20251 years agoMIT

Similar Papers

Cite this paper

@article{ye2024physics,
  title  = {Physics of Language Models: Part 2.2, How to Learn From Mistakes on Grade-School Math Problems},
  author = {Tian Ye and Zicheng Xu and Yuanzhi Li and Zeyuan Allen-Zhu},
  year   = {2024},
  eprint = {2408.16293},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.16293v1},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.16293.svg)](https://codeofpaper.com/paper/2408.16293)

Discussion