Adversarial Robustness of Deep Code Comment Generation

Adversarial Robustness of Deep Code Comment Generation
复制标题

深度代码注释生成的对抗鲁棒性

DOI:
10.1145/3501256
复制
发表时间:
2021-07
期刊:
ACM Trans. Softw. Eng. Methodol.
影响因子:
--
通讯作者:
Harald C. Gall
Harald C. Gall
中科院分区:
其他
文献类型:
--
作者:
Yu Zhou;Xiaoqing Zhang;Juanjuan Shen;Tingting Han;Taolue Chen;Harald C. Gall

文献摘要

参考文献

相似文献

深度神经网络(DNN)在计算机视觉、语音识别和自然语言处理等多个领域都表现出了卓越的性能。最近,它们也被应用于各种软件工程任务,通常涉及处理源代码。众所周知,DNN容易受到对抗性示例的攻击,即,这些输入可能导致DNN模型的各种错误行为,同时被人类视为良性。在本文中,我们专注于软件工程中的代码注释生成任务,并研究了DNN应用于此任务时的鲁棒性问题。我们提出了ACCENT(对抗性代码注释gENeraTor),这是一种标识符替换方法,用于制作对抗性代码片段,这些代码片段在语法上正确,在语义上接近原始代码片段,但可能会误导DNN产生完全不相关的代码注释。为了提高鲁棒性,ACCENT还引入了一种新的训练方法,该方法可以应用于现有的代码注释生成模型。我们进行了全面的实验,以评估我们的方法攻击主流的编码器-解码器架构上的两个大规模的公开可用的数据集。实验结果表明,ACCENT算法能够有效地生成稳定的攻击,并具有较好的可移植性。我们还通过实验证实了我们的训练方法在提高模型鲁棒性方面的有效性。
Deep neural networks (DNNs) have shown remarkable performance in a variety of domains such as computer vision, speech recognition, and natural language processing. Recently they also have been applied to various software engineering tasks, typically involving processing source code. DNNs are well-known to be vulnerable to adversarial examples, i.e., fabricated inputs that could lead to various misbehaviors of the DNN model while being perceived as benign by humans. In this paper, we focus on the code comment generation task in software engineering and study the robustness issue of the DNNs when they are applied to this task. We propose ACCENT(Adversarial Code Comment gENeraTor), an identifier substitution approach to craft adversarial code snippets, which are syntactically correct and semantically close to the original code snippet, but may mislead the DNNs to produce completely irrelevant code comments. In order to improve the robustness, ACCENT also incorporates a novel training method, which can be applied to existing code comment generation models. We conduct comprehensive experiments to evaluate our approach by attacking the mainstream encoder-decoder architectures on two large-scale publicly available datasets. The results show that ACCENT efficiently produces stable attacks with functionality-preserving adversarial examples, and the generated examples have better transferability compared with the baselines. We also confirm, via experiments, the effectiveness in improving model robustness with our training method.
基于神经网络的上下文信息增强 Java 方法注释生成
DOI: 10.1016/j.jss.2019.07.087
发表时间: 2019-07
影响因子: 3.5
作者:
Zhou Yu;Yan Xin;Yang Wenhua;Chen Taolue;Huang Zhiqiu
通讯作者: Huang Zhiqiu
DOI: 10.18653/v1/p16-2
发表时间: 2016
期刊: --
影响因子: --
作者:
K. Erk;Noah A. Smith
通讯作者: K. Erk;Noah A. Smith
DOI: 10.18653/v1/p18-2006
发表时间: 2017-12
期刊: --
影响因子: --
作者:
J. Ebrahimi;Anyi Rao;Daniel Lowd;D. Dou
通讯作者: J. Ebrahimi;Anyi Rao;Daniel Lowd;D. Dou
DOI: 10.18653/v1/p19-1103
发表时间: 2019-07
期刊: --
影响因子: --
作者:
Shuhuai Ren;Yihe Deng;Kun He;Wanxiang Che
通讯作者: Shuhuai Ren;Yihe Deng;Kun He;Wanxiang Che
DOI: 10.1609/aaai.v34i01.5469
发表时间: 2020-04
期刊: --
影响因子: --
作者:
Huangzhao Zhang;Zhuo Li;Ge Li;L. Ma;Yang Liu;Zhi Jin
通讯作者: Huangzhao Zhang;Zhuo Li;Ge Li;L. Ma;Yang Liu;Zhi Jin