Improving LLM Reasoning through Scaling Inference Computation with Collaborative Verification

Zhenwen Liang, Ye Liu, Tong Niu, Xiangliang Zhang, Yingbo Zhou, Semih Yavuz · DOI

Abstract

This paper presents a framework for enhancing the reasoning capabilities of Large Language Models (LLMs) by scaling inference-time computation. The approach utilizes specialized verifiers, Math-Rev and Code-Rev, trained on diverse datasets of correct and incorrect solutions. A key innovation is CoTnPoT (Collaborative Verification), which cross-references natural language Chain-of-Thought (CoT) reasoning with executable Program-of-Thought (PoT) code. This method effectively filters logical errors, enabling models like Qwen-72B-Instruct to outperform GPT-4o and LLaMA-3.1-405B on challenging benchmarks like GSM8k and MATH.

Introduction

Despite the impressive performance of LLMs, they often struggle with the precision required for complex reasoning tasks, frequently producing "hallucinated" logic or calculation errors. A primary reason is that LLMs are typically trained on correct solutions, leaving them unable to recognize or learn from mistakes. While greedy decoding often fails on difficult problems, the correct answer is often present within a set of sampled solutions. The challenge is identifying this "needle in the haystack." This paper addresses this by scaling inference-time computation through a "sample-and-rank" approach using collaborative verification.

Methods

The proposed framework consists of two main components:

  1. Scaling Inference via Verification: Instead of a single greedy output, the system generates multiple reasoning paths. These paths are scored by a verifier trained using SimPO (Simple Preference Optimization). SimPO was found to be more effective than traditional Outcome Reward Models (ORMs) or other preference tuning methods like DPO, as it aligns better with the model's internal likelihood of generating correct solutions.
  2. CoTnPoT (Collaborative Verification): This novel method leverages the descriptive nature of Chain-of-Thought (CoT) and the executable precision of Program-of-Thought (PoT).
  3. Math Reasoning: A CoT solution is translated into a Python program (PoT). If the code execution result differs from the text-based answer, the solution is flagged as incorrect.
  4. Code Reasoning: Natural language descriptions are generated alongside code to provide the verifier with richer context, helping to identify subtle logic errors that might be obscured in abstract code.
Overview of the CoTnPoT collaborative verification framework.

Datasets and Training

The authors curated a comprehensive dataset of ~160k correct and ~100k incorrect math solutions, and ~132k correct and ~145k incorrect code solutions. These were generated by a variety of models, including Mistral, Phi3, and InternLM2-Math. Training on errors from multiple models proved critical for building a robust "judge" that generalizes well across different reasoners, rather than just learning the specific biases of a single backbone model.

Key Results

The collaborative verification approach achieved state-of-the-art results on major benchmarks. Using Qwen-72B-Instruct as the base reasoner, the method reached 95.6% on GSM8k and 76.9% on MATH. Notably, this configuration outperformed significantly larger models, including GPT-4o and LLaMA-3.1-405B.

Accuracy on the MATH test set compared to state-of-the-art models.

The Math-Rev verifier showed a high True Positive Rate (90.09%) in identifying correct solutions. Furthermore, the study demonstrated that verifiers trained on smaller models (e.g., Mistral-7B) could effectively improve the performance of much larger reasoners, highlighting the robustness of the training methodology.

Discussion and Limitations

A significant insight from this work is that execution serves as a powerful grounding truth. By forcing models to translate logic into code, calculation errors that might slip past a text-only verifier are caught. Additionally, weighted voting—combining majority voting with verifier scores—was found to be superior for complex problems where the verifier's confidence provides a vital signal.

However, scaling inference computation comes with trade-offs. Sampling dozens of solutions and running them through verifiers and code interpreters significantly increases computational cost and latency compared to simple greedy decoding. The current system also relies on Outcome Reward Models (ORMs); while effective, Process Reward Models (PRMs) that score individual reasoning steps could offer even finer granularity, albeit at a higher training cost. Finally, the success of CoTnPoT depends on the accuracy of the "Coder LLM" in translating text to code.

Conclusion

This research demonstrates that scaling inference-time computation through collaborative verification is a highly effective strategy for improving LLM reasoning. By integrating execution-based grounding and preference-optimized verification, the proposed method sets new benchmarks for mathematical and coding tasks, providing a scalable path toward more reliable AI reasoning.

Summary updated

BibTeX
@misc{liang2024improving,
  author = {Zhenwen Liang and Ye Liu and Tong Niu and Xiangliang Zhang and Yingbo Zhou and Semih Yavuz},
  title = {{Improving LLM Reasoning through Scaling Inference Computation with Collaborative Verification}},
  year = {2024},
  eprint = {2410.05318},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.05318},
}
Figure