Rethinking Textual Adversarial Defense for Pre-Trained Language Models
- 19 July 2022
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE/ACM Transactions on Audio, Speech, and Language Processing
- Vol. 30 (23299290) , 2526-2540
Abstract
Although pre-trained language models (PrLMs) have achieved significant success, recent studies demonstrate that PrLMs are vulnerable to adversarial attacks. By generating adversarial examples with slight perturbations on different levels (sentence / word / character), adversarial attacks can fool PrLMs to generate incorrect predictions, which questions the robustness of PrLMs. However, we find that most existing textual adversarial examples are unnatural, which can be easily distinguished by both human and machine. Based on a general anomaly detector, we propose a novel metric (Degree of Anomaly) as a constraint to enable current adversarial attack approaches to generate more natural and imperceptible adversarial examples. Under this new constraint, the success rate of existing attacks drastically decreases, which reveals that the robustness of PrLMs is not as fragile as they claimed. In addition, we find that four types of randomization can invalidate a large portion of textual adversarial examples. Based on anomaly detector and randomization, we design a universal defense framework, which is among the first to perform textual adversarial defense without knowing the specific attack. Empirical results show that our universal defense framework achieves comparable or even higher after-attack accuracy with other specific defenses, while preserving higher original accuracy at the same time. Our work discloses the essence of textual adversarial attacks, and indicates that (i) further works of adversarial attacks should focus more on how to overcome the detection and resist the randomization, otherwise their adversarial examples would be easily detected and invalidated; and (ii) compared with the unnatural and perceptible adversarial examples, it is those undetectable adversarial examples that pose real risks for PrLMs and require more attention for future robustness-enhancing strategies.Keywords
All Related Versions
Funding Information
- Key Projects of National Natural Science Foundation of China (U1836222, 61733011)
- Shanghai Jiao Tong University
This publication has 49 references indexed in Scilit:
- Identify Susceptible Locations in Medical Records via Adversarial Attacks on Deep Predictive Models2018
- Deep Text Classification Can be Fooled2018
- Adversarial Example Generation with Syntactically Controlled Paraphrase Networks2018
- Adversarial Examples Are Not Easily Detected2017
- Towards Evaluating the Robustness of Neural Networks2017
- The RepEval 2017 Shared Task: Multi-Genre Natural Language Inference with Sentence Representations2017
- Crafting adversarial input sequences for recurrent neural networks2016
- The Limitations of Deep Learning in Adversarial Settings2016
- Counter-fitting Word Vectors to Linguistic Constraints2016
- Seeing stars2005