请少训练、多修复:通过零样本学习重新审视自动化程序修复
Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-shot Learning
AI总结:
本文提出零样本APR工具AlphaRepair,直接利用预训练CodeBERT依据上下文预测正确代码,无需缺陷修复训练数据,并在Defects4J上显著优于现有基线。
摘要:
由于自动化程序修复(APR)具有广阔前景,研究人员提出了多种APR技术,包括基于启发式、基于模板和基于约束的技术。在这些经典APR技术中,基于模板的技术被广泛认为是最先进的。然而,这类基于模板的技术需要预定义模板来执行修复,因此其有效性受到限制。为此,研究人员利用深度学习的最新进展进一步改进APR。这类基于学习的技术将APR视为神经机器翻译问题,把有缺陷/已修复的代码片段分别用作翻译的源语言和目标语言。通过这种方式,这些技术严重依赖大量高质量的缺陷修复提交,而构建这些提交可能极其昂贵且具有挑战性。此外,这些基于学习的技术的编辑多样性受限于其训练数据集中可用的缺陷修复。因此,本文旨在重新审视基于学习的APR问题,并提出AlphaRepair,利用零样本学习直接将大型预训练代码模型用于APR。我们的核心洞见是:与其建模修复编辑应当是什么样,不如基于上下文信息直接预测正确代码是什么。我们基于近期的CodeBERT模型,将AlphaRepair实现为一个实用的多语言APR工具。在广泛使用的Defects4J基准上的结果表明,AlphaRepair能够显著优于最先进的APR工具。我们还研究了不同设计选择的影响,并表明AlphaRepair在较新版本的Defects4J(2.0)上表现更好,其修复数量是表现最佳基线的3.3倍,表明AlphaRepair有可能避免现有基于学习技术的数据集过拟合问题。
英文摘要:
Due to the promising future of Automated Program Repair (APR), researchers have proposed various APR techniques, including heuristic-based, template-based, and constraint-based techniques. Among such classic APR techniques, template-based techniques have been widely recognized as state of the art. However, such template-based techniques require predefined templates to perform repair, and their effectiveness is thus limited. To this end, researchers leveraged the recent advances in Deep Learning to further improve APR. Such learning-based techniques view APR as a Neural Machine Translation problem, using the buggy/fixed code snippets as the source/target languages for translation. In this way, such techniques heavily rely on large numbers of high-quality bug-fixing commits, which can be extremely costly and challenging to construct. Furthermore, the edit variety of these learning-based techniques are limited to the available bug-fixes within their training datasets. Therefore, in this paper, we aim to revisit the learning-based APR problem, and propose AlphaRepair, to leverage zero-shot learning directly using large pre-trained code models for APR. Our main insight is instead of modeling what a repair edit should look like, we can directly predict what the correct code is based on the context information. We have implemented AlphaRepair as a practical multilingual APR tool based on the recent CodeBERT model. Our results on the widely used Defects4J benchmark show that AlphaRepair can substantially outperform state-of-the-art APR tools. We also studied the impact of different design choices and show that AlphaRepair performs even better on a newer version of Defects4J (2.0) with 3.3X more fixes than best performing baseline, indicating that AlphaRepair can potentially avoid the dataset-overfitting issue of existing learning-based techniques.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。