ReCode: Reinforcing Code Generation with Reasoning-Process Rewards
Lishui Fan, Yu Zhang, Mouxiang Chen, Zhongxin Liu

TL;DR
ReCode introduces a reinforcement learning framework that enhances code generation by integrating reasoning process rewards and execution correctness to improve reasoning quality and prevent reward hacking.
Contribution
The paper proposes ReCode, a novel RL training framework with a new reward learning method and a gating mechanism to improve reasoning in code generation models.
Findings
ReCode-trained 7B model outperforms the base by 16.1%.
ReCode achieves performance comparable to GPT-4-Turbo.
ReCode generalizes to the math domain.
Abstract
In practice, rigorous reasoning is often a key driver of correct code, while Reinforcement Learning (RL) for code generation often neglects optimizing reasoning quality. Bringing process-level supervision into RL is appealing, but it faces two challenges. First, training reliable reward models to assess reasoning quality is bottlenecked by the scarcity of fine-grained preference data. Second, naively incorporating such neural rewards may suffer from reward hacking. This work proposes ReCode (Reasoning-Reinforced Code Generation), a novel RL training framework comprising: (1) Contrastive Reasoning-Process Reward Learning (CRPL), which trains a reward model with synthesized optimized and degraded reasoning variants to assess the quality of reasoning process; and (2) Consistency-Gated GRPO (CG-GRPO), which integrates the reasoning-process reward model into RL by gating neural…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
