Lune

ACL2021Top-tier venue

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

Tongshuang Wu, Marco Túlio Ribeiro, Jeffrey Heer, Daniel S. Weld

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. 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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

64 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Tailor: Generating and Perturbing Text with Semantic Controls cites Plug and Play Language Models: A Simple Approach to Controlled Text Generation
  • Tailor: Generating and Perturbing Text with Semantic Controls cites Learning The Difference That Makes A Difference With Counterfactually-Augmented Data
  • Tailor: Generating and Perturbing Text with Semantic Controls cites Evaluating Models' Local Decision Boundaries via Contrast Sets
  • AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model Prompts cites Does the Whole Exceed its Parts? The Effect of AI Explanations on Complementary Team Performance
  • Evaluating Models' Local Decision Boundaries via Contrast Sets cites Learning The Difference That Makes A Difference With Counterfactually-Augmented Data
  • Red Teaming Language Models with Language Models cites Tailor: Generating and Perturbing Text with Semantic Controls
  • Adaptive Testing and Debugging of NLP Models cites Learning The Difference That Makes A Difference With Counterfactually-Augmented Data
  • Adaptive Testing and Debugging of NLP Models cites Evaluating Models' Local Decision Boundaries via Contrast Sets
  • Counterfactual Invariance to Spurious Correlations in Text Classification cites Learning The Difference That Makes A Difference With Counterfactually-Augmented Data
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers64

  1. AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model PromptsTongshuang Wu, Michael Terry, Carrie Jun CaiCHI 2022 · 465 citations
  2. Red Teaming Language Models with Language ModelsEthan Perez, Saffron Huang, H. Francis Song, Trevor Cai et al.EMNLP 2022 · 239 citations
  3. Counterfactual Invariance to Spurious Correlations in Text ClassificationVictor Veitch, Alexander D'Amour, Steve Yadlowsky, Jacob EisensteinNeurIPS 2021 · 108 citations
  4. Adaptive Testing and Debugging of NLP ModelsMarco Túlio Ribeiro, Scott M. LundbergACL 2022 · 99 citations
  5. Tailor: Generating and Perturbing Text with Semantic ControlsAlexis Ross, Tongshuang Wu, Hao Peng, Matthew E. Peters et al.ACL 2022 · 85 citations

Builds on14

  1. WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 citations
  2. Plug and Play Language Models: A Simple Approach to Controlled Text GenerationSumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung et al.ICLR 2020 · 1,166 citations
  3. Does the Whole Exceed its Parts? The Effect of AI Explanations on Complementary Team PerformanceGagan Bansal, Tongshuang Wu, Joyce Zhou, Raymond Fok et al.CHI 2021 · 713 citations
  4. Learning The Difference That Makes A Difference With Counterfactually-Augmented DataDivyansh Kaushik, Eduard H. Hovy, Zachary Chase LiptonICLR 2020 · 625 citations
  5. Evaluating Models' Local Decision Boundaries via Contrast SetsMatt Gardner, Yoav Artzi, Victoria Basmova, Jonathan Berant et al.EMNLP Findings 2020 · 260 citations

Related papers

  1. People Make Better Edits: Measuring the Efficacy of LLM-Generated Counterfactually Augmented Data for Harmful Language DetectionIndira Sen, Dennis Assenmacher, Mattia Samory, Isabelle Augenstein et al.EMNLP 2023 · 7 citations
  2. JoPA: Explaining Large Language Model's Generation via Joint Prompt AttributionYurui Chang, Bochuan Cao, Yujia Wang, Jinghui Chen et al.ACL 2025
  3. Exploring the Efficacy of Automatically Generated Counterfactuals for Sentiment AnalysisLinyi Yang, Jiazheng Li, Padraig Cunningham, Yue Zhang et al.ACL 2021
  4. DISCO: Distilling Counterfactuals with Large Language ModelsZeming Chen, Qiyue Gao, Antoine Bosselut, Ashish Sabharwal et al.ACL 2023 · 27 citations
  5. Counterfactual Generator: A Weakly-Supervised Method for Named Entity RecognitionXiangji Zeng, Yunliang Li, Yuchen Zhai, Yin ZhangEMNLP 2020 · 55 citations
Dusk over the sea between two cliffs drawn in fine vertical lines