论文标题

通过神经符号编辑语法修复带有变压器的错误

Fix Bugs with Transformer through a Neural-Symbolic Edit Grammar

论文作者

Hu, Yaojie, Shi, Xingjian, Zhou, Qiang, Pike, Lee

论文摘要

我们介绍了NSEDIT(Neural-Smbolic Edit),这是一种基于变压器的新型代码修复方法。只有给定包含错误的源代码,NSEDIT预测了可以修复错误的编辑序列。编辑语法是作为常规语言配制的,变压器将其用作神经符号脚本接口来生成编辑程序。我们修改变压器并添加指针网络以选择编辑位置。训练了一组读者,以重新将光束搜索产生的编辑序列重新列为编辑序列。我们在验证设置中微调了rerankers,以减少过度拟合。 NSEDIT在各种代码维修数据集上进行了评估,并在codexglue基准的Tufano小数据集上实现了新的最先进的准确性($ 24.04 \%$)。当程序因软件包而异时,以及当越野车是具体的时,NSEDIT会表现出色。我们对我们的方法进行了详细的分析,并证明了每个组件的有效性。

We introduce NSEdit (neural-symbolic edit), a novel Transformer-based code repair method. Given only the source code that contains bugs, NSEdit predicts an editing sequence that can fix the bugs. The edit grammar is formulated as a regular language, and the Transformer uses it as a neural-symbolic scripting interface to generate editing programs. We modify the Transformer and add a pointer network to select the edit locations. An ensemble of rerankers are trained to re-rank the editing sequences generated by beam search. We fine-tune the rerankers on the validation set to reduce over-fitting. NSEdit is evaluated on various code repair datasets and achieved a new state-of-the-art accuracy ($24.04\%$) on the Tufano small dataset of the CodeXGLUE benchmark. NSEdit performs robustly when programs vary from packages to packages and when buggy programs are concrete. We conduct detailed analysis on our methods and demonstrate the effectiveness of each component.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源