Thieves on Sesame Street! Model Extraction of BERT-based APIs

Kalpesh Krishna, Gaurav Singh Tomar, Ankur P. Parikh, Nicolas Papernot, Mohit Iyyer
10/27/2019
cs.CLcs.CRcs.LG

Official code: google-research/language (1,828 stars, Python, Apache-2.0, last commit 2026-04-21).

Abstract

We study the problem of model extraction in natural language processing, in which an adversary with only query access to a victim model attempts to reconstruct a local copy of that model. Assuming that both the adversary and victim model fine-tune a large pretrained language model such as BERT (Devlin et al.

Show full abstract

2019), we show that the adversary does not need any real training data to successfully mount the attack. In fact, the attacker need not even use grammatical or semantically meaningful queries: we show that random sequences of words coupled with task-specific heuristics form effective queries for model extraction on a diverse set of NLP tasks, including natural language inference and question answering. Our work thus highlights an exploit only made feasible by the shift towards transfer learning methods within the NLP community: for a query budget of a few hundred dollars, an attacker can extract a model that performs only slightly worse than the victim model. Finally, we study two defense strategies against model extraction---membership classification and API watermarking---which while successful against naive adversaries, are ineffective against more sophisticated ones.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Shared repository for open-sourced projects from the Google AI Language team.

1,828363Python, Jupyter NotebookOct 16, 20187 months agoApache-2.0
machine-learningnatural-language-processingresearch

Similar Papers

Cite this paper

@article{krishna2019thieves,
  title  = {Thieves on Sesame Street! Model Extraction of BERT-based APIs},
  author = {Kalpesh Krishna and Gaurav Singh Tomar and Ankur P. Parikh and Nicolas Papernot and Mohit Iyyer},
  year   = {2019},
  eprint = {1910.12366},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1910.12366}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1910.12366.svg)](https://codeofpaper.com/paper/1910.12366)

Discussion