With the advancement of deep learning techniques, the performance of Automatic Program Repair(APR) techniques has reached a new level. Previous deep learning-based APR techniques essentially modified program sentences in the Autoregressive(AR) manner, which predicts future values based on past values. Due to the manner of word-by-word generation, the AR-based APR technique has a huge time delay. This negative consequence overshadows the widespread adoption of APR techniques in real-life software development. To address the issue, we aim to apply the Non-Autoregressive(NAR) method to the APR task, which can output target code in a parallel manner to avoid huge inference delays. To effectively adapt the NAR manner for the APR task, we in this paper propose NARRepair, the first customized NAR code generation model for the APR task. The NARRepair features three major novelties, including 1) using repair actions to alleviate the over-correction issue, 2) extracting dependency information from AST to alleviate the issue of lacking inter-word dependency information, 3) employing two-stage decoding to alleviate the issue of lacking contextual information. We evaluated NARRepair on three widely used datasets in the APR community, and the results show that our technique can significantly improve the inference speed while maintaining high repair accuracy.
翻译:随着深度学习技术的发展,自动程序修复(APR)技术的性能已达到新的水平。以往基于深度学习的APR技术本质上以自回归(AR)方式修改程序语句,即根据过去值预测未来值。由于逐词生成的方式,基于AR的APR技术存在巨大的时间延迟。这一负面后果阻碍了APR技术在实际软件开发中的广泛应用。为解决该问题,我们旨在将非自回归(NAR)方法应用于APR任务,该方法能够以并行方式输出目标代码,从而避免巨大的推理延迟。为将NAR方式有效适配于APR任务,本文提出NARRepair——首个为APR任务定制的NAR代码生成模型。NARRepair具有三大创新点:1)使用修复动作缓解过度修正问题;2)从抽象语法树(AST)提取依赖信息以缓解词间依赖信息缺失问题;3)采用两阶段解码以缓解上下文信息缺失问题。我们在APR领域三个广泛使用的数据集上评估了NARRepair,结果表明该技术能在保持高修复准确率的同时显著提升推理速度。