TL;DR
This paper provides the first comprehensive survey of how researchers "fool" NLP models using adversarial examples—strategically modified inputs that cause deep neural networks (DNNs) to fail while remaining plausible to humans. It categorizes the unique challenges of attacking discrete text data (versus continuous image data) and summarizes the state-of-the-art in attack strategies, evaluation metrics, and defense mechanisms.
What Problem Does This Paper Address?
Deep Neural Networks have revolutionized AI, but they are notoriously fragile "black boxes." In computer vision, researchers have long known that changing a few pixels in an image—invisible to a human—can make a model see a "gibbon" as a "panda."
However, applying these attacks to Natural Language Processing (NLP) is significantly harder for three reasons:
- Discreteness: You can't slightly adjust a word's "value" like you can a pixel's brightness. Changing a character or word is a discrete jump.
- Perceivability: Humans are highly sensitive to typos or grammatical errors. An adversarial attack that turns a sentence into gibberish is a failure.
- Semantics: In images, small noise rarely changes the meaning. In text, adding a single "not" completely flips the sentiment, which violates the goal of an adversarial example (fooling the model while keeping the "true" label the same for a human).
The authors tackle the gap between image-based and text-based adversarial research, providing a roadmap for how to manipulate discrete linguistic data.
Methods
The authors propose a multi-dimensional taxonomy to organize the field:
- Model Access:
- White-box: The attacker has full access to the model's architecture, weights, and gradients (e.g., FGSM, HotFlip).
- Black-box: The attacker can only query the model and see the output (e.g., DeepWordBug, SCPNs).
- Granularity: Attacks happen at the character level (swapping letters), word level (replacing synonyms), or sentence level (adding distracting paragraphs).
- Novel Techniques:
- Gradient-based methods: Adapting image attacks by looking at which input dimensions the model is most sensitive to.
- Directional Derivatives: Using "atomic flips" (swap, insert, delete) to see which change increases the model's loss the most.
- Concatenation Adversaries: Adding distracting but irrelevant sentences to the end of a paragraph to confuse reading comprehension models.
- Generative Models: Using GANs to create "natural-looking" adversarial text.
Datasets
The survey catalogs a vast array of benchmark datasets used across the reviewed literature:
- Text Classification/Sentiment: IMDB, Rotten Tomatoes, SST, AG’s News, DBpedia.
- Reading Comprehension: SQuAD (Stanford Question Answering Dataset).
- Natural Language Inference (NLI): SNLI, MultiNLI.
- Machine Translation: WMT datasets, TED Talks.
- Malware Detection: DREBIN, Microsoft Kaggle.
- Cross-modal: MSCOCO (Image Captioning), VQA datasets.
Key Insights and Ideas
- The "Hot" Concept: Many white-box attacks identify "Hot Characters" or "Hot Training Phrases"—specific parts of the input that have the highest gradient magnitude, meaning the model relies on them heavily (and thus they are the best targets for perturbation).
- Semantic Preservation is the Holy Grail: The most effective attacks use WordNet or word embeddings (like Word2Vec) to ensure that when a word is replaced, the new word is a synonym that doesn't alert a human reader.
- Transferability: Adversarial examples are often "universal." An attack crafted to fool one specific LSTM model often works against a CNN or a different RNN architecture trained on the same data.
- Defense is Hard: The paper notes that while Adversarial Training (including adversarial examples in the training set) helps, it often makes the model vulnerable to new types of attacks it hasn't seen yet.
Key Results
- Reading Comprehension Vulnerability: The pioneer work by Jia and Liang (2017) showed that adding a single distracting sentence to a SQuAD paragraph could drop a model's F1 accuracy from 75% to a staggering 7%.
- Efficiency of Atomic Flips: Methods like HotFlip showed that flipping just a few characters based on directional derivatives could achieve high success rates in text classification with minimal changes.
- Defense Comparison: The authors highlight that Adversarial Training generally outperforms Distillation (using a smaller model to mimic a larger one) as a defense mechanism against these specific textual attacks.
Limitations and Future Work
- The Gibberish Problem: Many current attacks still produce text that looks like "word salad" or is full of obvious typos. Future work needs to focus on fluency and grammaticality.
- Automation: Many early attacks required manual intervention or human-in-the-loop selection. The field needs fully automated, end-to-end attack pipelines.
- New Architectures: At the time of writing, newer architectures like GANs and Differentiable Neural Computers (DNCs) had rarely been tested for robustness.
- Real-world Constraints: Most attacks are "iterative" and slow. For real-time applications (like attacking a live spam filter), "one-off" attacks that work in a single pass are necessary but currently less effective.
Survey Reference: Zhang, W. E., Sheng, Q. Z., Alhazmi, A., & Li, C. (2019). Adversarial Attacks on Deep Learning Models in Natural Language Processing: A Survey. arXiv:1901.06796v3.
Summary updated