# Training Verifiers to Solve Math Word Problems

Verifiers trained to rank sampled solutions improve math word problem accuracy

Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser and 6 more · arXiv · 2021-10-27

- **Problem** Language models struggle with multi-step math because they cannot undo an early mistake in a single sampled solution. Scaling alone would need an exorbitant parameter count to reach moderate performance on MATH.
- **Method** The authors train a verifier to score sampled solutions and return the highest-scoring one. The verifier learns the probability that a solution is correct, using labels that check only the final answer.
- **Results** On the full training set, a 6B verifier slightly outperforms a finetuned 175B model. The authors call this gain roughly equivalent to a 30x increase in model size.

## Why one sampled solution often fails

Large language models handle many tasks, but multi-step math still breaks them. Generated samples often contain catastrophic mistakes, even after the model is finetuned. An autoregressive model has no way to correct an error it already wrote, so a solution that drifts off course stays broken. The authors judge that scaling alone would demand an exorbitant parameter count to reach moderate performance on the MATH dataset.

The authors needed a dataset that is linguistically diverse and clean, yet still within reach of current models. GSM8K was built with human problem writers and natural language solutions, rather than scraped or templated problems. It has 8.5K problems, split into 7.5K training problems and 1K test problems.

## What GSM8K is built to test

Each problem takes between 2 and 8 steps and needs only elementary arithmetic and early algebra. Problem writers were encouraged to avoid shared templates, so held-out test performance measures something closer to real generalization. Compared with ASDiv's 2.3K problems, GSM8K is larger, comes with natural language solutions, and needs more steps on average.

## Verifiers rank sampled solutions

The key idea is to stop trusting one sample: draw many candidate solutions and let a second model pick the best one. The finetuning baseline samples one low-temperature solution and checks whether its final answer is correct. Verification instead draws several high-temperature solutions, scores each one, and returns the top-ranked solution.

A verifier's score is the probability that a solution is correct, given the problem and that candidate. Its training label depends only on whether the final answer is right, so flawed reasoning that happens to land on the right answer counts as correct.

The verifier is then trained for a single epoch on those labeled solutions. The verifier starts from the generator and also keeps the language modeling loss as an auxiliary objective. At test time, 100 completions are sampled for each problem and the one with the highest verifier score is returned.

Models often make arithmetic slips, so the authors inject calculation annotations into the training solutions. At test time a calculator overrides sampling for the value inside an annotation, which removes that class of error.

## Choosing when to stop the generator

Test@1 keeps improving almost monotonically as training runs on, even while test loss starts to overfit. Test@100 peaks within the first few epochs and then degrades more sharply, because the model becomes overconfident and covers the solution space poorly. For that reason the authors use generators trained for 2 epochs to produce the verifier's training samples.

Output format matters too: when a 6B model was finetuned to give only the final answer, its test solve rate fell from 20.6% to 5.2%.

## Verification against finetuning

The authors compared finetuning and verification at 6B and 175B across training set sizes from 500 to 8000 problems. Verification scored 100 solutions per problem, and results are means over 3 runs, except the 175B verification curve, which has a single run. At small dataset sizes verification gave no benefit, which the authors attribute to the verifier overfitting to the correct answer before it learns general reasoning.

Once the training set is large enough, verification gives a strong boost.

On the full training set, the 6B verifier slightly outperforms a finetuned 175B model. The authors describe this gain as roughly equivalent to a 30x increase in model size, which is the core evidence for the paper's claim. The 175B verifiers take off earlier than the 6B verifiers, needing fewer training problems to surpass the finetuning baseline.

## How finetuning scales with model and data

The 175B model clearly outperforms the smaller finetuned models across training set sizes. Extrapolating along the data dimension is harder, because performance doesn't follow a log-linear trend there.

## Which verifier design choices matter

By default, the verifier predicts correctness after every token, which works as a token-level value function. This is harder to train, but the token-level verifier ends up ahead of the solution-level verifier later in training. The solution-level verifier starts to overfit, which the authors read as evidence that the per-token signal pushes the model to judge the reasoning instead of memorizing the final answer.

The authors also compared training the verifier jointly with language modeling against training it on verification alone. Including the language modeling objective is a strict improvement in their comparison. The authors reason that a better grasp of the language distribution should help the verifier tell samples apart.

Varying generator and verifier sizes separately, a large generator with a small verifier beats a small generator with a large verifier. Verification remains effective even when the verifier is much smaller than the generator, which suggests it relies on fairly coarse heuristics. Increasing the generator's size has a larger impact than increasing the verifier's size.

## Test-time sampling and voting

For the 6B verifier, performance rises as the number of completions per test problem grows up to 400, then declines. The authors attribute the decline to the risk of finding adversarial solutions that fool the verifier, which eventually outweighs the benefit of more search. They evaluate with 100 completions, which captures most of the gain at a modest compute cost.

Instead of picking only the single top solution, the final answer can be the one with the most votes among the top verifier-ranked solutions. With 100 samples, letting only the top 3-5 vote is reported as optimal, while with 3200 samples about the top 30 is reported as optimal. A larger pool of samples can therefore support a larger voting group.

## Dropout as a regularizer

Both finetuning and verification benefit from residual dropout, set to 20% after a hyperparameter sweep. GPT-3 models were not pretrained with dropout, so the authors ran an extra pretraining stage with dropout before finetuning. This step reduces the distribution shift the model meets during finetuning.

Dropout gives a clear improvement for finetuning over the baseline. For solution-level verifiers, dropout reduces the overfitting seen in the unregularized baseline and reaches a level similar to token-level verifiers. Token-level verifiers already overfit less, so dropout helps them only a little, and their batch size was raised by a factor of 4 to cope with the harder objective.

## Limitations

Verifier labels check only the final answer, so solutions with flawed reasoning that reach the right answer become false positives. For the 6B verifier, gains stop past 400 completions per test problem, and the authors attribute the drop to adversarial solutions. The experiments use only GSM8K, and the authors expect verification to scale to harder mathematical distributions without testing that here.

The 175B verification curve comes from a single run.

## Paper info

- **Authors**: Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, John Schulman
- **Venue**: arXiv · Preprint
- **First published**: 2021-10-27
- **Added**: 2026-11-11
- **Updated**: 2021-11-18
- **Version**: v2
- **arXiv**: 2110.14168
- **Category**: cs.LG · cs.CL
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2110.14168v2) · [PDF ↗](https://arxiv.org/pdf/2110.14168v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, John Schulman (2021). Training Verifiers to Solve Math Word Problems. arXiv:2110.14168v2. https://arxiv.org/abs/2110.14168v2

**BibTeX**

```
@misc{cobbe2021training,
  title = {{Training Verifiers to Solve Math Word Problems}},
  author = {Karl Cobbe and Vineet Kosaraju and Mohammad Bavarian and Mark Chen and Heewoo Jun and Lukasz Kaiser and Matthias Plappert and Jerry Tworek and Jacob Hilton and Reiichiro Nakano and Christopher Hesse and John Schulman},
  year = {2021},
  eprint = {2110.14168},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.14168v2}
}
```

## Other paper commentary

- [Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation](https://refivu.com/en/papers/a52e355d-5c49-4353-8d39-5013e656760c-learning-phrase-representations-using-rnn-encoder-decoder.md)
- [Effective Approaches to Attention-based Neural Machine Translation](https://refivu.com/en/papers/58ab56a7-1cd5-4c5e-be62-69ff9c1387c7-effective-approaches-to-attention-based-neural-machine.md)
- [Natural TTS Synthesis by Conditioning WaveNet on Mel Spectrogram Predictions](https://refivu.com/en/papers/596b5353-6c04-4ada-a92e-25d0fee13147-natural-tts-synthesis-by-conditioning-wavenet-on-mel.md)
- [Universal Language Model Fine-tuning for Text Classification](https://refivu.com/en/papers/f2470a4a-1c9b-423c-8757-ba73cfe37b54-universal-language-model-fine-tuning-for-text-classification.md)
- [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://refivu.com/en/papers/13b055d5-7dcd-422f-b6d8-3704e3d48533-bart-denoising-sequence-to-sequence-pre-training-for.md)
- [Prefix-Tuning: Optimizing Continuous Prompts for Generation](https://refivu.com/en/papers/01cf041e-b71c-444b-8b44-e94ac976a9db-prefix-tuning-optimizing-continuous-prompts-for-generation.md)
- [Perceptual Losses for Real-Time Style Transfer and Super-Resolution](https://refivu.com/en/papers/780825d2-51b4-4426-9340-0f1859a637a2-perceptual-losses-for-real-time-style-transfer-and.md)
- [Learning Deep Features for Discriminative Localization](https://refivu.com/en/papers/6bdcd2a6-8c81-46b4-95d2-9560f97fd427-learning-deep-features-for-discriminative-localization.md)
- [node2vec: Scalable Feature Learning for Networks](https://refivu.com/en/papers/dc0725e4-ec21-4d60-9363-0eac2fc69a10-node2vec-scalable-feature-learning-for-networks.md)
- [Explainable Artificial Intelligence (XAI): Concepts, Taxonomies, Opportunities and Challenges toward Responsible AI](https://refivu.com/en/papers/3f686a20-03db-4642-80bb-f85fafc1d04f-explainable-artificial-intelligence-xai-concepts-taxonomies.md)
- [V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation](https://refivu.com/en/papers/a6e119c3-3c19-41b0-afee-c1d81e538a35-v-net-fully-convolutional-neural-networks-for-volumetric.md)
- [Stop Explaining Black Box Machine Learning Models for High Stakes Decisions and Use Interpretable Models Instead](https://refivu.com/en/papers/96d240ca-7c32-4f79-8167-c2beafc2a38f-stop-explaining-black-box-machine-learning-models-for.md)

## Terms in this paper

- [dropout](https://refivu.com/en/terms/db73f75bbdd3-dropout)
- [GSM8K](https://refivu.com/en/terms/e48f0e01064d-gsm8k)
- [GPT-3](https://refivu.com/en/terms/d95e818ac9ce-gpt-3)
- [generator](https://refivu.com/en/terms/2935313c9c21-generator)
- [solve rate](https://refivu.com/en/terms/e910f14dced7-solve-rate)
- [Finetuning](https://refivu.com/en/terms/0a951298207b-finetuning)
- [majority vote](https://refivu.com/en/terms/2deeb4c6ce0c-majority-vote)
- [MATH dataset](https://refivu.com/en/terms/94ac35e21337-math-dataset)
- [verifier](https://refivu.com/en/terms/7e971aef0230-verifier)
- [language modeling objective](https://refivu.com/en/terms/d732e3ce1328-language-modeling-objective)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/6eaa7788-f79e-40b8-87b7-3ca3217edfe9-training-verifiers-to-solve-math-word-problems)
