paperbot · PL 论文追踪

全部论文 待读 收藏

P2 CYCLE: Learning to Self-Refine the Code Generation

CYCLE:学习自我精化代码生成
OOPSLA 8(OOPSLA1)2024匹配度 3/10 · 论文聚焦代码语言模型的自我精化与错误修复,属于 ML 与 PL 交叉中的代码生成/调试方向;但未涉及静态分析、形式化验证、浮点程序分析或贝叶斯程序分析,也不是将静态分析应用于 Agentic 程序,与研究画像核心方向仅有较弱关联。引用 34 inbox
Yangruibo Ding, Marcus J. Min, Gail Kaiser, Baishakhi Ray
crossref: 2026-09-10

AI 速览

一句话:提出 CYCLE 框架,让代码语言模型依据执行反馈自我精化错误生成,显著增强自修复能力。

预训练代码语言模型在代码生成上表现优异,但现有评测通常只关注一次性预测准确率,忽视了模型的自我精化能力。作者发现,代码语言模型难以高效地自行修正错误生成,而开发者调试并非自己编写的错误预测也十分困难。本文提出 CYCLE 框架,利用可用反馈(如测试套件报告的执行结果)学习对错误生成进行自我精化。作者在 HumanEval、MBPP 和 APPS 三个主流代码生成基准上评估 CYCLE,并实现参数量为 350M、1B、2B 和 3B 的四种变体。实验表明,CYCLE 能维持甚至提升一次性代码生成质量,同时显著增强代码语言模型的自我精化能力,持续提升代码生成性能,最高提升达 63.5。

问题
现有代码语言模型评测只关注一次性预测准确率,忽视自我精化;模型难以自行修复错误生成,开发者调试模型写出的错误代码也很困难。
方法
提出 CYCLE 框架,利用测试套件执行结果等可用反馈,学习对错误代码生成进行自我精化。
评估
在 HumanEval、MBPP、APPS 三个基准上,用 350M、1B、2B、3B 四种参数规模变体进行评估,验证其维持或提升一次性生成质量并显著增强自精化能力。
原文摘要(Abstract)

Pre-trained code language models have achieved promising performance in code generation and improved the programming efficiency of human developers. However, their self-refinement capability is typically overlooked by the existing evaluations of code LMs, which focus only on the accuracy of the one-time prediction. For the cases when code LMs fail to implement the correct program, developers actually find it hard to debug and fix the faulty prediction since it is not written by the developers themselves. Unfortunately, our study reveals that code LMs cannot efficiently self-refine their faulty generations as well. In this paper, we propose CYCLE framework, learning to self-refine the faulty generation according to the available feedback, such as the execution results reported by the test suites. We evaluate CYCLE on three popular code generation benchmarks, HumanEval, MBPP, and APPS. The results reveal that CYCLE successfully maintains, sometimes improves, the quality of one-time code generation, while significantly improving the self-refinement capability of code LMs. We implement four variants of CYCLE with varied numbers of parameters across 350M, 1B, 2B, and 3B, and the experiments show that CYCLE consistently boosts the code generation performance, by up to 63.5

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot2538,
  title = {CYCLE: Learning to Self-Refine the Code Generation},
  author = {Yangruibo Ding and Marcus J. Min and Gail Kaiser and Baishakhi Ray},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA1},
  year = {2024},
  doi = {10.1145/3649825}
}