[Paper Review] White-to-Black: Efficient Distillation of Black-Box Adversarial Attacks
This paper proposes DistFlip, a neural network that distills the behavior of a white-box adversarial attack (HotFlip) to generate adversarial examples for text classification models up to 39x faster. By training on input-output pairs from gradient-based attacks, DistFlip achieves comparable attack success rates while enabling efficient black-box attacks, successfully flipping 42% of toxic labels in Google Perspective API with human-verified toxicity preserved.
Adversarial examples are important for understanding the behavior of neural models, and can improve their robustness through adversarial training. Recent work in natural language processing generated adversarial examples by assuming white-box access to the attacked model, and optimizing the input directly against it (Ebrahimi et al., 2018). In this work, we show that the knowledge implicit in the optimization procedure can be distilled into another more efficient neural network. We train a model to emulate the behavior of a white-box attack and show that it generalizes well across examples. Moreover, it reduces adversarial example generation time by 19x-39x. We also show that our approach transfers to a black-box setting, by attacking The Google Perspective API and exposing its vulnerability. Our attack flips the API-predicted label in 42\% of the generated examples, while humans maintain high-accuracy in predicting the gold label.
Motivation & Objective
- To develop a faster, more efficient method for generating adversarial examples in NLP by distilling knowledge from white-box attacks.
- To enable effective black-box attacks by transferring the distilled model’s behavior to systems without gradient access.
- To maintain high attack quality while drastically reducing generation time compared to iterative optimization-based methods.
- To validate that adversarial examples remain semantically toxic even after perturbation, ensuring realistic threat modeling.
Proposed method
- Train a neural network (DistFlip) to emulate the input-output behavior of a white-box attack (HotFlip) using labeled examples of input sentences and their adversarial counterparts.
- Use supervised learning on pairs of original and perturbed inputs to learn the optimal character-flip strategy for flipping model predictions.
- Leverage transferability of adversarial examples by applying the distilled model to attack black-box models like Google Perspective API.
- Apply the distilled model iteratively to flip characters in a sentence until the target model’s prediction changes, using a greedy, gradient-estimate-based selection process.
- Use attention mechanisms and baseline comparisons (e.g., random character selection) to evaluate the effectiveness of the distilled model.
- Validate semantic similarity and toxicity through human annotation to ensure perturbed examples remain meaningful and toxic.
Experimental results
Research questions
- RQ1Can a neural network effectively learn and generalize the behavior of a white-box adversarial attack without requiring gradient access?
- RQ2To what extent does the distilled model maintain attack quality compared to the original white-box method?
- RQ3Can the distilled model be successfully transferred to a black-box setting to attack real-world systems like Google Perspective API?
- RQ4Do adversarial examples generated by the distilled model preserve semantic toxicity, as judged by humans?
Key findings
- DistFlip achieves a 19x to 39x speed-up in adversarial example generation compared to the original HotFlip white-box attack, with comparable success rates.
- The distilled model requires only 1.8 flips on average for 85% of examples to flip the prediction in the source model, matching the performance of HotFlip-10.
- When applied to Google Perspective API, DistFlip successfully flipped the toxicity label from 'toxic' to 'non-toxic' or 'uncertain' in 42% of tested examples.
- Human annotators rated 87.6% of attacked toxic sentences as toxic, confirming that semantic toxicity is preserved despite model misclassification.
- The distilled model generalizes well across examples and maintains high attack quality even when the source model is not accessible during inference.
- DistFlip outperforms baseline methods like attention-based or random character flipping in both speed and effectiveness.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.