DreamPRM-Code: Function-as-Step Process Reward Model with Label Correction for LLM Coding

Ruiyi Zhang, Peijia Qin, Qi Cao, Pengtao XiearXiv 2025 · DOI

Abstract

Process Reward Models (PRMs) have significantly enhanced mathematical reasoning in Large Language Models (LLMs) by providing feedback at intermediate steps. However, applying PRMs to code generation faces two primary hurdles: defining an appropriate "step" granularity and managing the inherent noise in intermediate training labels. We present DreamPRM-Code, which addresses these challenges through Chain-of-Function (CoF) prompting—treating individual functions as logical reasoning steps—and a meta-learning framework for label correction. Our approach achieves a state-of-the-art 80.9 pass@1 rate on the contamination-free LiveCodeBench, outperforming leading models such as OpenAI’s o4-mini and DeepSeek-R1.

Introduction

While PRMs excel in domains with clear logical progression like mathematics, their application to programming has been limited. Standard code generation often treats a script as a monolithic block, making intermediate rewards difficult to assign. Conversely, line-by-line rewards are computationally prohibitive and often lack logical context. This is known as the "Step" Problem: in math, a step is a line of logic; in code, a single line is too granular, while a script is too coarse.

Furthermore, training data for PRMs is typically generated via Monte Carlo (MC) sampling, which introduces significant "Label Noise". A model might write a buggy helper function but still pass tests due to a lucky edge case, or write perfect code that fails because of a subsequent minor typo. This noise degrades the PRM's accuracy, as it learns from incorrect signals about which intermediate states are actually "on the right track."

Methodology

Chain-of-Function (CoF) Prompting

To solve the granularity problem, DreamPRM-Code utilizes Chain-of-Function (CoF) prompting. Instead of generating a single block of code, the model is prompted to structure its solution modularly. It first defines high-level logic in a main() function, followed by independent helper functions. Each function—complete with its own docstring—serves as a discrete "reasoning step," allowing the PRM to evaluate the code at a structural, logical level rather than line-by-line.

Meta-Learning Label Correction

To address label noise, the researchers treat the intermediate training labels as learnable parameters rather than fixed ground truth. They implement a bi-level optimization framework:

  • Lower Level: The PRM is trained on the noisy intermediate labels.
  • Upper Level: The model's performance is evaluated against "clean" labels derived from actual unit test results of the final code.
  • The Correction: The system backpropagates through the training process to adjust the intermediate labels, effectively "purifying" the training data so the PRM learns from more accurate signals.
The meta-learning framework for label correction in DreamPRM-Code.

Experimental Results

We evaluated DreamPRM-Code on LiveCodeBench (LCB), focusing on problems published after the training cutoffs of major models to ensure a contamination-free assessment. The system used Qwen3-Coder-30B as the policy model and Qwen-2.5-Coder-3B as the base for the PRM.

DreamPRM-Code established a new state-of-the-art for test-time scaling in coding tasks. As shown in the results below, it achieved an overall pass@1 of 80.9, notably outperforming OpenAI's o4-mini-high (77.1), Gemini-2.5 (72.5), and DeepSeek-R1 (68.7).

Performance comparison on LiveCodeBench against top LLMs and test-time scaling methods.

The ablation studies highlight the importance of the denoising mechanism. While the CoF format alone provides a strong baseline (80.2), the addition of meta-learning label correction provides the critical performance boost to 80.9, particularly by improving accuracy on "Hard" problems.

Discussion and Conclusion

The success of DreamPRM-Code hinges on the insight that functions are the natural "atoms" of programming logic. By forcing the model to follow a modular structure, the code becomes interpretable for the reward model. Furthermore, unlike math where verifying intermediate steps is difficult, code has a binary truth: unit tests. By leveraging these tests to retroactively fix "dirty" intermediate signals, DreamPRM-Code provides a viable path to better model reasoning.

Future work will explore how this "function-as-step" logic applies to massive, multi-file software repositories where dependencies are significantly more complex than the single-file solutions evaluated here.

Summary updated

BibTeX
@misc{zhang2025dreamprm,
  author = {Ruiyi Zhang and Peijia Qin and Qi Cao and Pengtao Xie},
  title = {{DreamPRM-Code: Function-as-Step Process Reward Model with Label Correction for LLM Coding}},
  year = {2025},
  eprint = {2512.15000},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.15000},
}
Figure