EMNLP 2022main33 citations

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

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

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 with 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.

BibTeX
@inproceedings{liu-etal-2022-character,
    title = "Character-level White-Box Adversarial Attacks against Transformers via Attachable Subwords Substitution",
    author = "Liu, Aiwei  and
      Yu, Honghai  and
      Hu, Xuming  and
      Li, Shu{'}ang  and
      Lin, Li  and
      Ma, Fukun  and
      Yang, Yawen  and
      Wen, Lijie",
    editor = "Goldberg, Yoav  and
      Kozareva, Zornitsa  and
      Zhang, Yue",
    booktitle = "Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing",
    month = dec,
    year = "2022",
    address = "Abu Dhabi, United Arab Emirates",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.emnlp-main.522/",
    doi = "10.18653/v1/2022.emnlp-main.522",
    pages = "7664--7676"
}
Character-level White-Box Adversarial Attacks against Transformers via Attachable Subwords Substitution · EMNLP 2022