Automated Program Repair (APR) techniques have shown more and more promising results in fixing real-world bugs. Despite the effectiveness, APR techniques still face an overfitting problem: a generated patch can be incorrect although it passes all tests. It is time-consuming to manually evaluate the correctness of generated patches that can pass all tests. To address this problem, many approaches have been proposed to automatically assess the correctness of patches generated by APR techniques. However, existing approaches require a large set of manually labeled patches as the training data. To mitigate the issue, in this study, we propose PatchZero, the patch correctness assessment by adopting large pre-trained models. Specifically, for patches generated by a new or unseen APR tool, PatchZero does not need labeled patches of this new or unseen APR tool for training (i.e., zero-shot) but directly queries the large pre-trained model to get predictions on the correctness labels without training. In this way, PatchZero can reduce the manual labeling effort when building a model to automatically assess the correctness of generated patches of new APR tools. To provide knowledge regarding the automatic patch correctness assessment (APCA) task to the large pre-trained models, we also design an instance-wise demonstration formation strategy by using contrastive learning. Specifically, PatchZero selects semantically similar patches to help the large pre-trained model to give more accurate predictions on the unlabeled patches. Our experimental results showed that PatchZero can achieve an accuracy of 82.7% and an F1-score of 86.0% on average although no labeled patch of the new or unseen APR tool is available. In addition, our proposed technique outperformed the prior state-of-the-art by a large margin.


翻译:自动程序修复(APR)技术在实际漏洞修复中展现出越来越有前景的效果。尽管有效,APR技术仍面临过拟合问题:生成的补丁虽然能通过所有测试,但可能不正确。人工评估这些通过全部测试的补丁的正确性非常耗时。为解决此问题,已提出多种方法自动评估APR技术生成的补丁正确性。然而,现有方法需要大量人工标注的补丁作为训练数据。为缓解这一局限,本研究提出PatchZero——一种利用大型预训练模型的补丁正确性评估方法。具体而言,对于新或未见过的APR工具生成的补丁,PatchZero无需该新工具的标注补丁进行训练(即零样本),而是直接查询大型预训练模型,无需训练即可获得正确性标签的预测。通过这种方式,PatchZero可在构建自动评估新APR工具生成补丁正确性的模型时减少人工标注工作。为向大型预训练模型提供自动补丁正确性评估(APCA)任务的相关知识,我们设计了一种基于对比学习的实例级演示构建策略。具体来说,PatchZero选择语义相似的补丁帮助大型预训练模型对未标注补丁给出更准确的预测。实验结果表明,尽管缺乏新或未见APR工具的标注补丁,PatchZero平均准确率可达82.7%,F1分数达86.0%。此外,本研究所提技术显著优于先前最先进方法。

0
下载
关闭预览

相关内容

专知会员服务
124+阅读 · 2020年9月8日
[综述]深度学习下的场景文本检测与识别
专知会员服务
78+阅读 · 2019年10月10日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
106+阅读 · 2019年10月9日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
可解释的CNN
CreateAMind
18+阅读 · 2017年10月5日
【推荐】SLAM相关资源大列表
机器学习研究会
10+阅读 · 2017年8月18日
【推荐】图像分类必读开创性论文汇总
机器学习研究会
14+阅读 · 2017年8月15日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Arxiv
17+阅读 · 2021年2月15日
Arxiv
13+阅读 · 2019年11月14日
Arxiv
20+阅读 · 2018年10月25日
Arxiv
19+阅读 · 2018年5月17日
Arxiv
10+阅读 · 2017年7月4日
VIP会员
最新内容
博士论文 | 面向大模型推理的内存高效算法
专知会员服务
0+阅读 · 今天15:20
美空军新型反无人机部队初探
专知会员服务
4+阅读 · 今天5:45
《防空交战流程的概率建模研究》
专知会员服务
6+阅读 · 今天5:04
ICML 2026 教程 | 数值优化理论还重要吗?
专知会员服务
5+阅读 · 7月26日
ICM 2026 | 陶哲轩:人工智能时代的数学
专知会员服务
9+阅读 · 7月26日
《反无人机交战场景下的战斗归零研究》
专知会员服务
7+阅读 · 7月26日
博士论文 | 用代码结构感知方法推进代码大模型
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
可解释的CNN
CreateAMind
18+阅读 · 2017年10月5日
【推荐】SLAM相关资源大列表
机器学习研究会
10+阅读 · 2017年8月18日
【推荐】图像分类必读开创性论文汇总
机器学习研究会
14+阅读 · 2017年8月15日
相关基金
Top
微信扫码咨询专知VIP会员