Text Adversarial Purification as Defense against Adversarial Attacks

Linyang Li, Demin Song, Xipeng Qiu


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.
Anthology ID:
2023.acl-long.20
Volume:
Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
July
Year:
2023
Address:
Toronto, Canada
Editors:
Anna Rogers, Jordan Boyd-Graber, Naoaki Okazaki
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
338–350
Language:
URL:
https://aclanthology.org/2023.acl-long.20
DOI:
10.18653/v1/2023.acl-long.20
Bibkey:
Cite (ACL):
Linyang Li, Demin Song, and Xipeng Qiu. 2023. Text Adversarial Purification as Defense against Adversarial Attacks. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 338–350, Toronto, Canada. Association for Computational Linguistics.
Cite (Informal):
Text Adversarial Purification as Defense against Adversarial Attacks (Li et al., ACL 2023)
Copy Citation:
PDF:
https://preview.aclanthology.org/nschneid-patch-5/2023.acl-long.20.pdf
Video:
 https://preview.aclanthology.org/nschneid-patch-5/2023.acl-long.20.mp4