NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CodePRM: Execution Feedback-enhanced Process Reward Model for Code Generation

Qingyao Li, Xinyi Dai, Xiangyang Li, Weinan Zhang, Yasheng Wang, Ruiming Tang, Yong Yu

Introduction

Large Language Models (LLMs) have demonstrated remarkable proficiency in code generation, yet their internal reasoning processes often remain opaque. While Process Reward Models (PRMs) have successfully improved mathematical reasoning by rewarding individual solution steps, applying them to programming tasks presents unique challenges. Specifically, defining the granularity of a "step" in code and bridging the gap between abstract reasoning and concrete execution are significant hurdles.

CodePRM addresses these issues by introducing an execution feedback-enhanced process reward model. By training a model to score individual thought steps based on actual pass rates and error messages from the resulting code, CodePRM creates a verifier that significantly boosts LLM performance on complex programming benchmarks like APPS and Codeforces.

Methodology

The CodePRM framework consists of a three-stage process designed to align abstract thoughts with execution outcomes.

  1. Data Collection via Tree Search: The authors employ tree search algorithms (such as MCTS) to generate diverse "thought traces" for a given problem. Each thought step is mapped to one or more subsequent code snippets.
  2. Feedback-Enhanced Labeling: Unlike traditional PRMs that use binary labels, CodePRM utilizes Average Pass Rates. A thought step's score is determined by the average percentage of test cases passed by the code variations it produces. This stage also captures execution feedback, such as compiler errors and runtime exceptions.
  3. The CodePRM Model: A Qwen2.5-Coder-7B model is fine-tuned to act as the reward model. It takes the problem description, thought chain, generated code, and execution feedback as inputs to predict the quality of each step.
  4. Generate-Verify-Refine (GVR) Pipeline: During inference, the model generates thoughts and uses CodePRM to identify the "weakest link"—the step with the lowest score. The LLM then refines only that specific reasoning step before re-generating the code.
Overview of the CodePRM framework, including data collection, model training with feedback, and the GVR pipeline.

Experimental Results

The model was evaluated on the APPS dataset (Introductory, Interview, and Competition levels) and Codeforces (difficulty ratings 1200-1700).

CodePRM consistently outperformed strong baselines, including general-purpose PRMs and search-based methods like LATS.

  • Performance Gains: On the APPS "Competition" level, the base model's Pass@1 was boosted from 16% to 29% using the CodePRM GVR pipeline.
  • Hard Problems: For Codeforces problems with a 1700 rating, CodePRM achieved a 41% Pass@1, compared to the base model's 18%.
Pass rate comparison on APPS sub-tasks showing CodePRM's superiority over random and standard PRM rewards across different generation budgets.

Key Insights

  • Execution as Ground Truth: A critical finding is that PRMs trained without execution feedback perform no better than random rewards. In the coding domain, the model must observe error messages to understand why a specific thought was flawed.
  • Soft Labels for Richer Supervision: Continuous pass rates (0.0 to 1.0) provide a more nuanced supervisory signal than binary labels, accounting for the probabilistic nature of code generation.
  • Targeted Refinement: The "Locate-Minimum" strategy—refining only the lowest-scoring step—prevents over-correction and preserves valid logic in other parts of the reasoning chain.

Limitations and Future Work

While effective, CodePRM's refinement step depends on the generator LLM's inherent capability; a weak generator may struggle to fix identified errors. Additionally, the reliance on test suites limits its application to open-ended tasks without unit tests. Future research may explore integrating CodePRM as a reward signal for Reinforcement Learning to directly improve the generator model.

Summary updated

BibTeX
@inproceedings{li2025codeprm,
  author = {Qingyao Li and Xinyi Dai and Xiangyang Li and Weinan Zhang and Yasheng Wang and Ruiming Tang and Yong Yu},
  title = {{CodePRM: Execution Feedback-enhanced Process Reward Model for Code Generation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure