Detecting Textual Adversarial Examples Based on Distributional Characteristics of Data Representations

Na Liu, Mark Dras, Wei Emma Zhang


Abstract
Although deep neural networks have achieved state-of-the-art performance in various machine learning tasks, adversarial examples, constructed by adding small non-random perturbations to correctly classified inputs, successfully fool highly expressive deep classifiers into incorrect predictions. Approaches to adversarial attacks in natural language tasks have boomed in the last five years using character-level, word-level, phrase-level, or sentence-level textual perturbations. While there is some work in NLP on defending against such attacks through proactive methods, like adversarial training, there is to our knowledge no effective general reactive approaches to defence via detection of textual adversarial examples such as is found in the image processing literature. In this paper, we propose two new reactive methods for NLP to fill this gap, which unlike the few limited application baselines from NLP are based entirely on distribution characteristics of learned representations”:” we adapt one from the image processing literature (Local Intrinsic Dimensionality (LID)), and propose a novel one (MultiDistance Representation Ensemble Method (MDRE)). Adapted LID and MDRE obtain state-of-the-art results on character-level, word-level, and phrase-level attacks on the IMDB dataset as well as on the later two with respect to the MultiNLI dataset. For future research, we publish our code .
Anthology ID:
2022.repl4nlp-1.9
Volume:
Proceedings of the 7th Workshop on Representation Learning for NLP
Month:
May
Year:
2022
Address:
Dublin, Ireland
Editors:
Spandana Gella, He He, Bodhisattwa Prasad Majumder, Burcu Can, Eleonora Giunchiglia, Samuel Cahyawijaya, Sewon Min, Maximilian Mozes, Xiang Lorraine Li, Isabelle Augenstein, Anna Rogers, Kyunghyun Cho, Edward Grefenstette, Laura Rimell, Chris Dyer
Venue:
RepL4NLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
78–90
Language:
URL:
https://aclanthology.org/2022.repl4nlp-1.9
DOI:
10.18653/v1/2022.repl4nlp-1.9
Bibkey:
Cite (ACL):
Na Liu, Mark Dras, and Wei Emma Zhang. 2022. Detecting Textual Adversarial Examples Based on Distributional Characteristics of Data Representations. In Proceedings of the 7th Workshop on Representation Learning for NLP, pages 78–90, Dublin, Ireland. Association for Computational Linguistics.
Cite (Informal):
Detecting Textual Adversarial Examples Based on Distributional Characteristics of Data Representations (Liu et al., RepL4NLP 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.repl4nlp-1.9.pdf
Video:
 https://aclanthology.org/2022.repl4nlp-1.9.mp4
Code
 naliuanna/mdre
Data
IMDb Movie ReviewsMultiNLIWikiText-103WikiText-2