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

基于可攻击子字替换的Transformers攻击者级白盒对抗攻击

Character-level White-Box Adversarial Attacks against Transformers via Attachable Subwords Substitution

Tsinghua University(清华大学)

Aiwei Liu, Honghai Yu, Xuming Hu, Shu'ang Li, Li Lin, Fukun Ma, Yawen Yang, Lijie Wen

摘要:

提出了第一种针对Transformer模型的字符级白盒对抗攻击方法。我们的方法的直观性来自于观察,即单词在被馈送到Transformer模型之前被分成子令牌,并且两个接近的子令牌之间的替换具有与字符修改类似的效果。我们的方法主要包括三个步骤。首先,采用基于梯度的方法找到句子中最脆弱的词。然后,我们将所选单词拆分为子标记,以替换来自Transformer标记器的原始标记化结果。最后,我们利用对抗性损失来指导可附加子令牌的替换,其中引入了Gumbel-softmax技巧来确保梯度传播。同时,我们在优化过程中引入了视觉和长度约束,以达到最小的字符修改。大量的实验表明,该方法在成功率和编辑距离方面优于以前的攻击方法。此外,人类评估验证了我们的对抗性示例可以保留其原始标签。

英文摘要:

We propose the first character-level white-box adversarial attack method against transformer models. The intuition of our method comes from the observation that words are split into subtokens before being fed into the transformer models and the substitution between two close subtokens has a similar effect to the character modification. Our method mainly contains three steps. First, a gradient-based method is adopted to find the most vulnerable words in the sentence. Then we split the selected words into subtokens to replace the origin tokenization result from the transformer tokenizer. Finally, we utilize an adversarial loss to guide the substitution of attachable subtokens in which the Gumbel-softmax trick is introduced to ensure gradient propagation. Meanwhile, we introduce the visual and length constraint in the optimization process to achieve minimum character modifications. Extensive experiments on both sentence-level and token-level tasks demonstrate that our method could outperform the previous attack methods in terms of success rate and edit distance. Furthermore, human evaluation verifies our adversarial examples could preserve their origin labels.

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

↑