Don't Retrain, Just Rewrite: Countering Adversarial Perturbations by Rewriting Text

Ashim Gupta, Carter Wood Blum, Temma Choji, Yingjie Fei, Shalin Shah +2 more
5/25/2023
cs.CL

No official code found. Best implementation: ashim95/rewriter_robustness (0 stars, last commit 2025-02-06).

Abstract

Can language models transform inputs to protect text classifiers against adversarial attacks? In this work, we present ATINTER, a model that intercepts and learns to rewrite adversarial inputs to make them non-adversarial for a downstream text classifier. Our experiments on four datasets and five attack mechanisms reveal that ATINTER is effective at providing better adversarial robustness than existing defense approaches, without compromising task accuracy. For example, on sentiment classification using the SST-2 dataset, our method improves the adversarial accuracy over the best existing defense approach by more than 4% with a smaller decrease in task accuracy (0.5% vs 2.5%). Moreover, we show that ATINTER generalizes across multiple downstream tasks and classifiers without having to explicitly retrain it for those settings. Specifically, we find that when ATINTER is trained to remove adversarial perturbations for the sentiment classification task on the SST-2 dataset, it even transfers to a semantically different task of news classification (on AGNews) and improves the adversarial robustness by more than 10%.

View on arXivView PDF

Code Implementations(1)

Code for the ACL 23 paper "Don't Retrain, Just Rewrite: Countering Adversarial Perturbations by Rewriting Text"

00C, C++Jan 20, 20251 years ago

Similar Papers

Cite this paper

@article{gupta2023dont,
  title  = {Don't Retrain, Just Rewrite: Countering Adversarial Perturbations by Rewriting Text},
  author = {Ashim Gupta and Carter Wood Blum and Temma Choji and Yingjie Fei and Shalin Shah and Alakananda Vempala and Vivek Srikumar},
  year   = {2023},
  eprint = {2305.16444},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.16444v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.16444.svg)](https://codeofpaper.com/paper/2305.16444)

Discussion