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}.


翻译:对抗攻击对机器学习模型在安全关键应用中的可靠部署构成严重威胁。此类攻击通过轻微修改输入即可误导现有模型产生错误预测。近期研究表明,对抗样本往往偏离正常样本的基础数据流形,而预训练掩码语言模型能够拟合自然语言处理数据的正常流形。为探索如何将掩码语言模型应用于对抗检测,我们提出一种新型文本对抗样本检测方法——基于掩码语言模型的检测(MLMD)。该方法通过探究掩码语言模型引发的流形变化,可在正常样本与对抗样本之间产生清晰可辨的区分信号。MLMD具有即插即用的特性(即无需重新训练被攻击模型),且对分类任务、被攻击模型架构及待防御攻击方法均保持任务无关性。我们在多个基准文本数据集、广泛研究的机器学习模型及最先进的对抗攻击方法(共计$3\times4\times4=48$种配置组合)上进行了评估。实验结果表明,MLMD在AG-NEWS、IMDB和SST-2数据集上的检测准确率分别达到0.984、0.967和0.901,展现出强劲性能。此外,在检测准确率和F1分数方面,MLMD均优于或至少持平于现有最先进的检测防御方法。本研究为基于对抗样本离群流形假设的各类防御方法提供了捕捉流形变化的新视角。本工作的代码已在\url{https://github.com/mlmddetection/MLMDdetection}开源。

0
下载
关闭预览

相关内容

专知会员服务
34+阅读 · 2021年9月16日
【EMNLP2020】自然语言生成,Neural Language Generation
专知会员服务
39+阅读 · 2020年11月20日
[综述]深度学习下的场景文本检测与识别
专知会员服务
78+阅读 · 2019年10月10日
IJCAI 2022 | 使用陈述句进行视觉问答的Prompt Tuning
浅聊对比学习(Contrastive Learning)第一弹
PaperWeekly
1+阅读 · 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
501+阅读 · 2023年3月31日
Arxiv
38+阅读 · 2020年3月10日
Feature Denoising for Improving Adversarial Robustness
Arxiv
15+阅读 · 2018年12月9日
VIP会员
最新内容
综述 | Self-Evolving Coding Agents:自进化编程智能体
专知会员服务
0+阅读 · 58分钟前
美海军陆战队将三型无人机整合入统一战场网络
专知会员服务
2+阅读 · 今天9:39
《无人机蜂群:释放人类-蜂群编队的潜能》
专知会员服务
4+阅读 · 今天9:12
《战略战术化:一项综合性述评》
专知会员服务
2+阅读 · 今天9:08
美陆军-工业界协同推进反无人机系统技术发展
专知会员服务
1+阅读 · 今天8:46
《跨域指挥背景下的领导力发展》最新报告
专知会员服务
2+阅读 · 今天8:40
俄乌无人机战争的六大启示
专知会员服务
10+阅读 · 8月3日
《无人机空中监控:通信实验洞察》
专知会员服务
8+阅读 · 8月3日
相关基金
国家自然科学基金
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会员