arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.18755cs.SEcs.AIcs.CL
收藏

PreciseCoder:超越单元测试奖励的忠实且可泛化的调试方法

PreciseCoder: Faithful and Generalizable Debugging Beyond Unit-Test Rewards

University of Chicago(芝加哥大学);University of Southern California(南加州大学);Google(谷歌);University of California, Berkeley(加利福尼亚大学伯克利分校)

Yunkai Zhan, Miaosen Chai, Shangshang Wang, Jike Zhong, Yuqing Yang, Deqing Fu, Serina Chang, Wang Bill Zhu

AI总结:

PreciseCoder是一种新增语义验证局部编辑信号的代码调试训练算法,可减少编辑量并保持通过率,还能泛化到仓库级修复,其推理轨迹可提升前沿模型的编辑精度。

摘要:

从单元测试中进行强化学习(RL)是训练后代码模型的常用方法,但单元测试仅能判断最终程序是否通过。我们分析了仅基于单元测试的奖励在调试过程中会教会模型什么,发现尽管这种方法能提高通过率,但也会让模型进行更多编辑,甚至在已正确的代码中虚构错误。我们提出了PreciseCoder,这是一种训练算法,它在单元测试奖励的基础上增加了语义验证的局部编辑信号,该信号与更小的编辑量和更高的通过率相关。在4B、9B和27B规模的模型上,PreciseCoder将平均编辑行数从7-15行减少到3行,同时保持与仅使用单元测试训练相当的通过率。仅在单行错误上训练的PreciseCoder可泛化到仓库级别的程序修复,在该场景下它能以更小的补丁解决更多问题。其精度还可从较弱模型迁移到较强模型:给定9B规模PreciseCoder模型的推理轨迹,GPT-5.6 Sol和Qwen3.8-Max等前沿模型无需额外训练,编辑精度可提升4.6至12.4个百分点。对推理轨迹的语言分析表明,我们的奖励会鼓励模型对单行代码进行推理,指出有错误的行,并形成一致的错误假设。

英文摘要:

Reinforcement learning (RL) from unit tests is the common recipe for post-training code models, but a unit test only asks whether the final program passes. We analyze what this unit-test-only reward teaches a model during debugging and find that, while it raises pass rates, it also teaches the model to edit more and to hallucinate bugs in code that is already correct. We introduce PreciseCoder, a training algorithm that augments the unit-test reward with a signal for semantically verified, localized edits, which correlates with smaller edits and higher pass rates. On 4B, 9B, and 27B models, PreciseCoder reduces the average number of edit lines from 7-15to 3 at a pass rate on par with unit-test-only training. Trained only on single-line bugs, PreciseCoder can generalize to repository-level program repair, where it resolves more issues with smaller patches. Its precision also transfers from weaker to stronger models: given the reasoning trace of a 9B PreciseCoder model, frontier models such as GPT-5.6 Sol and Qwen3.8-Max gain 4.6-12.4 points in edit precision with no additional training. Linguistic analysis of the thinking traces shows that our reward encourages the model to reason about individual lines, name the buggy ones, and form consistent bug hypotheses.

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

↑