Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

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

About

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%.

Ashim Gupta, Carter Wood Blum, Temma Choji, Yingjie Fei, Shalin Shah, Alakananda Vempala, Vivek Srikumar• 2023

Related benchmarks

TaskDatasetResultRank
Topic ClassificationAGNews
Clean Acc Change (Abs %)-0.2
16
Text ClassificationIMDB (test)
Clean Accuracy94.3
15
Text ClassificationAGNews (test)
Accuracy (Clean)94.2
15
Text ClassificationQNLI (test)
Accuracy (Clean)90.4
14
Sentiment AnalysisSST-2
Clean Accuracy Delta-0.4
6
Sentiment AnalysisMR
Clean Accuracy Change0.1
6
Natural Language InferenceMNLI
Clean Accuracy Change-0.5
6
Showing 7 of 7 rows

Other info

Follow for update