paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AutoFocus: Interpreting Attention-Based Neural Networks by Code Perturbation

AutoFocus:通过代码扰动解释基于注意力的神经网络
ASE 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)2019匹配度 2/10 · 论文研究如何用代码扰动解释注意力神经网络在算法分类上的行为,属于代码模型可解释性,并未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心方向。引用 29 inbox
Nghi D. Q. Bui, Yijun Yu, Lingxiao Jiang
crossref: 2026-09-12

AI 速览

一句话:提出 AutoFocus,通过扰动代码元素量化其对注意力网络输出的影响,并利用注意力分数解释算法分类。

深度神经网络在软件工程中多被视为黑箱,难以解释输入如何影响输出。本文提出 AutoFocus,一种基于代码扰动的自动化方法,用于评估并可视化输入元素对网络输出的重要性。其假设是注意力机制产生的判别性分数能反映输入元素的影响,并在算法分类任务(给定源代码判断实现的算法)上验证。AutoFocus 系统性地识别和扰动代码元素,量化扰动对分类结果的影响。在 10 种排序算法、超过 1000 个程序上评估,发现注意力分数与扰动效应高度相关。这表明注意力分数可用于解释代码元素与分类结果的关系,按注意力排序可视化代码元素有助于以更少代码辅助程序理解。

问题
深度神经网络在软件工程任务中多被视为黑箱,难以解释其如何从输入推断输出,尤其缺乏对代码元素影响注意力网络分类结果的可解释性。
方法
提出 AutoFocus,系统性地识别并扰动程序代码元素,量化扰动对网络输出的影响;同时利用注意力分数对输入元素重要性进行排序和可视化,以验证注意力分数与扰动效应之间的关系。
评估
在算法分类任务上,使用 10 种排序算法、超过 1000 个程序进行评估,发现注意力分数与代码元素扰动效应高度相关,表明注意力分数可用于解释分类结果。
原文摘要(Abstract)

Despite being adopted in software engineering tasks, deep neural networks are treated mostly as a black box due to the difficulty in interpreting how the networks infer the outputs from the inputs. To address this problem, we propose AutoFocus, an automated approach for rating and visualizing the importance of input elements based on their effects on the outputs of the networks. The approach is built on our hypotheses that (1) attention mechanisms incorporated into neural networks can generate discriminative scores for various input elements and (2) the discriminative scores reflect the effects of input elements on the outputs of the networks. This paper verifies the hypotheses by applying AutoFocus on the task of algorithm classification (i.e., given a program source code as input, determine the algorithm implemented by the program). AutoFocus identifies and perturbs code elements in a program systematically, and quantifies the effects of the perturbed elements on the network's classification results. Based on evaluation on more than 1000 programs for 10 different sorting algorithms, we observe that the attention scores are highly correlated to the effects of the perturbed code elements. Such a correlation provides a strong basis for the uses of attention scores to interpret the relations between code elements and the algorithm classification results of a neural network, and we believe that visualizing code elements in an input program ranked according to their attention scores can facilitate faster program comprehension with reduced code.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot5220,
  title = {AutoFocus: Interpreting Attention-Based Neural Networks by Code Perturbation},
  author = {Nghi D. Q. Bui and Yijun Yu and Lingxiao Jiang},
  booktitle = {ASE},
  year = {2019},
  doi = {10.1109/ase.2019.00014}
}