From Mathematical Reasoning to Code: Generalization of Process Reward Models in Test-Time Scaling

Zhengyu Chen, Yudong Wang, Teng Xiao, Ruochen Zhou, Xuesheng Yang, Wei Wang, Zhifang Sui, Jingang WangarXiv 2025 · DOI

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in multi-step reasoning, yet they remain prone to logical inconsistencies and "hallucinations." Traditional Outcome Reward Models (ORMs) provide feedback only on the final result, offering a sparse signal that fails to pinpoint specific errors in a derivation. Process Reward Models (PRMs) address this by providing granular, step-by-step feedback. This paper explores the scalability, generalization, and test-time efficiency of PRMs, specifically focusing on how models trained on mathematical reasoning can enhance performance in code generation.

Methodology: ASLAF and Search Strategies

A core challenge in training PRMs is the need for high-quality, step-level annotations. The authors introduce ASLAF (Automatic Step-Level Annotation and Filtering), a pipeline that utilizes an ensemble of LLMs to cross-verify reasoning steps. By retaining only those steps where multiple models reach a consensus on error location, the authors significantly reduced noise in the training data.

Beyond training, the study investigates test-time scaling—the strategic use of additional computation during inference. The authors compared four methods: Best-of-N Sampling, Beam Search, Majority Voting, and Monte Carlo Tree Search (MCTS). MCTS emerged as the most effective strategy for navigating complex reasoning trees when computational budgets allow for extensive search.

Key Insights: Scaling and Training Dynamics

The research identifies critical patterns in how PRMs scale with model size and training duration.

Diminishing Returns of Scale

While increasing the PRM's parameter count (from 0.5B to 72B) generally improves accuracy, the gains follow a logarithmic trend. As shown in Figure 1, the rate of improvement slows significantly after the 14B parameter mark. This suggests that for many applications, a mid-sized model may offer the best balance between accuracy and the high computational cost of running large reward models during inference.

Accuracy vs. Model Size (log scale) showing diminishing returns.

Emergence in Training

A notable observation is that PRM accuracy does not improve linearly. Instead, performance often plateaus for several thousand training steps before experiencing a sudden "leap." This emergent behavior, illustrated in Figure 3 across both the prm800k and MATH500 datasets, suggests that the model requires a critical threshold of data exposure before it internalizes the underlying logic of the reward signal.

Accuracy leaps during training across different datasets.

Generalization: From Math to Code

One of the paper's most significant findings is the "Universal Reasoning" hypothesis. PRMs trained exclusively on mathematical datasets demonstrated a surprising ability to evaluate code generation tasks, resulting in a 4% average performance boost on benchmarks like HumanEval+ and MBPP+. This cross-domain generalization indicates that logical correctness in technical fields shares a common underlying structure that PRMs can effectively capture.

Conclusion

This study underscores the power of Process Reward Models in enhancing LLM reasoning. By combining high-quality filtered data (ASLAF) with sophisticated search strategies like MCTS, PRMs can significantly improve performance across domains. Future work will explore whether these logical reasoning patterns extend to less structured fields, such as legal analysis or creative writing, and how to further optimize the trade-off between model scale and inference latency.

Summary updated

BibTeX
@misc{chen2025from,
  author = {Zhengyu Chen and Yudong Wang and Teng Xiao and Ruochen Zhou and Xuesheng Yang and Wei Wang and Zhifang Sui and Jingang Wang},
  title = {{From Mathematical Reasoning to Code: Generalization of Process Reward Models in Test-Time Scaling}},
  year = {2025},
  eprint = {2506.00027},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.00027},
}
Figure