做代码生成模型训练的团队会发现,静态检查奖励比执行测试更高效且能避免能力悬崖,建议在困难任务上优先采用。
该论文系统研究了扩散语言模型在代码生成中的强化学习后训练,重点探索了三种维度:奖励设计、提示条件采样和任务难度。研究发现,静态检查作为无需执行的奖励信号,在HumanEval上使DiffuCoder从53.9提升至67.1,在LiveCodeBench上从14.9提升至15.5,同时减少9.4%的推理时间。中等程度的AST提示在困难任务上最有效,而奖励设计的最佳选择依赖于任务难度:相似度奖励在简单子集上更优,静态检查在困难子集上更可靠。这些发现表明,奖励设计和训练指导显著影响扩散RL在代码生成中的表现。
Beyond Execution: Static-Analysis Rewards and Hint-Conditioned Diffusion RL for Code Generation
Reinforcement Learning (RL) is an important paradigm for aligning Diffusion Language Models (DLMs) toward functional correctness in code generation. However, these models often encounter a ``capability cliff'' on complex tasks, where execution-based semantic rewards become too low to provide a viable learning signal. In this paper, we present a systematic empirical study of RL post-training for diffusion-based code generation along three axes: reward design, hint-conditioned sampling, and task difficulty. We investigate the effectiveness of execution-free rewards as alternatives to traditional unit-test execution, the role of training-time hint-conditioned diffusion sampling in mitigating exploration bottlenecks, and the impact of these design choices varies across tasks with different difficulty levels. Across HumanEval, MBPP, and LiveCodeBench, we find that static checking is the strongest overall standalone execution-free reward in our setting, especially improving DiffuCoder from 53.9 to 67.1 on HumanEval and from 14.9 to 15.5 on LiveCodeBench while reducing rollout time by 9.4\%. We further find that moderate AST-based hinting is most useful on harder benchmarks, while the best reward design depends strongly on task difficulty: similarity-based rewards are more effective on easier subsets, whereas static checking is more reliable on harder subsets where execution rewards are low. These findings suggest that reward design and training guidance substantially affect diffusion RL performance in our evaluated code-generation setting.