Text Adversarial Purification as Defense against Adversarial Attacks
Preprint
Abstract
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 perturbations therefore can make correct predictions based on the recovered clean samples. Despite the success of adversarial purification in the computer vision field that incorporates generative models such as energy-based models and diffusion models, using purification as a defense strategy against textual adversarial attacks is rarely explored. In this work, we introduce a novel adversarial purification method that focuses on defending against textual adversarial attacks. With the help of language models, we can inject noise by masking input texts and reconstructing the masked texts based on the masked language models. In this way, we construct an adversarial purification process for textual models against the most widely used word-substitution adversarial attacks. We test our proposed adversarial purification method on several strong adversarial attack methods including Textfooler and BERT-Attack and experimental results indicate that the purification algorithm can successfully defend against strong word-substitution attacks.Keywords
All Related Versions
This publication has 15 references indexed in Scilit:
- Certified Robustness to Text Adversarial Attacks by Randomized [MASK]Computational Linguistics, 2023
- Robustifying models against adversarial attacks by Langevin dynamicsNeural Networks, 2021
- Searching for an Effective Defender: Benchmarking Defense against Adversarial Word Substitution2021
- Better Robustness by More Coverage: Adversarial and Mixup Data Augmentation for Robust Finetuning2021
- BERT-ATTACK: Adversarial Attack Against BERT Using BERT2020
- Reevaluating Adversarial Examples in Natural Language2020
- Searching for a Search Method: Benchmarking Search Algorithms for Generating NLP Adversarial Examples2020
- BAE: BERT-based Adversarial Examples for Text Classification2020
- Generating Natural Language Adversarial Examples2018
- Towards Evaluating the Robustness of Neural Networks2017