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

Yotam Gil, Yoav Chai, Or Gorodissky, Jonathan Berant

TL;DR

Researchers have developed DISTFLIP, a method that "distills" expensive white-box adversarial attacks into a fast neural network. By training a model to imitate the character-flipping behavior of gradient-based attacks, they achieved a 19x–39x speedup and successfully fooled the Google Perspective API in 42% of test cases—all while ensuring the text remains clearly toxic to human readers.

What Problem Does This Paper Address?

Adversarial attacks—small, intentional perturbations designed to fool machine learning models—are well-studied in computer vision but remain challenging in Natural Language Processing (NLP). Unlike images, where you can subtly tweak pixel values, text is discrete; you cannot change a character by a fractional value.

Existing NLP attacks usually fall into two categories:

  1. White-box attacks: These require full access to the model’s internal gradients. They are effective but computationally expensive and unrealistic for attacking proprietary systems.
  2. Black-box attacks: These only see the model's output. They are more realistic but often rely on slow, "blind" heuristics or massive amounts of queries.

The authors address the efficiency gap: Can we take the "knowledge" of a powerful white-box attack and pack it into a lightweight model that can perform black-box attacks instantly?

The DISTFLIP pipeline: (A) Distilling white-box knowledge into a student model, and (B) applying that model to a black-box target.

Methods

The authors propose a three-step "distillation" pipeline:

  1. Source Model Training: They train a standard "source" text classifier (a BiGRU with attention) on a toxicity dataset.
  2. Data Generation (The "Teacher"): They use HOTFLIP, an existing white-box attack that uses gradients to find the best character to flip (e.g., changing "asshole" to "assnole"). They run this expensive optimization on thousands of sentences to see exactly which flips successfully fool the source model.
  3. Distillation (The "Student"): They train a new model, DISTFLIP, to predict the "teacher's" moves. DISTFLIP is a BiLSTM that takes a sentence and outputs two things: which character position to target and what the replacement character should be.

Because DISTFLIP only requires a single forward pass to suggest an attack, it bypasses the iterative gradient calculations that make white-box attacks slow.

Datasets

  • Wikipedia Toxic Comments: A dataset of 160,000 comments released by Alphabet/Jigsaw. The authors focused on the "Toxic" label (about 9.5% of the data).
  • Google Perspective API: Used as the ultimate "black-box" target for evaluation to see if attacks generated by DISTFLIP would transfer to a real-world, production-grade system.

Key Insights and Ideas

  • Optimization as a Learning Task: The core breakthrough is treating the adversarial search process not as a math problem to be solved every time, but as a pattern to be learned. If a white-box attack consistently targets certain character combinations, a neural network can learn that pattern.
  • The Power of Transferability: The method relies on the observation that adversarial examples are often "universal" — if a flip fools Model A, there is a high statistical likelihood it will fool Model B, even if Model B's architecture is unknown.
  • Efficiency vs. Quality: By moving the heavy lifting to the training phase, the researchers show you don't have to sacrifice attack quality for speed. Their "distilled" model performed nearly as well as the most computationally expensive version of the white-box attack.

Key Results

  • Massive Speedup: DISTFLIP generated attacks 19x to 39x faster than the original HOTFLIP optimization.
  • Black-Box Success: When attacking the Google Perspective API, DISTFLIP flipped the classification from "toxic" to "non-toxic" or "uncertain" in 42% of cases.
  • Human-Imperceptible (Semantically): In human validation tests, 87.6% of the attacked sentences were still identified as toxic by people, compared to 89.8% for the originals. This proves the attack breaks the AI without losing the meaning of the message.
Examples of original toxic comments and the adversarial versions generated by DISTFLIP that successfully lowered Google Perspective API scores.

Limitations and Future Work

  • Character-Level Focus: The study is limited to character flips. While effective against toxicity filters, more sophisticated models might require word-level substitutions or paraphrasing to be fooled.
  • Transferability Ceiling: The 42% success rate against Google's API is impressive for a black-box attack, but it also shows that transferability isn't perfect. Success depends heavily on how similar the "source" model is to the "target."
  • Defense Mechanisms: The authors suggest that this efficient attack generation could be used for adversarial training (feeding these examples back into models to make them tougher), though they did not evaluate the defensive side in this specific paper.

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