EMNLP 2022main19 citations

Textual Manifold-based Defense Against Natural Language Adversarial Examples

Dang Nguyen Minh, Anh Tuan Luu

Abstract

Despite the recent success of large pretrained language models in NLP, they are susceptible to adversarial examples. Concurrently, several studies on adversarial images have observed an intriguing property: the adversarial images tend to leave the low-dimensional natural data manifold. In this study, we find a similar phenomenon occurs in the contextualized embedding space of natural sentences induced by pretrained language models in which textual adversarial examples tend to have their embeddings diverge off the manifold of natural sentence embeddings. Based on this finding, we propose Textual Manifold-based Defense (TMD), a defense mechanism that learns the embedding space manifold of the underlying language model and projects novel inputs back to the approximated structure before classification. Through extensive experiments, we find that our method consistently and significantly outperforms previous defenses under various attack settings while remaining unaffected to the clean accuracy. To the best of our knowledge, this is the first kind of manifold-based defense adapted to the NLP domain.

BibTeX
@inproceedings{nguyen-minh-luu-2022-textual,
    title = "Textual Manifold-based Defense Against Natural Language Adversarial Examples",
    author = "Nguyen Minh, Dang  and
      Luu, Anh Tuan",
    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.443/",
    doi = "10.18653/v1/2022.emnlp-main.443",
    pages = "6612--6625"
}
Textual Manifold-based Defense Against Natural Language Adversarial Examples · EMNLP 2022