Contextualized Perturbation for Textual Adversarial Attack

Dianqi Li, Yizhe Zhang, Hao Peng, Liqun Chen, Chris Brockett +2 more
9/16/2020
cs.CL

Official code: cookielee77/CLARE (44 stars, Python, last commit 2021-07-23).

Abstract

Adversarial examples expose the vulnerabilities of natural language processing (NLP) models, and can be used to evaluate and improve their robustness. Existing techniques of generating such examples are typically driven by local heuristic rules that are agnostic to the context, often resulting in unnatural and ungrammatical outputs.

Show full abstract

This paper presents CLARE, a ContextuaLized AdversaRial Example generation model that produces fluent and grammatical outputs through a mask-then-infill procedure. CLARE builds on a pre-trained masked language model and modifies the inputs in a context-aware manner. We propose three contextualized perturbations, Replace, Insert and Merge, allowing for generating outputs of varied lengths. With a richer range of available strategies, CLARE is able to attack a victim model more efficiently with fewer edits. Extensive experiments and human evaluation demonstrate that CLARE outperforms the baselines in terms of attack success rate, textual similarity, fluency and grammaticality.

View on arXivView PDF

Code Implementations(1)

cookielee77/CLAREOfficial100%

Contextualized Perturbation for Textual Adversarial Attack, NAACL 2021

448Python, ShellSep 16, 20205 years ago

Similar Papers

Cite this paper

@article{li2020contextualized,
  title  = {Contextualized Perturbation for Textual Adversarial Attack},
  author = {Dianqi Li and Yizhe Zhang and Hao Peng and Liqun Chen and Chris Brockett and Ming-Ting Sun and Bill Dolan},
  year   = {2020},
  eprint = {2009.07502},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2009.07502}
}

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

Discussion