Polyjuice: Generating Counterfactuals for Explaining, Evaluating, and Improving Models

Tongshuang Wu, Marco Tulio Ribeiro, Jeffrey Heer, Daniel S. Weld
1/1/2021
cs.CL

Official code: tongshuangwu/polyjuice (98 stars, Python, BSD-3-Clause, last commit 2022-08-14).

Abstract

While counterfactual examples are useful for analysis and training of NLP models, current generation methods either rely on manual labor to create very few counterfactuals, or only instantiate limited types of perturbations such as paraphrases or word substitutions. We present Polyjuice, a general-purpose counterfactual generator that allows for control over perturbation types and locations, trained by finetuning GPT-2 on multiple datasets of paired sentences.

Show full abstract

We show that Polyjuice produces diverse sets of realistic counterfactuals, which in turn are useful in various distinct applications: improving training and evaluation on three different tasks (with around 70% less annotation effort than manual generation), augmenting state-of-the-art explanation techniques, and supporting systematic counterfactual error analysis by revealing behaviors easily missed by human experts.

View on arXivView PDF

Code Implementations(1)

BSD-3-Clause
9817Python, Jupyter NotebookMay 6, 20214 years agoBSD-3-Clause

Similar Papers

Cite this paper

@article{wu2021polyjuice,
  title  = {Polyjuice: Generating Counterfactuals for Explaining, Evaluating, and Improving Models},
  author = {Tongshuang Wu and Marco Tulio Ribeiro and Jeffrey Heer and Daniel S. Weld},
  year   = {2021},
  eprint = {2101.00288},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.00288}
}

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

Discussion