Thieves on Sesame Street: Model Extraction Attacks on BERT APIsThieves on Sesame Street! Model Extraction of BERT-based APIs
Quick read
Based on the paper's full text (AI-generated); refer to the original
Researchers demonstrated a model extraction attack against a BERT API: an attacker, without real training data, can train a local copy with performance close to the victim model using only random word sequence queries. The research validated this on four tasks: SST2, MNLI, SQuAD 1.1, and BoolQ; the most expensive attack cost about $500. A SQuAD model extracted with wiki queries recovered 95% of the original model's accuracy, but the agreement between the extracted model and the victim model was limited, with F1 of only 59.2 and 50.5 for wiki and random queries on SQuAD, respectively. The paper also tested two defenses, membership classification and API watermarking; they can stop simple attackers but cannot stop attackers who adapt their strategy to the defenses.
- This studies model extraction in NLP: an attacker with only query access to a fine-tuned BERT model wants to reconstruct a local copy. Such attacks steal intellectual property, may also leak training data, or be used to construct adversarial examples.
- Assume both the attacker and the victim model fine-tune pretrained BERT; the attacker uses random word sequences or WikiText-103 sentences/paragraphs, plus task-specific heuristics (e.g., MNLI replacing three words in the premise, SQuAD sampling question words from the paragraph and adding question words) to generate queries, then uses the victim model's outputs to fine-tune its own BERT.
- On SST2, MNLI, SQuAD, and BoolQ, models with high accuracy on the original development set can be extracted even with meaningless queries; on SQuAD, wiki queries recover about 95% of the original accuracy; when only argmax labels are given, accuracy drops only slightly; returns diminish as the query budget increases; the attack cost is about a few hundred dollars. Analysis shows that victim models have low consistency on meaningless inputs, and high-consistency queries are more suitable for extraction; attackers achieve better results with stronger pretrained models (e.g., XLNet-large), while training from scratch yields poor extraction. Membership classification and API watermarking can stop simple attackers but can be bypassed by adaptive attackers.
- Membership classification is only applicable to tasks where it is difficult for attackers to collect real queries, and it is hard to cover all fabricated query distributions; watermarking can only verify after the fact that a model was stolen, cannot prevent extraction, and attackers can remove watermarks through differentially private training, re-fine-tuning, or returning random outputs for matching queries. Future directions include using meaningless inputs to improve distillation, using query efficiency to diagnose dataset complexity, and using consistency among victim models for active learning.
The paper shows that, without real training data, a BERT API can be extracted using random word sequence queries at a cost of about $500, and that membership classification and API watermarking fail against adaptive adversaries.