Neural networks are well-known to be vulnerable to imperceptible perturbations in the input, called adversarial examples, that result in misclassification. Generating adversarial examples for source code poses an additional challenge compared to the domains of images and natural language, because source code perturbations must retain the functional meaning of the code. We identify a striking relationship between token frequency statistics and learned token embeddings: the L2 norm of learned token embeddings increases with the frequency of the token except for the highest-frequnecy tokens. We leverage this relationship to construct a simple and efficient gradient-free method for generating state-of-the-art adversarial examples on models of code. Our method empirically outperforms competing gradient-based methods with less information and less computational effort.


翻译:众所周知,神经网络很容易在投入(称为对抗性实例)中受到不可察觉的干扰,从而导致分类错误。源代码生成对抗性实例与图像和自然语言领域相比构成额外挑战,因为源代码扰动必须保留代码的功能含义。我们发现象征性频率统计与学习的代号嵌入之间有着惊人的关系:学习的代号嵌入的L2规范随着代号频率的增加而增加,除了最廉价的代号之外。我们利用这种关系来构建一种简单而有效的无梯度方法,以生成最先进的代号模式对抗性实例。我们的方法在经验上优于基于梯度的相互竞争方法,信息较少,计算努力较少。

0
下载
关闭预览

相关内容

【NAACL2021】长序列自然语言处理, 250页ppt
专知会员服务
61+阅读 · 2021年6月7日
专知会员服务
44+阅读 · 2020年10月31日
Python分布式计算,171页pdf,Distributed Computing with Python
专知会员服务
105+阅读 · 2020年5月3日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
已删除
将门创投
6+阅读 · 2018年12月3日
Adversarial Attacks on ML Defense Models Competition
Arxiv
1+阅读 · 2021年10月15日
Traceback of Data Poisoning Attacks in Neural Networks
Arxiv
0+阅读 · 2021年10月13日
Interpretable Adversarial Training for Text
Arxiv
5+阅读 · 2019年5月30日
Feature Denoising for Improving Adversarial Robustness
Arxiv
15+阅读 · 2018年12月9日
VIP会员
相关资讯
已删除
将门创投
6+阅读 · 2018年12月3日
Top
微信扫码咨询专知VIP会员