一句话:提出针对代码模型的语义保持程序变换离散对抗攻击,并给出对抗训练的理论基础与实现以提升鲁棒性。
本文研究代码模型特有的离散对抗样本:通过保持程序语义的程序变换生成对抗输入,使模型预测错误。作者提出一种通用且高效的攻击方法,可作用于多种代码模型;并从防御角度建立理论基础,说明对抗训练可用于防御离散对抗攻击。基于该理论,作者实现了一个简单的对抗训练方案。实验广泛评估攻击与防御,结果表明离散攻击在有无防御机制时均显著优于现有方法,而该对抗训练实现使所有评估模型在面对现有攻击及本文攻击时鲁棒性提升幅度最大。
The pervasive brittleness of deep neural networks has attracted significant attention in recent years. A particularly interesting finding is the existence of adversarial examples, imperceptibly perturbed natural inputs that induce erroneous predictions in state-of-the-art neural models. In this paper, we study a different type of adversarial examples specific to code models, called discrete adversarial examples , which are created through program transformations that preserve the semantics of original inputs.In particular, we propose a novel, general method that is highly effective in attacking a broad range of code models. From the defense perspective, our primary contribution is a theoretical foundation for the application of adversarial training — the most successful algorithm for training robust classifiers — to defending code models against discrete adversarial attack. Motivated by the theoretical results, we present a simple realization of adversarial training that substantially improves the robustness of code models against adversarial attacks in practice. We extensively evaluate both our attack and defense methods. Results show that our discrete attack is significantly more effective than state-of-the-art whether or not defense mechanisms are in place to aid models in resisting attacks. In addition, our realization of adversarial training improves the robustness of all evaluated models by the widest margin against state-of-the-art adversarial attacks as well as our own.