R&R: Metric-guided Adversarial Sentence Generation

Lei Xu, Alfredo Cuesta-Infante, Laure Berti-Equille, Kalyan Veeramachaneni
4/17/2021
cs.CL

Official code: DAI-Lab/fibber (31 stars, Python, MIT, last commit 2026-06-23).

Abstract

Adversarial examples are helpful for analyzing and improving the robustness of text classifiers. Generating high-quality adversarial examples is a challenging task as it requires generating fluent adversarial sentences that are semantically similar to the original sentences and preserve the original labels, while causing the classifier to misclassify them.

Show full abstract

Existing methods prioritize misclassification by maximizing each perturbation's effectiveness at misleading a text classifier; thus, the generated adversarial examples fall short in terms of fluency and similarity. In this paper, we propose a rewrite and rollback (R&R) framework for adversarial attack. It improves the quality of adversarial examples by optimizing a critique score which combines the fluency, similarity, and misclassification metrics. R&R generates high-quality adversarial examples by allowing exploration of perturbations that do not have immediate impact on the misclassification metric but can improve fluency and similarity metrics. We evaluate our method on 5 representative datasets and 3 classifier architectures. Our method outperforms current state-of-the-art in attack success rate by +16.2%, +12.8%, and +14.0% on the classifiers respectively. Code is available at https://github.com/DAI-Lab/fibber

View on arXivView PDF

Code Implementations(1)

DAI-Lab/fibberOfficial100%
MIT
319Python, MakefileMay 29, 20205 months agoMIT

Similar Papers

Cite this paper

@article{xu2021rr,
  title  = {R&R: Metric-guided Adversarial Sentence Generation},
  author = {Lei Xu and Alfredo Cuesta-Infante and Laure Berti-Equille and Kalyan Veeramachaneni},
  year   = {2021},
  eprint = {2104.08453},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.08453}
}

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/2104.08453.svg)](https://codeofpaper.com/paper/2104.08453)

Discussion