TextAttack: A Framework for Adversarial Attacks, Data Augmentation, and Adversarial Training in NLP

By John X. Morris, Eli Lifland, Jin Yong Yoo, J. Grigsby, Di Jin, Yanjun Qi. 2020

949 citations recorded by the source corpus.

While there has been substantial research using adversarial attacks to analyze NLP models, each attack is implemented in its own code repository. It remains challenging to develop NLP attacks and utilize them to improve model performance. This paper introduces TextAttack, a Python framework for adversarial attacks, data augmentation, and adversarial training in NLP. TextAttack builds attacks from four components: a goal function, a set of constraints, a transformation, and a search method. TextAttack’s modular design enables researchers to easily construct attacks from combinations of novel and existing components. TextAttack provides implementations of 16 adversarial attacks from the literature and supports a variety of models and datasets, including BERT and other transformers, and all GLUE tasks. TextAttack also includes data augmentation and adversarial training modules for using components of adversarial attacks to improve model accuracy and robustness.TextAttack is democratizing NLP: anyone can try data augmentation and adversarial training on any model or dataset, with just a few lines of code. Code and tutorials are available at https://github.com/QData/TextAttack.

Subfields: Natural Language Processing, Safety, Robustness & Interpretability

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Natural Language Processing

  1. Mohit Bansal
  2. Jianfeng Gao
  3. Yejin Choi
  4. Graham Neubig
  5. Luke S. Zettlemoyer
  6. Douwe Kiela
  7. Noah A. Smith
  8. Percy Liang

In Safety, Robustness & Interpretability

  1. Eric Michael Smith
  2. Bo Li
  3. Dan Hendrycks
  4. Adina Williams
  5. Mantas Mazeika
  6. Daniel S. Weld
  7. Mohit Bansal
  8. Neil Zhenqiang Gong

Citations in the corpus