[论文解读] Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
DrRepair 通过程序-反馈图和自监督预训练,从诊断反馈中修复程序,在 DeepFix 和 SPoC 上取得最先进的修复率。
We consider the problem of learning to repair programs from diagnostic feedback (e.g., compiler error messages). Program repair is challenging for two reasons: First, it requires reasoning and tracking symbols across source code and diagnostic feedback. Second, labeled datasets available for program repair are relatively small. In this work, we propose novel solutions to these two challenges. First, we introduce a program-feedback graph, which connects symbols relevant to program repair in source code and diagnostic feedback, and then apply a graph neural network on top to model the reasoning process. Second, we present a self-supervised learning paradigm for program repair that leverages unlabeled programs available online to create a large amount of extra program repair examples, which we use to pre-train our models. We evaluate our proposed approach on two applications: correcting introductory programming assignments (DeepFix dataset) and correcting the outputs of program synthesis (SPoC dataset). Our final system, DrRepair, significantly outperforms prior work, achieving 68.2% full repair rate on DeepFix (+22.9% over the prior best), and 48.4% synthesis success rate on SPoC (+3.7% over the prior best).
研究动机与目标
- 激发从编译器/诊断反馈中修复损坏程序的学习动机。
- 解决两个挑战:跨代码与反馈的符号推理,以及有限的带标注的修复数据。
- 提出基于图的表示和自监督训练范式,以提高修复精度。
提出的方法
- 引入将标识符和诊断令牌跨代码与消息连接起来的程序-反馈图。
- 在程序-反馈图上应用图注意力网络,以传播符号信息。
- 通过破坏大规模未标记的可运行程序来创建损坏/修复对,使用自监督预训练范式。
- 使用编码器-解码器架构训练修复模型(DrRepair),定位错误行并生成修复行。
- 在 DeepFix(全量修复率)和 SPoC(合成修复率)上进行评估,对包含多处错误的程序使用迭代修复。
实验结果
研究问题
- RQ1程序-反馈图能否改善信息流和符号跟踪,以超越基于序列/AST 的方法进行程序修复?
- RQ2在数据稀缺的设置中,基于未标记代码的自监督预训练是否能提升修复性能?
- RQ3图推理与预训练的结合如何影响初学者编程任务和程序综合输出的修复准确性?
- RQ4该方法对多处并发错误以及需要跨行推理的错误是否鲁棒?
主要发现
- DrRepair 在 DeepFix 上实现 68.2% 的全量修复率,将此前最佳提升了 22.9 百分点。
- DrRepair 在 SPoC 上实现 48.4% 的合成成功率,将此前最佳提升了 3.7 点。
- 自监督预训练和程序-反馈图为强基线提供互补增益。
- 连接仅代码标记和代码–反馈标记的边都有益,最终的程序-反馈图带来最佳结果。
- 编译器消息对修复性能至关重要;在真实测试数据上移除它们会显著降低准确性。
- 基于图的推理特别有助于需要跨行分析和符号跟踪的错误。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。