English

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

Computation and Language 2022-11-01 v1

Abstract

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.

Keywords

Cite

@article{arxiv.2210.17004,
  title  = {Character-level White-Box Adversarial Attacks against Transformers via Attachable Subwords Substitution},
  author = {Aiwei Liu and Honghai Yu and Xuming Hu and Shu'ang Li and Li Lin and Fukun Ma and Yawen Yang and Lijie Wen},
  journal= {arXiv preprint arXiv:2210.17004},
  year   = {2022}
}

Comments

13 pages, 3 figures. EMNLP 2022