Skip to main content
QUICK REVIEW

[论文解读] Model Extraction and Adversarial Transferability, Your BERT is Vulnerable!

Xuanli He, Lingjuan Lyu|arXiv (Cornell University)|Mar 18, 2021
Adversarial Robustness in Machine Learning参考文献 29被引用 6
一句话总结

本文表明,基于 BERT 的 API 服务容易受到模型提取攻击的影响,攻击者仅通过有限查询即可重建出与目标模型高度一致的副本。该提取模型可对原始 BERT 模型实施高度可迁移的对抗性攻击,即使在架构不匹配的情况下依然有效,且常规防御措施(如软标签或扰动)无法在不牺牲模型准确率的前提下完全缓解此类威胁。

ABSTRACT

Natural language processing (NLP) tasks, ranging from text classification to text generation, have been revolutionised by the pre-trained language models, such as BERT. This allows corporations to easily build powerful APIs by encapsulating fine-tuned BERT models for downstream tasks. However, when a fine-tuned BERT model is deployed as a service, it may suffer from different attacks launched by malicious users. In this work, we first present how an adversary can steal a BERT-based API service (the victim/target model) on multiple benchmark datasets with limited prior knowledge and queries. We further show that the extracted model can lead to highly transferable adversarial attacks against the victim model. Our studies indicate that the potential vulnerabilities of BERT-based API services still hold, even when there is an architectural mismatch between the victim model and the attack model. Finally, we investigate two defence strategies to protect the victim model and find that unless the performance of the victim model is sacrificed, both model ex-traction and adversarial transferability can effectively compromise the target models

研究动机与目标

  • 研究通过有限查询访问从商业 API 中提取基于 BERT 的分类模型的可行性。
  • 评估在提取模型上生成的对抗性样本能否成功迁移至原始目标模型。
  • 评估常见防御策略(软标签与预测扰动)对模型提取和对抗迁移攻击的抵御能力。
  • 考察目标模型与提取模型之间架构不匹配对攻击效果的影响。
  • 量化此类攻击在真实生产 NLP API 上的实际成本与可行性。

提出的方法

  • 攻击分为两个阶段:首先通过查询目标 BERT API 收集输入-预测对以实现模型提取。
  • 其次,攻击者在收集的查询-预测数据上训练本地提取模型,以模仿目标模型的行为。
  • 随后,利用目标扰动(如拼写错误攻击)在提取模型上生成对抗性样本,以利用其可迁移性。
  • 通过在原始目标 API 上测试对抗性样本的成功率来衡量可迁移性。
  • 防御策略包括软标签(对 softmax 进行温度缩放)和预测扰动(在 logits 上添加高斯噪声)。
  • 实验在多个 NLP 数据集(如 AG News、Yelp、Blog)上进行,调整查询预算与架构配置。

实验结果

研究问题

  • RQ1攻击者是否能仅通过有限数量的查询,从黑盒 API 中提取出高精度的基于 BERT 的模型?
  • RQ2即使在架构不同的情况下,能否在提取模型上生成的对抗性样本仍能有效迁移至原始目标模型?
  • RQ3常见防御机制(软标签与预测扰动)在缓解模型提取与对抗迁移攻击方面有多有效?
  • RQ4目标模型与提取模型之间的架构不匹配是否会降低攻击的有效性?
  • RQ5在真实商业 NLP 服务中,此类攻击的实际成本与可行性如何?

主要发现

  • 当目标模型与提取模型使用相同架构时,模型提取在 BERT-large 上达到了最高 91.0% 的准确率,表明实现了高度保真的模仿。
  • 当使用提取的 BERT-large 模型生成对抗性样本时,其在原始目标模型上的迁移成功率高达 59.3%,显著优于黑盒基线方法。
  • 即使存在架构不匹配(如用 BERT-base 提取模型攻击 BERT-large 目标模型),对抗性迁移依然有效,成功率保持在 42.7%。
  • 软标签防御(温度缩放 τ = 0.5 或 5.0)虽降低了对抗性迁移成功率,但未能阻止模型提取,且模型准确率得以保持。
  • 预测扰动(σ = 0.50)虽降低了迁移成功率,但也导致目标模型准确率下降至 63.2%,且模型提取仍成功完成。
  • 整个攻击流程的总成本低至 7.10 美元,证明其具有极低的实际成本与真实世界可行性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。