Not All Votes Count! Translated Program for Verification Improves Self-Consistency of Language Models for Math Reasoning

Vernon Toh, Deepanway Ghosal, Soujanya Poria

Here is a concise, engaging summary of the paper.

Not All Votes Count! Translated Program for Verification Improves Self-Consistency of Language Models for Math Reasoning

TL;DR

Self-consistency via majority voting fails when the most common reasoning paths share arithmetic or semantic errors. PROVE addresses this by converting generated natural language solutions into executable Python programs, verifying that code execution matches the textual answer, and discarding non-matching paths before running majority vote—boosting accuracy on math benchmarks by up to 18%.

What Problem Does This Paper Address?

Smaller open-source Large Language Models (LLMs) (0.5B to 13B parameters) struggle with complex math word problems, frequently making intermediate arithmetic mistakes or hallucinations that cascade into incorrect answers.

While self-consistency (sampling multiple reasoning paths and taking the majority vote) improves performance, it operates under the flawed assumption that errors are diverse and will cancel each other out. In practice, models often generate wrong answers with high frequency. Fine-tuning verifiers or using formal theorem provers (like Lean) requires heavy computational overhead, massive distillation datasets, or domain-specific formalization.

Methods

PROVE (translated PROgrams for VErification) is a zero-shot, model-agnostic verification framework that operates in three stages:

  1. Plan and Solution Generation: The base LLM generates multiple candidate solutions ($n=16$, sampled at temperature 0.7) using zero-shot Plan-and-Solve prompting.
  2. Translation to Code: Each generated reasoning path is converted into a standalone Python program using an off-the-shelf open-source model (by default, Phi-3-mini-4k-instruct, a 3.8B model) or a specialized model (e.g., GPT-4o for complex symbolic math).
  3. Execution, Verification, and Selection:
  4. The Python program is executed to produce an output $\hat{p}_i$.
  5. The numeric/symbolic answer $\hat{s}_i$ is extracted from the natural language solution.
  6. Verification rule: If $\hat{p}_i == \hat{s}_i$, the solution is kept; if not, it is discarded.
  7. Aggregation: A standard majority vote is taken only among the verified solutions. (If no solutions survive verification, it falls back to a vanilla majority vote across all original candidates).

Datasets

The authors evaluated PROVE across eight standard mathematical reasoning benchmarks without training or fine-tuning:

  • GSM8K: Grade school math word problems.
  • MATH-500: A 500-problem representative subset of the challenging Hendrycks MATH dataset.
  • SVAMP, ASDIV, MultiArith, AddSub, SingleEQ, SingleOP: Arithmetic word problem benchmarks testing variations, single-step operations, and multi-step reasoning.

Key Insights and Ideas

  • Code as an exact calculator and logic validator: Natural language reasoning is prone to simple mental math slip-ups (e.g., "$4.20 + $9.45 + $1.35 = $15.10" instead of "$15.00"). Python offloads calculation to a deterministic interpreter, completely erasing pure calculation mistakes.
  • Smaller models benefit the most: While large models have stronger latent calculation ability, smaller models (0.5B–3B) fail disproportionately due to arithmetic slips rather than structural reasoning flaws. Program verification filters out these low-level errors, giving small models outsized gains.
  • Code verification beats natural language self-critique: When prompting an LLM in natural language to find its own errors ("Are there any errors in this solution?"), accuracy was substantially worse than programmatic execution (e.g., 53.45% vs. 73.01% on Llama-3.2-1B).

Key Results

Evaluated across 13 open-source LLMs (from Llama-2/3/3.1/3.2, Gemma-2, Mistral, and Qwen-2 families, sized 0.5B to 13B):

  • Consistent Superiority: PROVE outperformed both greedy baselines and self-consistency baselines (Chain-of-Thought, Plan-and-Solve, and Program-of-Thought @ maj16/maj32) across all 13 models on GSM8K and MATH-500.
  • Massive Gains on Smaller Models: On GSM8K, Llama-2-7B-chat achieved 59.51% (+17.96% over the best baseline), and Llama-3.2-1B-Instruct reached 73.01% (+6.90%).
  • Harder Datasets: On MATH-500, PROVE achieved gains of up to +8.80% (reaching 17.40% on Llama-2-13B-chat) and +7.40% on Qwen2-0.5B-Instruct using sympy-assisted translation.
  • Zero Calculation Errors: In an error analysis of 100 failed GSM8K examples using Llama-3.2-1B-Instruct, PROVE reduced arithmetic calculation errors to 0% (down from 20% in standard Plan-and-Solve).

Limitations and Future Work

  • Translation Bottleneck for Complex Math: For basic arithmetic (GSM8K), small models like Phi-3-mini translate solutions accurately; however, on advanced datasets like MATH-500, the authors had to rely on GPT-4o to generate the SymPy Python code, showing that translation itself requires strong coding competencies.
  • Semantic Errors Persist: While calculation errors dropped to 0%, semantic errors (e.g., misinterpreting the problem setup or entities) rose to account for 82% of remaining failures, as code translation faithful to an invalid plan still produces the wrong logical premise.
  • Compute Overhead: Translating and executing up to 16 programs per problem adds inference and execution latency compared to standard single-pass generation.

Summary updated

BibTeX
@inproceedings{toh2025not,
  author = {Vernon Toh and Deepanway Ghosal and Soujanya Poria},
  title = {{Not All Votes Count! Translated Program for Verification Improves Self-Consistency of Language Models for Math Reasoning}},
  booktitle = {AI4MATH @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=uw2FhekYtc},
}
Figure