Saved in:
Bibliographic Details
Main Authors: Li, Zhenhao, Zhou, Huichi, Rei, Marek, Specia, Lucia
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2407.00248
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915290575536128
author Li, Zhenhao
Zhou, Huichi
Rei, Marek
Specia, Lucia
author_facet Li, Zhenhao
Zhou, Huichi
Rei, Marek
Specia, Lucia
contents Pretrained language models have significantly advanced performance across various natural language processing tasks. However, adversarial attacks continue to pose a critical challenge to systems built using these models, as they can be exploited with carefully crafted adversarial texts. Inspired by the ability of diffusion models to predict and reduce noise in computer vision, we propose a novel and flexible adversarial defense method for language classification tasks, DiffuseDef, which incorporates a diffusion layer as a denoiser between the encoder and the classifier. The diffusion layer is trained on top of the existing classifier, ensuring seamless integration with any model in a plug-and-play manner. During inference, the adversarial hidden state is first combined with sampled noise, then denoised iteratively and finally ensembled to produce a robust text representation. By integrating adversarial training, denoising, and ensembling techniques, we show that DiffuseDef improves over existing adversarial defense methods and achieves state-of-the-art performance against common black-box and white-box adversarial attacks.
format Preprint
id arxiv_https___arxiv_org_abs_2407_00248
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle DiffuseDef: Improved Robustness to Adversarial Attacks via Iterative Denoising
Li, Zhenhao
Zhou, Huichi
Rei, Marek
Specia, Lucia
Computation and Language
Pretrained language models have significantly advanced performance across various natural language processing tasks. However, adversarial attacks continue to pose a critical challenge to systems built using these models, as they can be exploited with carefully crafted adversarial texts. Inspired by the ability of diffusion models to predict and reduce noise in computer vision, we propose a novel and flexible adversarial defense method for language classification tasks, DiffuseDef, which incorporates a diffusion layer as a denoiser between the encoder and the classifier. The diffusion layer is trained on top of the existing classifier, ensuring seamless integration with any model in a plug-and-play manner. During inference, the adversarial hidden state is first combined with sampled noise, then denoised iteratively and finally ensembled to produce a robust text representation. By integrating adversarial training, denoising, and ensembling techniques, we show that DiffuseDef improves over existing adversarial defense methods and achieves state-of-the-art performance against common black-box and white-box adversarial attacks.
title DiffuseDef: Improved Robustness to Adversarial Attacks via Iterative Denoising
topic Computation and Language
url https://arxiv.org/abs/2407.00248