[论文解读] Impact of Code Language Models on Automated Program Repair
本文在四个 APR 基准上对十个代码语言模型(CLMs)进行评估,结果显示 CLMs 能于超越基于 DL 的最先进 APR 方法,并且用 APR 数据对 CLMs 进行微调能获得显著提升。
Automated program repair (APR) aims to help developers improve software reliability by generating patches for buggy programs. Although many code language models (CLM) are developed and effective in many software tasks such as code completion, there has been little comprehensive, in-depth work to evaluate CLMs' fixing capabilities and to fine-tune CLMs for the APR task. Firstly, this work is the first to evaluate ten CLMs on four APR benchmarks, which shows that surprisingly, the best CLM, as is, fixes 72% more bugs than the state-of-the-art deep-learning (DL)-based APR techniques. Secondly, one of the four APR benchmarks was created by us in this paper to avoid data leaking for a fair evaluation. Thirdly, it is the first work to fine-tune CLMs with APR training data, which shows that fine-tuning brings 31%-1,267% improvement to CLMs and enables them to fix 46%-164% more bugs than existing DL-based APR techniques. Fourthly, this work studies the impact of buggy lines, showing that CLMs, as is, cannot make good use of the buggy lines to fix bugs, yet fine-tuned CLMs could potentially over-rely on buggy lines. Lastly, this work analyzes the size, time, and memory efficiency of different CLMs. This work shows promising directions for the APR domain, such as fine-tuning CLMs with APR-specific designs, and also raises awareness of fair and comprehensive evaluations of CLMs and calls for more transparent reporting of open-source repositories used in the pre-training data to address the data leaking problem.
研究动机与目标
- 评估十个代码语言模型在真实世界且公平的 APR 基准上的修复能力。
- 评估用 APR 训练数据对 CLMs 进行微调是否能提升修复性能。
- 分析有问题的代码行如何影响基于 CLM 的修复,并与基于 DL 的 APR 技术进行对比。
- 研究不同规模的 CLMs 的规模、时间和内存效率。
提出的方法
- 在四个 APR 基准上评估十个 CLM(PLBART、CodeT5、CodeGen、InCoder),包括 Defects4J v1.2、Defects4J v2.0、QuixBugs、HumanEval-Java。
- 通过将 HumanEval 转换为 Java 并注入错误,创建一个公平且无数据泄露的基准(HumanEval-Java)。
- 将 CLMs 与四种最先进的基于 DL 的 APR 技术(CURE、RewardRepair、Recoder、KNOD)进行比较。
- 使用两种提示对 CLMs 进行测试,有问题的行在提示中的存在与否,以衡量对有问题上下文的依赖。
- 在一个大型 APR 训练集上对十个 CLMs 进行微调(143,666 条样本;129,300 训练,14,366 验证),并重新评估。
- 在 APR 任务中分析不同 CLM 的模型大小、时间和内存效率。
实验结果
研究问题
- RQ1RQ1:与基于 DL 的 APR 技术相比,预训练的 CLM 在真实世界的 Java 错误基准上的表现如何?
- RQ2RQ2:用 APR 训练数据微调 CLMs 如何影响它们的修复性能和对数据规模的敏感性?
- RQ3RQ3:不同规模的 CLMs 在补丁生成时间、内存使用和可编译性方面的比较?
- RQ4RQ4:在提示中提供有问题的行对 CLM 性能的影响?
- RQ5RQ5:在 CLM 基于 APR 的研究中,公平评估和数据泄露的含义。
主要发现
- 未经过微调的 CLMs 在四个基准上总体修复的错误数量多于基于 DL 的最先进 APR 技术。
- 表现最好的未微调 CLM InCoder-6B 修复了 105 个错误,比顶尖 DL-based APR 方法 KNOD 高 72%。
- 在提示中提供有问题的行通常会减少 CLM 正确修复的数量,尽管也有一些独特的修复被激活。
- 用 APR 数据对 CLMs 进行微调可获得 31%–1267% 的提升,微调后的 CLMs 在平均上比基于 DL 的 APR 技术高出 46%–164%。
- CodeT5 与 CodeGen 在 10,000 个 APR 训练样本后达到顶级修复能力,而 InCoder 从 50,000 个训练样本中获益最大;增加数据量到这些点以上可能会降低某些模型的修复数量。
- 尺寸效率方面,CodeT5 和 InCoder 更占优,其中 CodeT5、PLBART 和 InCoder 的时间/内存性能比 CodeGen 更好。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。