arXiv:2606.20881cs.AI2026-06

探究内在奖励在代码推理中的有效性与局限性

When Do Intrinsic Rewards Work for Code Reasoning? A Comprehensive Study

论文配图:When Do Intrinsic Rewards Work for Code Reasoning? A Comprehensive Study
图 1 · 摘自论文原文
  • 用模型自身置信度生成奖励,驱动代码生成训练
  • 奖励方法初期有效,但模型逐渐缩短输出、丧失推理能力
  • 适合探索阶段使用,不建议用于初始化真实奖励训练

基于可验证奖励的强化学习(RLVR)推动了大语言模型推理的进展,但依赖昂贵或不可行的真值监督,尤其在编程任务中。近期工作通过模型自身信号(如多数投票或置信度评分)生成奖励,在数学推理上取得显著成功。然而,代码生成面临独特挑战:程序结构复杂、语义等价但语法不同,且验证通常需执行。这些内在奖励方法能否有效迁移至代码尚不明确。本文对代码生成中的内在奖励方法进行了系统性实证研究,在LiveCodeBench上全面评估代表性基于置信度的从内部反馈强化学习(RLIF)方法,在不同训练场景和超参数设置下表现。实验表明,基于置信度的方法虽能带来早期收益,但不可避免地导致模型崩溃:输出持续缩短,推理能力退化,崩溃速度受样本量和温度影响。将RLIF预训练用于初始化RLVR训练,其效果并未显著优于从零开始训练。我们还提供了使用内在奖励训练代码推理模型的实用建议。研究揭示了内在奖励在代码任务中的潜力与限制,为未来代码模型与智能体研究提供指导。

原文摘要 · Abstract (English)

Reinforcement learning with verifiable rewards (RLVR) has driven substantial progress in large language model reasoning, but relies on ground-truth supervision that is costly or infeasible, especially in coding tasks. Recent work addresses this by deriving rewards from a model's own signals, such as majority voting or confidence-based scores, achieving notable success on mathematical reasoning benchmarks. However, code generation poses distinct challenges: programs are structurally complex, semantically equivalent solutions may differ syntactically, and verification typically requires execution. Whether these intrinsic reward methods transfer effectively to code remains unexplored. In this work, we present a systematic empirical study of intrinsic reward methods for code generation. We conduct extensive experiments on LiveCodeBench, systematically evaluating representative certainty-based Reinforcement Learning from Internal Feedback (RLIF) approaches under different training scenarios and hyperparameter settings. Our experiments reveal that certainty-based methods yield early gains but inevitably collapse: models progressively shorten outputs and lose reasoning capability, with collapse speed sensitive to sample size and temperature. When used to initialize RLVR training, RLIF pre-training offers no significant improvement over training from scratch. We also provide actionable recommendations for using intrinsic rewards for training code reasoning models. Our study shows both the promise and limitations of intrinsic reward methods for code, informing future work on code models and agents.

代码生成强化学习内在奖励

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。