Plug and Play Counterfactual Text Generation for Model Robustness

06/21/2022
by   Nishtha Madaan, et al.
0

Generating counterfactual test-cases is an important backbone for testing NLP models and making them as robust and reliable as traditional software. In generating the test-cases, a desired property is the ability to control the test-case generation in a flexible manner to test for a large variety of failure cases and to explain and repair them in a targeted manner. In this direction, significant progress has been made in the prior works by manually writing rules for generating controlled counterfactuals. However, this approach requires heavy manual supervision and lacks the flexibility to easily introduce new controls. Motivated by the impressive flexibility of the plug-and-play approach of PPLM, we propose bringing the framework of plug-and-play to counterfactual test case generation task. We introduce CASPer, a plug-and-play counterfactual generation framework to generate test cases that satisfy goal attributes on demand. Our plug-and-play model can steer the test case generation process given any attribute model without requiring attribute-specific training of the model. In experiments, we show that CASPer effectively generates counterfactual text that follow the steering provided by an attribute model while also being fluent, diverse and preserving the original content. We also show that the generated counterfactuals from CASPer can be used for augmenting the training data and thereby fixing and making the test model more robust.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/08/2020

Generate Your Counterfactuals: Towards Controlled Counterfactual Generation for Text

Machine Learning has seen tremendous growth recently, which has led to a...
research
06/28/2022

Flexible text generation for counterfactual fairness probing

A common approach for testing fairness issues in text-based classifiers ...
research
01/01/2021

Polyjuice: Automated, General-purpose Counterfactual Generation

Counterfactual examples have been shown to be useful for many applicatio...
research
05/30/2023

LANCE: Stress-testing Visual Models by Generating Language-guided Counterfactual Images

We propose an automated algorithm to stress-test a trained visual model ...
research
05/26/2023

CREST: A Joint Framework for Rationalization and Counterfactual Text Generation

Selective rationales and counterfactual examples have emerged as two eff...
research
02/20/2023

A3Test: Assertion-Augmented Automated Test Case Generation

Test case generation is an important activity, yet a time-consuming and ...
research
02/17/2021

THEaiTRE 1.0: Interactive generation of theatre play scripts

We present the first version of a system for interactive generation of t...

Please sign up or login with your details

Forgot password? Click here to reset