paper-with-me

홈 › Papers

Masked Language Model Based Textual Adversarial Example Detection

2023-04-18 · Xiaomei Zhang, Zhaoxi Zhang, Qi Zhong, Xufei Zheng, Yanjun Zhang, Shengshan Hu, Leo Yu Zhang

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

📄 PDF Abstract BibTeX arXiv:2304.08767

Code (1)

mlmddetection/mlmddetection 공식 구현 pytorch

Tasks

Adversarial DefenseLanguage ModelingLanguage ModellingSST-2

Similar Papers 제목 키워드 기반

BAE: BERT-based Adversarial Examples for Text Classification

2020-04-04 · EMNLP 2020 11 · Siddhant Garg, Goutham Ramakrishnan

Modern text classification models are susceptible to adversarial examples, perturbed versions of the original text indiscernible by humans which get misclassified by the model. Recent works in NLP use rule-based synonym …

Adversarial AttackAdversarial TextClassificationGeneral Classification+3

Contextualized Perturbation for Textual Adversarial Attack

2020-09-16 · NAACL 2021 4 · Dianqi Li, Yizhe Zhang, Hao Peng, Liqun Chen 외

Adversarial examples expose the vulnerabilities of natural language processing (NLP) models, and can be used to evaluate and improve their robustness. Existing techniques of generating such examples are typically driven …

Adversarial AttackLanguage ModelingLanguage Modelling

Multi-Granularity Tibetan Textual Adversarial Attack Method Based on Masked Language Model

2024-12-03 · Xi Cao, Nuo Qun, Quzong Gesang, Yulei Zhu 외

In social media, neural network models have been applied to hate speech detection, sentiment analysis, etc., but neural network models are susceptible to adversarial attacks. For instance, in a text classification task, …

Adversarial AttackHate Speech DetectionLanguage ModelingLanguage Modelling+3

GradMask: Gradient-Guided Token Masking for Textual Adversarial Example Detection

2021-11-16 · ACL ARR September 2021 9 · Anonymous

We present a simple model-agnostic textual adversarial example detection scheme called GradMask. It uses gradient signals to detect adversarially perturbed tokens in an input sequence and occludes such tokens by a maskin…

Text Adversarial Purification as Defense against Adversarial Attacks

2022-03-27 · Linyang Li, Demin Song, Xipeng Qiu

Adversarial purification is a successful defense mechanism against adversarial attacks without requiring knowledge of the form of the incoming attack. Generally, adversarial purification aims to remove the adversarial pe…

Adversarial AttackAdversarial DefenseAdversarial Purification