Abstract
Yotam Gil, Yoav Chai, Or Gorodissky, Jonathan Berant. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers).
2019.
Introduction
Adversarial attacks—small, intentional perturbations to input data that cause machine learning models to fail—are essential for evaluating model robustness. In Natural Language Processing (NLP), these attacks typically fall into two categories: white-box attacks, which are effective but computationally expensive and require internal model access, and black-box attacks, which are more realistic for proprietary systems but often rely on less effective heuristics.
Researchers have developed DISTFLIP, a fast neural network that "distills" the knowledge of complex white-box attacks into a black-box attacker. By training a model to mimic optimization-based attacks, they created a system that is 19x to 39x faster and successfully fools real-world systems like the Google Perspective API.
Methods: The White-to-Black Framework
The authors propose a "White-to-Black" distillation framework consisting of three main stages:
- Data Generation: A source toxicity classifier is subjected to a white-box attack (HotFlip). HotFlip uses gradients to identify character flips (e.g., changing "asshole" to "assnole") that maximize model loss. Thousands of these "before and after" pairs are recorded.
- Distillation: A new network, DISTFLIP, is trained to predict these moves. Given a sentence, it identifies which character to flip and what to replace it with.
- Architecture: DISTFLIP utilizes a bidirectional LSTM (BiLSTM) to process text. It features two prediction heads: one for character position and another for the replacement character.
Because DISTFLIP is a feed-forward network, it avoids expensive gradient calculations or beam searches during the attack phase, enabling rapid generation of adversarial examples.
Experimental Setup
The study focuses on toxicity detection using two primary datasets:
- Wikipedia Toxic Comments: 160,000 comments from Wikipedia talk pages.
- Google Perspective API: A production-grade black-box API used to evaluate the real-world effectiveness of the distilled attacks.
Results and Insights
The core innovation lies in treating optimization as a learning task. A neural network can learn the implicit patterns of an iterative optimizer, effectively discovering a "policy" for model vulnerabilities. Key findings include:
- Efficiency: DISTFLIP generated adversarial examples 19x to 39x faster than the original HotFlip method.
- Black-Box Success: Against the Google Perspective API, DISTFLIP successfully flipped labels (e.g., from "toxic" to "non-toxic") in 42% of cases.
- Human Robustness: Human annotators identified adversarial sentences as toxic 87.6% of the time (vs. 89.8% for originals), proving the attacks fool machines while remaining intelligible to people.
Discussion
While effective, the current implementation is limited to character-level flips and does not account for insertions, deletions, or word-level changes. Furthermore, its success relies on adversarial transferability—the assumption that the source and target models share similar vulnerabilities. Future work may involve using these efficient attacks for "adversarial training" to improve model robustness against such exploits.
Summary updated