paperbot · PL 论文追踪

全部论文 待读 收藏

P2 KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair

KNOD:用于自动程序修复的领域知识蒸馏树解码器
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 3/10 · 该论文属于深度学习驱动的自动程序修复,虽涉及程序语言与机器学习的交叉及领域知识注入,但并非用户关注的静态分析、LLM/Agent 改进程序分析、浮点程序分析或贝叶斯程序分析等核心方向。其方法也非建立在当前 LLM/Agent 之上,因此匹配度较低。引用 62 inbox
Nan Jiang, Thibaud Lutellier, Yiling Lou, Lin Tan, Dan Goldwasser, Xiangyu Zhang
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 KNOD,用三段式树解码器与领域规则蒸馏将语法语义知识注入补丁生成,修复缺陷数超越现有 APR 工具。

基于深度学习的自动程序修复(APR)虽能从历史补丁与代码语料中学习生成补丁,但补丁空间中存在大量语法或语义错误的候选,违背源码的语法语义领域知识,因而无法真正修复缺陷。本文提出 KNOD,以直接且全面的方式将领域知识融入补丁生成:其一为新颖的三段式树解码器,依据代码固有的树结构直接生成修复后代码的抽象语法树;其二为新颖的领域规则蒸馏,利用语法与语义规则以及教师—学生分布,在训练与推理两个阶段将领域知识显式注入解码过程。作者在三个广泛使用的基准上评估 KNOD:在 Defects4J v1.2 上修复 72 个缺陷,在 QuixBugs 上修复 25 个,在额外的 Defects4J v2.0 上修复 50 个,性能优于所有已有 APR 工具。

问题
基于深度学习的自动程序修复会产生大量语法或语义上不正确的补丁,这些补丁违背源码的语法与语义领域知识,难以成为真正的修复补丁。
方法
KNOD 采用三段式树解码器按代码树结构直接生成修复后代码的抽象语法树,并通过领域规则蒸馏,结合语法语义规则与教师—学生分布,在训练和推理阶段显式注入领域知识以引导解码。
评估
在 Defects4J v1.2、QuixBugs 与 Defects4J v2.0 三个基准上评估,分别修复 72、25 与 50 个缺陷,并与所有现有 APR 工具对比优于它们。
原文摘要(Abstract)

Automated Program Repair (APR) improves soft-ware reliability by generating patches for a buggy program automatically. Recent APR techniques leverage deep learning (DL) to build models to learn to generate patches from existing patches and code corpora. While promising, DL-based APR techniques suffer from the abundant syntactically or semantically incorrect patches in the patch space. These patches often disobey the syntactic and semantic domain knowledge of source code and thus cannot be the correct patches to fix a bug. We propose a DL-based APR approach KNOD, which in-corporates domain knowledge to guide patch generation in a direct and comprehensive way. KNOD has two major novelties, including (1) a novel three-stage tree decoder, which directly generates Abstract Syntax Trees of patched code according to the inherent tree structure, and (2) a novel domain-rule distillation, which leverages syntactic and semantic rules and teacher-student distributions to explicitly inject the domain knowledge into the decoding procedure during both the training and inference phases. We evaluate KNOD on three widely-used benchmarks. KNOD fixes 72 bugs on the Defects4J v1.2, 25 bugs on the QuixBugs, and 50 bugs on the additional Defects4J v2.0 benchmarks, outperforming all existing APR tools.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2302-01857,
  title = {KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repair},
  author = {Nan Jiang and Thibaud Lutellier and Yiling Lou and Lin Tan and Dan Goldwasser and Xiangyu Zhang},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00111}
}