Abstract
Deep neural networks (DNNs) are vulnerable to adversarial examples, perturbations to correctly classified examples which can cause the model to misclassify. In the image domain, these perturbations are often virtually indistinguishable to human perception, causing humans and state-of-the-art models to disagree. However, in the natural language domain, small perturbations are clearly perceptible, and the replacement of a single word can drastically alter the semantics of the document. Given these challenges, we use a black-box population-based optimization algorithm to generate semantically and syntactically similar adversarial examples that fool well-trained sentiment analysis and textual entailment models with success rates of 97% and 70%, respectively. We additionally demonstrate that 92.3% of the successful sentiment analysis adversarial examples are classified to their original label by 20 human annotators, and that the examples are perceptibly quite similar. Finally, we discuss an attempt to use adversarial training as a defense, but fail to yield improvement, demonstrating the strength and diversity of our adversarial examples. We hope our findings encourage researchers to pursue improving the robustness of DNNs in the natural language domain.
Introduction
In computer vision, adversarial attacks are well-documented: subtle pixel changes can lead an AI to misidentify a stop sign as a speed limit sign while remaining invisible to humans. In Natural Language Processing (NLP), however, the discrete nature of language makes such attacks significantly more difficult. Replacing a single word can easily break grammatical structure or fundamentally change a sentence's meaning, leading to "word salad" that is obvious to human readers. This research addresses the challenge of creating adversarial text that is both effective at fooling models and imperceptible to humans by maintaining semantic and syntactic coherence.
Methods: A Genetic Algorithm for Textual Perturbation
The authors propose a black-box population-based optimization algorithm. Unlike white-box attacks, this method requires no knowledge of the model's internal architecture or gradients, relying solely on output prediction scores.
The core of the approach is the Perturb Subroutine, which follows three main steps:
- Synonym Selection: Using GloVe embeddings with a "counter-fitting" method, the algorithm identifies true synonyms (e.g., "excellent" for "great") rather than just related words.
- Contextual Filtering: Proposed synonyms are checked against the Google 1 Billion Words language model to ensure they fit the surrounding context naturally and grammatically.
- Evolutionary Optimization: The algorithm maintains a population of modified sentences, applying crossover and mutation over several generations to find the most effective adversarial example.
Experimental Setup
The attack was evaluated on two standard benchmarks:
- IMDB: 50,000 movie reviews for sentiment analysis (positive vs. negative).
- Stanford Natural Language Inference (SNLI): A dataset for textual entailment (determining if a "premise" sentence entails, contradicts, or is neutral toward a "hypothesis").
Key Results
The genetic algorithm proved highly effective across both tasks. For sentiment analysis on the IMDB dataset, the attack achieved a 97% success rate, requiring modifications to only 14.7% of the words on average. For the SNLI textual entailment task, the success rate was 70%.
Human validation confirmed the "imperceptibility" of these attacks. In a study with 20 annotators, 92.3% of the adversarial sentiment examples were still correctly classified by humans according to their original labels. On a similarity scale of 1 (very similar) to 4 (very different), humans rated the adversarial pairs at 2.23, indicating the changes were perceived as minor.
Discussion and Conclusion
The success of this black-box attack highlights a fundamental brittleness in how deep neural networks process language. Interestingly, the authors found that "adversarial training"—incorporating these examples back into the training set—failed to improve model robustness. This suggests that the space of possible linguistic perturbations is too vast for simple data augmentation to solve.
The lower success rate on the SNLI dataset (70% vs 97%) is likely due to the shorter average length of SNLI hypotheses (averaging 9 words), which offers fewer opportunities for word substitution without altering the core logic. Future research must focus on building models that are inherently robust to synonym substitution, perhaps by integrating structured linguistic knowledge to move beyond the limitations of standard word embeddings.
Summary updated