arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2104.08139cs.CL
收藏

变长文本对抗攻击

Towards Variable-Length Textual Adversarial Attacks

University of Science and Technology of China(中国科学技术大学);Alibaba DAMO Academy(阿里巴巴达摩院);Zhejiang University(浙江大学)

Junliang Guo, Zhirui Zhang, Linlin Zhang, Linli Xu, Boxing Chen, Enhong Chen, Weihua Luo

摘要:

对抗攻击已经显示出机器学习模型的脆弱性,然而,由于数据的离散性,对自然语言处理任务进行文本对抗攻击是不平凡的。大多数以前的方法使用原子\textit{replacement}操作进行攻击,这通常会导致固定长度的对抗性示例,因此限制了对决策空间的探索。本文提出了变长文本对抗攻击(VL-Attack),并通过在攻击过程中引入和操作一个特殊的\textit{blank}令牌,将\textit{insertion}、\textit{deletion}和\textit{replacement}三种原子操作整合到一个统一的框架中。通过这种方式,我们的方法能够更全面地找到决策边界周围的对抗性示例,并有效地进行对抗攻击。具体来说,我们的方法在攻击预训练的BERT模型的同时,只编辑$1.3\%$令牌,从而降低了$96\%$对IMDB分类的准确性。此外,使用生成的对抗样本微调受害者模型可以提高模型的鲁棒性,而不会损害性能,特别是对于长度敏感的模型。在非自回归机器翻译任务上,我们的方法在IWSLT 14德英翻译上可以达到$33.18$ BLEU评分,实现了$1.47$在基线模型上的改进。

英文摘要:

Adversarial attacks have shown the vulnerability of machine learning models, however, it is non-trivial to conduct textual adversarial attacks on natural language processing tasks due to the discreteness of data. Most previous approaches conduct attacks with the atomic \textit{replacement} operation, which usually leads to fixed-length adversarial examples and therefore limits the exploration on the decision space. In this paper, we propose variable-length textual adversarial attacks~(VL-Attack) and integrate three atomic operations, namely \textit{insertion}, \textit{deletion} and \textit{replacement}, into a unified framework, by introducing and manipulating a special \textit{blank} token while attacking. In this way, our approach is able to more comprehensively find adversarial examples around the decision boundary and effectively conduct adversarial attacks. Specifically, our method drops the accuracy of IMDB classification by $96\%$ with only editing $1.3\%$ tokens while attacking a pre-trained BERT model. In addition, fine-tuning the victim model with generated adversarial samples can improve the robustness of the model without hurting the performance, especially for length-sensitive models. On the task of non-autoregressive machine translation, our method can achieve $33.18$ BLEU score on IWSLT14 German-English translation, achieving an improvement of $1.47$ over the baseline model.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑