[论文解读] Thieves on Sesame Street! Model Extraction of BERT-based APIs
该论文表明,攻击者仅通过查询输出即可有效地从基于 BERT-large 的模型中提取模型,即使输入无意义,并且分析了诸如成员分类和水印等防御措施。
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. 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.
研究动机与目标
- 为为提供 BERT 基础模型的 NLP API 的模型提取风险提供动机并形式化。
- 证明攻击者在没有真实任务数据的情况下能够复制出强大的 NLP 模型。
- 评估预训练和架构选择如何影响提取质量。
- 评估简单的防御并讨论其局限性。
提出的方法
- 定义受害模型 g_T 为用于 NLP 任务的微调 BERT 基础系统。
- 使用任务特定的查询生成器(随机和维基来源)加上启发式方法,在没有真实训练数据的情况下生成输入-输出对。
- 在收集到的(x_i, g_T(x_i))上对公共 BERT 基线进行微调以获得提取模型 g'_T。
- 通过原始开发集的准确度和受害模型与提取模型之间的一致性来评估提取。
- 探索输出类型(概率与最大概率)对提取的影响。
- 尝试不同的攻击者架构(BERT-large/base、XLNet)以及训练数据混合(original/wiki/random)。
- 测试防御:成员分类和水印,包括不可回答问题的设置。
实验结果
研究问题
- RQ1对抗者是否可以通过对一个黑盒 BERT 基础 API 使用无意义输入进行查询来再现一个高性能的 NLP 模型?
- RQ2查询类型(随机 vs. 维基来源)和任务启发式方法如何影响提取准确度和模型等同性?
- RQ3攻击者的预训练和体系结构不匹配对提取成功的影响?
- RQ4像成员分类和水印这样简单的防御对自适应攻击者是否有效?
主要发现
- 提取的模型在原始开发集上的准确度在跨任务的情况下仍然很高,即使是在使用无意义输入进行训练时。
- 维基来源和随机查询能够产生有效的提取,具有高目标任务准确度和相对受害者的一致性差异。
- 对攻击者进行更强大的模型(例如 XLNet-large)的预训练,即使受害模型架构不匹配,也可以提高提取性能。
- 匹配架构通常有助于提取,但更强的攻击者模型可以超越不匹配(例如在 SQuAD 中 XLNet 的表现优于基于 BERT 的攻击者)。
- 像成员分类这样的防御可以降低天真的攻击者的速度,但对自适应攻击者仍不足以构成充分防御;水印在带有水印查询的情况下可以揭示窃取行为,但并非完整解决方案。
- 提取成本仍然具有成本效益(通常为数百美元),并且在若干任务上可以接近受害模型的性能。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。