Deep learning models have made significant progress in automatic program repair. However, the black-box nature of these methods has restricted their practical applications. To address this challenge, this paper presents an interpretable approach for program repair based on sequence-to-sequence models with causal inference and our method is called CPR, short for causal program repair. Our CPR can generate explanations in the process of decision making, which consists of groups of causally related input-output tokens. Firstly, our method infers these relations by querying the model with inputs disturbed by data augmentation. Secondly, it generates a graph over tokens from the responses and solves a partitioning problem to select the most relevant components. The experiments on four programming languages (Java, C, Python, and JavaScript) show that CPR can generate causal graphs for reasonable interpretations and boost the performance of bug fixing in automatic program repair.
翻译:深层学习模型在自动程序修复方面取得了显著进展。 但是,这些方法的黑箱性质限制了其实际应用。 为了应对这一挑战,本文件提出了基于因果推断的序列到序列模型的可解释程序修复方法,我们的方法称为CPR, 用于因果程序修复的简称。我们的CPR可以在决策过程中产生解释, 由因果相关输入- 输出符号组组成。 首先, 我们的方法通过用数据增强干扰的输入查询模型来推断这些关系。 其次, 它生成一个图示, 从响应中提取符号, 并解决一个分隔问题, 以选择最相关的组件。 对四种程序语言( 贾瓦、 C、 Python 和 JavaScript) 的实验显示, CPR 可以生成因果图表, 用于合理的解释, 并提升自动程序修复中的错误修复功能 。