arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.22249cs.LGcs.SE
收藏

FunPRM:基于元奖励校正的函数作为步骤过程奖励模型用于代码生成

FunPRM: Function-as-Step Process Reward Model with Meta Reward Correction for Code Generation

University of California, San Diego(加州大学圣迭戈分校)

Ruiyi Zhang, Peijia Qin, Qi Cao, Eric Xue, Pengtao Xie

AI总结:

FunPRM通过元学习的奖励校正机制提升代码生成性能,实现更高质量的代码输出。

摘要:

代码生成是大型语言模型(LLMs)的核心应用,但LLMs在复杂的编程任务上仍经常失败。鉴于其在数学推理中的成功,测试时缩放方法如基于过程奖励模型(PRM)的Best-of-N选择提供了一种有前途的改进方法。然而,现有PRMs在代码生成中仍然无效,因为代码缺乏有意义的步骤分解,以及蒙特卡洛估计的不完整解决方案正确性分数(奖励)的噪声。为了解决这些挑战,我们提出了FunPRM。FunPRM促使LLMs鼓励模块化代码生成,将其组织成函数,将函数视为PRM推理步骤。此外,FunPRM引入了一种新的基于元学习的奖励校正机制,利用通过单元测试评估系统获得的干净最终解决方案奖励来净化嘈杂的不完整解决方案奖励。在LiveCodeBench和BigCodeBench上的实验表明,FunPRM在五种基础LLMs上一致优于现有测试时缩放方法,特别是在与O4-mini结合时,在LiveCodeBench上实现了最先进的性能。此外,FunPRM生成的代码对开发者更具可读性和可重用性。

英文摘要:

Code generation is a core application of large language models (LLMs), yet LLMs still frequently fail on complex programming tasks. Given its success in mathematical reasoning, test-time scaling approaches such as Process Reward Model (PRM)-based Best-of-N selection offer a promising way to improve performance. However, existing PRMs remain ineffective for code generation due to the lack of meaningful step decomposition in code and the noise of Monte Carlo-estimated partial-solution correctness scores (rewards). To address these challenges, we propose FunPRM. FunPRM prompts LLMs to encourage modular code generation organized into functions, with functions treated as PRM reasoning steps. Furthermore, FunPRM introduces a novel meta-learning-based reward correction mechanism that leverages clean final-solution rewards obtained via a unit-test-based evaluation system to purify noisy partial-solution rewards. Experiments on LiveCodeBench and BigCodeBench demonstrate that FunPRM consistently outperforms existing test-time scaling methods across five base LLMs, notably achieving state-of-the-art performance on LiveCodeBench when combined with O4-mini. Furthermore, FunPRM produces code that is more readable and reusable for developers.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑