This survey, "A Survey of Adversarial Defences and Robustness in NLP," provides a comprehensive overview of the strategies used to protect Natural Language Processing (NLP) models from malicious, subtle input perturbations. The authors introduce a novel taxonomy to categorize these defenses, ranging from "vaccinating" models through adversarial training to providing mathematical guarantees of robustness via certification.
TL;DR
Deep neural networks in NLP are notoriously fragile, often failing when faced with tiny, human-imperceptible changes to input text. This paper surveys the landscape of adversarial defenses, categorizing them into training-based, perturbation-control, and certification-based methods to help researchers build more resilient and reliable language models.
What Problem Does This Paper Address?
While modern NLP models (like Transformers and RNNs) often achieve superhuman accuracy on standard benchmarks, they are surprisingly brittle. An attacker can cause a model to misclassify a sentiment or fail at translation by simply swapping a word for a synonym, changing a character, or adding a distracting sentence.
These "adversarial attacks" pose significant security risks in applications like spam detection, malware analysis, and automated content moderation. Furthermore, this fragility suggests that models are often "cheating" by picking up on superficial statistical cues rather than truly understanding language. The authors tackle the lack of a unified framework for understanding how to defend against these vulnerabilities.
Methods
The paper organizes the vast array of defense strategies into a clear taxonomy, as illustrated in Figure 1.
The three primary pillars of defense identified are:
- Adversarial Training: This is the most popular approach. It involves "vaccinating" the model by including adversarial examples in the training set. This can be done via:
- Data Augmentation: Generating perturbed versions of the training data (e.g., swapping words, using GANs to create "fake" but difficult inputs).
- Regularization: Adding an adversarial noise term directly into the loss function during training to encourage the model to be smooth and less sensitive to small input changes.
- Virtual Adversarial Training (VAT): A semi-supervised approach that doesn't require labeled data to define the "adversarial direction."
- Perturbation Control: These methods focus on detecting and fixing malicious inputs before they reach the classifier.
- Identification & Correction: Using tools like spell-checkers (e.g., ScRNN) or synonym-encoding methods (SEM) to map perturbed words back to a "clean" or canonical version.
- Direction Control: Restricting the space of possible perturbations during training to ensure they remain semantically meaningful and "interpretable."
- Robustness by Certification: The most rigorous category, these methods use mathematical techniques like Interval Bound Propagation (IBP) to provide a "certificate" of robustness. They calculate a theoretical upper bound on the model's loss, guaranteeing that the model's prediction won't change within a certain "radius" of the input.
Datasets
The survey highlights several key benchmarks used to evaluate these defenses:
- ANLI (Adversarial NLI): A large-scale dataset for Natural Language Inference collected via a human-and-model-in-the-loop process.
- PAWS (Paraphrase Adversaries from Word Scrambling): Focuses on models' sensitivity to word order and syntax.
- TCAB (Text Classification and Attack Benchmark): An extensive dataset containing 1.5 million attack instances across various domains.
- Adversarial SQuAD: A version of the popular Question Answering dataset that includes distracting, adversarially-inserted sentences.
Key Insights and Ideas
- Defense as Regularization: Adversarial training isn't just for security; it acts as a powerful regularization mechanism that helps prevent models from overfitting to noise in the training data.
- The Discrete Challenge: Defending NLP models is fundamentally harder than defending Computer Vision models. In images, you can add a tiny, continuous "epsilon" to pixel values. In text, changes are discrete (swapping "good" for "great"), making the optimization problem much thornier.
- Self-Attention vs. Recurrence: The survey notes that self-attentive models (like Transformers) generally exhibit more inherent robustness than traditional RNNs, likely due to their ability to capture global context more effectively.
- Human-in-the-Loop (HITL): Despite advances in automated attacks, human-authored adversarial examples remain some of the most effective for training truly robust models, as they better capture the nuances of "natural" language.
Key Results
The paper serves as a qualitative summary rather than a leaderboard, but it highlights several critical findings:
- Certified Robustness provides the strongest guarantees but currently suffers from poor scalability, often limited to smaller networks or specific tasks like sentiment analysis.
- Adversarial Training significantly reduces the Attack Success Rate (ASR) but can sometimes lead to a slight drop in accuracy on "clean" data—a trade-off known as the robustness-accuracy gap.
- Detection-based methods (like spell-checkers) are highly effective against character-level attacks but struggle against sophisticated word-level synonym swaps.
Limitations and Future Work
The authors identify several "open frontiers" for the community:
- Scalability: Most current certification methods do not scale to massive Large Language Models (LLMs).
- Generalization: Many defenses are "attack-specific." There is a dire need for attack-agnostic defenses that can handle novel, unseen types of perturbations.
- Natural Language Generation (NLG): Most research focuses on classification (NLU). Robustness in generative tasks (like summarization or dialogue) remains under-explored.
- Explainability: We need a better understanding of why certain perturbations break models and how defenses actually fix the underlying logic.
Summary updated