White-to-Black: Efficient Distillation of Black-Box Adversarial Attacks

Yotam Gil, Yoav Chai, Or Gorodissky, Jonathan Berant

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:

  1. 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.
  2. 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.
  3. 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.
The White-to-Black framework: (A) Training DISTFLIP to mimic a white-box attack, and (B) using it to attack a black-box model.

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.
Examples of adversarial perturbations generated by DISTFLIP and their impact on Google Perspective API scores.

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

BibTeX
@inproceedings{gil2019white,
  author = {Yotam Gil and Yoav Chai and Or Gorodissky and Jonathan Berant},
  title = {{White-to-Black: Efficient Distillation of Black-Box Adversarial Attacks}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  url = {https://openreview.net/forum?id=BkNM-XZubH},
}
Figure