[Paper Review] Student Surpasses Teacher: Imitation Attack for Black-Box NLP APIs
This paper proposes a novel imitation attack for black-box NLP APIs that leverages unsupervised domain adaptation and multi-victim model ensemble to train attack models that surpass the performance of the original victim APIs on transferred domains. The method demonstrates that attackers can outperform black-box models in real-world application scenarios, challenging prior assumptions about model extraction limits.
Machine-learning-as-a-service (MLaaS) has attracted millions of users to their splendid large-scale models. Although published as black-box APIs, the valuable models behind these services are still vulnerable to imitation attacks. Recently, a series of works have demonstrated that attackers manage to steal or extract the victim models. Nonetheless, none of the previous stolen models can outperform the original black-box APIs. In this work, we conduct unsupervised domain adaptation and multi-victim ensemble to showing that attackers could potentially surpass victims, which is beyond previous understanding of model extraction. Extensive experiments on both benchmark datasets and real-world APIs validate that the imitators can succeed in outperforming the original black-box models on transferred domains. We consider our work as a milestone in the research of imitation attack, especially on NLP APIs, as the superior performance could influence the defense or even publishing strategy of API providers.
Motivation & Objective
- To investigate whether imitation attacks on NLP APIs can produce models that outperform the original black-box models in transferred domains.
- To address the limitation of prior attacks that only succeed in the same domain as the victim.
- To explore the potential performance gain from aggregating predictions across multiple victim APIs.
- To evaluate the effectiveness of the proposed attack under realistic conditions, including real-world commercial APIs and domain shifts.
- To assess the impact of defense strategies such as hard labeling and label noise on the success of the attack.
Proposed method
- The attack uses unsupervised domain adaptation (UDA) to fine-tune a student model on a target domain without labeled data, transferring knowledge from the victim API.
- The student model is trained using soft labels (logits) obtained from querying the black-box API, enabling high-fidelity imitation.
- Multiple victim APIs are ensembled to improve the robustness and generalization of the attack model, especially in out-of-distribution settings.
- The method applies domain alignment techniques to minimize the distribution gap between source and target domains during adaptation.
- The attack model is trained end-to-end using adversarial domain alignment and consistency regularization to improve performance on the target domain.
- Defensive strategies such as hard labeling and Gaussian noise perturbation on victim outputs are evaluated to assess their impact on attack success.
Experimental results
Research questions
- RQ1Can an imitation attack produce a model that outperforms the original black-box NLP API in a transferred domain?
- RQ2Does ensembling predictions from multiple victim APIs enhance the performance of the attack model beyond individual victims?
- RQ3How effective are common defense mechanisms—such as hard labeling and label noise—against this new attack paradigm?
- RQ4To what extent does domain shift between the source and target domains affect the performance gain of the imitated model?
- RQ5Can the proposed attack successfully surpass real-world commercial NLP APIs in practical settings?
Key findings
- The attack model achieved a test accuracy of 91.82% on the SST-2 dataset in the target domain, surpassing both individual victim models (e.g., 89.40% and 87.92%) and the best-performing victim.
- On the FST dataset, the ensemble attack model reached 90.15% accuracy, outperforming the best victim model (88.79%) and demonstrating significant improvement in transferred domains.
- The performance gain was most pronounced in distant domains, such as from movie reviews to financial documents, where the attack model significantly outperformed the victim models.
- Hard labeling of victim outputs reduced the attack success, but the attack model still achieved strong performance, indicating that this defense is not fully effective.
- Gaussian noise with σ = 0.5 on victim outputs reduced attack performance but also harmed the victim’s own utility, suggesting a trade-off in defense strategies.
- The attack successfully surpassed real-world commercial NLP APIs in both sentiment classification and machine translation tasks, demonstrating practical feasibility.
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.