Reevaluating Adversarial Examples in Natural Language

John X. Morris, Eli Lifland, Jack Lanchantin, Yangfeng Ji, Yanjun Qi
4/25/2020
146 citations
cs.CLcs.AIcs.CR

Official code: QData/TextAttack (3,478 stars, Python, MIT, last commit 2026-04-17). 1 more implementation below.

Abstract

State-of-the-art attacks on NLP models lack a shared definition of a what constitutes a successful attack. We distill ideas from past work into a unified framework: a successful natural language adversarial example is a perturbation that fools the model and follows some linguistic constraints.

Show full abstract

We then analyze the outputs of two state-of-the-art synonym substitution attacks. We find that their perturbations often do not preserve semantics, and 38% introduce grammatical errors. Human surveys reveal that to successfully preserve semantics, we need to significantly increase the minimum cosine similarities between the embeddings of swapped words and between the sentence encodings of original and perturbed sentences.With constraints adjusted to better preserve semantics and grammaticality, the attack success rate drops by over 70 percentage points.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
QData/TextAttackOfficial3,478PythonMIT2026-04-17
QData/Reevaluating-NLP-Adversarial-ExamplesOfficial7Jupyter Notebook–2020-12-11
QData/TextAttackOfficial100%
MIT

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/

3,478458Python, Jupyter NotebookOct 15, 20197 months agoMIT
adversarial-attacksadversarial-examplesadversarial-machine-learningdata-augmentationmachine-learning+3 more

EMNLP Findings 2020: Reevaluating Adversarial Examples in Natural Language

73Jupyter Notebook, PythonDec 7, 20195 years ago
natural-languagesemanticssuspiciontextattack

Similar Papers

Cite this paper

@article{morris2020reevaluating,
  title  = {Reevaluating Adversarial Examples in Natural Language},
  author = {John X. Morris and Eli Lifland and Jack Lanchantin and Yangfeng Ji and Yanjun Qi},
  year   = {2020},
  eprint = {2004.14174},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.14174}
}

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

Discussion