Adversarial attacks are a serious threat to the reliable deployment of machine learning models in safety-critical applications. They can misguide current models to predict incorrectly by slightly modifying the inputs. Recently, substantial work has shown that adversarial examples tend to deviate from the underlying data manifold of normal examples, whereas pre-trained masked language models can fit the manifold of normal NLP data. To explore how to use the masked language model in adversarial detection, we propose a novel textual adversarial example detection method, namely Masked Language Model-based Detection (MLMD), which can produce clearly distinguishable signals between normal examples and adversarial examples by exploring the changes in manifolds induced by the masked language model. MLMD features a plug and play usage (i.e., no need to retrain the victim model) for adversarial defense and it is agnostic to classification tasks, victim model's architectures, and to-be-defended attack methods. We evaluate MLMD on various benchmark textual datasets, widely studied machine learning models, and state-of-the-art (SOTA) adversarial attacks (in total $3*4*4 = 48$ settings). Experimental results show that MLMD can achieve strong performance, with detection accuracy up to 0.984, 0.967, and 0.901 on AG-NEWS, IMDB, and SST-2 datasets, respectively. Additionally, MLMD is superior, or at least comparable to, the SOTA detection defenses in detection accuracy and F1 score. Among many defenses based on the off-manifold assumption of adversarial examples, this work offers a new angle for capturing the manifold change. The code for this work is openly accessible at \url{https://github.com/mlmddetection/MLMDdetection}.


翻译:对抗攻击对于在安全关键应用中可靠地部署机器学习模型是一种严重威胁。它们可以通过略微修改输入数据而误导当前模型产生错误预测。最近的大量工作表明,对抗样本往往会偏离正常样本的基础数据流形,而预训练的蒙皮语言模型可以适应正常 NLP 数据的流形。为了探索如何在对抗检测中使用蒙皮语言模型,我们提出了一种新颖的文本对抗样本检测方法,即基于蒙皮语言模型的检测(MLMD)。MLMD 可以通过探索蒙皮语言模型引起的流型变化,在正常样本和对抗样本之间产生明显可辨别的信号。MLMD 具有即插即用的用途(即不需要重新训练受害者模型)用于对抗防御,并且它对于分类任务、受害者模型的架构和待防御的攻击方法都是不可知的。我们在各种基准文本数据集、广泛研究的机器学习模型和最先进的(SOTA)对抗攻击上评估了 MLMD(总共 3*4*4=48 个设置)。实验结果表明,MLMD 可以实现强大的性能,在 AG-NEWS、IMDB 和 SST-2 数据集上,检测准确率分别达到 0.984、0.967 和 0.901。此外,MLMD 在检测准确度和 F1 得分上优于或至少与 SOTA 检测防御相当。在许多基于对抗样本离流形假设的防御中,这项工作为捕捉流形变化提供了一个新的角度。此工作的代码公开可访问:\url{https://github.com/mlmddetection/MLMDdetection}。

0
下载
关闭预览

相关内容

专知会员服务
33+阅读 · 2021年9月16日
【EMNLP2020】自然语言生成,Neural Language Generation
专知会员服务
39+阅读 · 2020年11月20日
[综述]深度学习下的场景文本检测与识别
专知会员服务
78+阅读 · 2019年10月10日
IJCAI 2022 | 使用陈述句进行视觉问答的Prompt Tuning
浅聊对比学习(Contrastive Learning)第一弹
PaperWeekly
0+阅读 · 2022年6月10日
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
【SIGIR2018】五篇对抗训练文章
专知
12+阅读 · 2018年7月9日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
A Survey of Large Language Models
Arxiv
431+阅读 · 2023年3月31日
Arxiv
38+阅读 · 2020年3月10日
Feature Denoising for Improving Adversarial Robustness
Arxiv
15+阅读 · 2018年12月9日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
国家自然科学基金
0+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员