People Make Better Edits: Measuring the Efficacy of LLM-Generated Counterfactually Augmented Data for Harmful Language Detection

Indira Sen, Dennis Assenmacher, Mattia Samory, Isabelle Augenstein, Wil van der Aalst +1 more
11/2/2023
cs.CLcs.CY

No official code found. Best implementation: Indiiigo/automatedCAD (6 stars, last commit 2023-12-09).

Abstract

NLP models are used in a variety of critical social computing tasks, such as detecting sexist, racist, or otherwise hateful content. Therefore, it is imperative that these models are robust to spurious features. Past work has attempted to tackle such spurious features using training data augmentation, including Counterfactually Augmented Data (CADs). CADs introduce minimal changes to existing training data points and flip their labels; training on them may reduce model dependency on spurious features. However, manually generating CADs can be time-consuming and expensive. Hence in this work, we assess if this task can be automated using generative NLP models. We automatically generate CADs using Polyjuice, ChatGPT, and Flan-T5, and evaluate their usefulness in improving model robustness compared to manually-generated CADs. By testing both model performance on multiple out-of-domain test sets and individual data point efficacy, our results show that while manual CADs are still the most effective, CADs generated by ChatGPT come a close second. One key reason for the lower performance of automated methods is that the changes they introduce are often insufficient to flip the original label.

View on arXivView PDF

Code Implementations(1)

Creating automated or large language model generated Counterfactually Augmented Data (CAD) for augmeting training datasets.

60Python, Jupyter NotebookNov 12, 20232 years ago

Cite this paper

@article{sen2023people,
  title  = {People Make Better Edits: Measuring the Efficacy of LLM-Generated Counterfactually Augmented Data for Harmful Language Detection},
  author = {Indira Sen and Dennis Assenmacher and Mattia Samory and Isabelle Augenstein and Wil van der Aalst and Claudia Wagner},
  year   = {2023},
  eprint = {2311.01270},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.01270v3}
}

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

Discussion