Training Verifiers to Solve Math Word Problems

Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, John SchulmanarXiv 2021

Abstract

State-of-the-art language models can match human performance on many tasks, but they still struggle to robustly perform multi-step mathematical reasoning. To diagnose the failures of current models and support research, we introduce GSM8K, a dataset of 8.5K high quality linguistically diverse grade school math word problems. We find that even the largest transformer models fail to achieve high test performance, despite the conceptual simplicity of this problem distribution. To increase performance, we propose training verifiers to judge the correctness of model completions. At test time, we generate many candidate solutions and select the one ranked highest by the verifier. We demonstrate that verification significantly improves performance on GSM8K, and we provide strong empirical evidence that verification scales more effectively with increased data than a finetuning baseline.

Introduction

While Large Language Models (LLMs) have achieved remarkable success across various natural language tasks, multi-step mathematical reasoning remains a significant challenge. The primary bottleneck is the autoregressive nature of these models: they predict tokens sequentially without an internal mechanism for self-correction. In mathematics, a single minor error in an early step—such as a basic arithmetic slip—cascades through the entire derivation, rendering the final solution unrecoverable. Simply increasing model parameters or training data yields diminishing returns, making high-accuracy reasoning prohibitively expensive through standard scaling alone.

The GSM8K Dataset

To address this, we introduce GSM8K (Grade School Math 8K), a benchmark consisting of 8.5K high-quality, human-written math word problems. Unlike previous datasets that relied on templates, GSM8K is linguistically diverse and requires genuine reasoning over 2 to 8 steps. Solutions are provided in natural language "chains of thought," making them interpretable for humans and effective for model training.

Examples of GSM8K problems and solutions featuring calculator annotations.

Methodology

We investigated two primary approaches to improve reasoning performance:

  1. Finetuning (Baseline): The model is trained using standard language modeling objectives to predict the next token. At test time, it generates a single solution via low-temperature sampling.
  2. Verification: Instead of a single guess, the model generates multiple potential solutions (e.g., 100). A separate verifier model is trained to evaluate these candidates and assign a score representing the probability of correctness. The system then outputs the highest-ranked solution.
  3. Calculator Integration: To mitigate failures caused by simple arithmetic errors, we trained models to use a calculator. When the model generates a specific annotation (e.g., <<2+2=4>>), the system overrides the next token with the precise calculated result.

Scaling and Performance

A key finding of our research is that verification scales significantly better with increased data than standard finetuning. As the training set size grows, the performance gap between the verifier and the baseline widens.

Test solve rates compared across training set sizes and model parameter counts.

Remarkably, verification provides a massive boost in model efficiency. We found that a 6B-parameter model utilizing verification can achieve a solve rate (~35%) comparable to a 175B-parameter model that is only finetuned (~33%). This represents an approximate 30x efficiency gain, suggesting that searching through multiple completions is a powerful alternative to raw parameter scaling. Furthermore, we observed that training the verifier to judge solutions at every token (a "value function") is more robust than evaluating only the final answer.

Limitations and Future Work

Despite its effectiveness, verification introduces increased test-time compute costs, as generating and scoring 100 solutions is slower than generating one. Additionally, verifiers can occasionally be "fooled" by false positives—solutions that reach the correct answer through flawed logic. Future research may explore reinforcement learning loops, where the verifier provides a reward signal to iteratively improve the generator.

Summary updated

BibTeX
@misc{cobbe2021training,
  author = {Karl Cobbe and Vineet Kosaraju and Mohammad Bavarian and Jacob Hilton and Reiichiro Nakano and Christopher Hesse and John Schulman},
  title = {{Training Verifiers to Solve Math Word Problems}},
  year = {2021},
  eprint = {2110.14168},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.14168},
}
Figure