Table of Contents
Fetching ...

FairFlow: An Automated Approach to Model-based Counterfactual Data Augmentation For NLP

Ewoenam Kwaku Tokpo, Toon Calders

TL;DR

FairFlow tackles bias in NLP by enabling model-based counterfactual data augmentation without costly parallel corpora. It learns a demographic subspace from a single word-pair prompt, uses an invertible flow DIIN to generate counterfactuals confined to the first $k$ dimensions, and applies an error-correction step with BART to produce fluent parallel data used to fine-tune a generator. Evaluations on Bias-in-bios, ECHR, and Jigsaw show improved fluency (lower perplexity), strong gender transfer, and significant extrinsic bias mitigation with competitive task performance compared to dictionary-based baselines. The approach scales to low-resource settings and reduces reliance on human-generated data, while acknowledging limitations in multilingual and non-binary contexts and emphasizing ethical considerations when deploying counterfactuals.

Abstract

Despite the evolution of language models, they continue to portray harmful societal biases and stereotypes inadvertently learned from training data. These inherent biases often result in detrimental effects in various applications. Counterfactual Data Augmentation (CDA), which seeks to balance demographic attributes in training data, has been a widely adopted approach to mitigate bias in natural language processing. However, many existing CDA approaches rely on word substitution techniques using manually compiled word-pair dictionaries. These techniques often lead to out-of-context substitutions, resulting in potential quality issues. The advancement of model-based techniques, on the other hand, has been challenged by the need for parallel training data. Works in this area resort to manually generated parallel data that are expensive to collect and are consequently limited in scale. This paper proposes FairFlow, an automated approach to generating parallel data for training counterfactual text generator models that limits the need for human intervention. Furthermore, we show that FairFlow significantly overcomes the limitations of dictionary-based word-substitution approaches whilst maintaining good performance.

FairFlow: An Automated Approach to Model-based Counterfactual Data Augmentation For NLP

TL;DR

FairFlow tackles bias in NLP by enabling model-based counterfactual data augmentation without costly parallel corpora. It learns a demographic subspace from a single word-pair prompt, uses an invertible flow DIIN to generate counterfactuals confined to the first dimensions, and applies an error-correction step with BART to produce fluent parallel data used to fine-tune a generator. Evaluations on Bias-in-bios, ECHR, and Jigsaw show improved fluency (lower perplexity), strong gender transfer, and significant extrinsic bias mitigation with competitive task performance compared to dictionary-based baselines. The approach scales to low-resource settings and reduces reliance on human-generated data, while acknowledging limitations in multilingual and non-binary contexts and emphasizing ethical considerations when deploying counterfactuals.

Abstract

Despite the evolution of language models, they continue to portray harmful societal biases and stereotypes inadvertently learned from training data. These inherent biases often result in detrimental effects in various applications. Counterfactual Data Augmentation (CDA), which seeks to balance demographic attributes in training data, has been a widely adopted approach to mitigate bias in natural language processing. However, many existing CDA approaches rely on word substitution techniques using manually compiled word-pair dictionaries. These techniques often lead to out-of-context substitutions, resulting in potential quality issues. The advancement of model-based techniques, on the other hand, has been challenged by the need for parallel training data. Works in this area resort to manually generated parallel data that are expensive to collect and are consequently limited in scale. This paper proposes FairFlow, an automated approach to generating parallel data for training counterfactual text generator models that limits the need for human intervention. Furthermore, we show that FairFlow significantly overcomes the limitations of dictionary-based word-substitution approaches whilst maintaining good performance.
Paper Structure (23 sections, 3 equations, 4 figures, 4 tables)

This paper contains 23 sections, 3 equations, 4 figures, 4 tables.

Figures (4)

  • Figure 1: An end-to-end description of Fairflow, described in four steps: 1) train a classifier to identify attribute words from a corpus; 2) generate counterfactual equivalents for attribute words using an invertible generative flow model; 3) use a word substitution scheme and our proposed error-correction scheme to make the parallel text more fluent and realistic; 4) fine-tune a generative model with the generated parallel data.
  • Figure 2: Counterfactual word generation using an invertible interpretation flow network IIN.
  • Figure 3: An autmatically compiled dictionary using the input prompt {"she", "he"}. Words are discovered using the attribute classifier, and the counterfactuals are generated using the disentangling invertible interpretation network.
  • Figure 4: Text samples from Bias-in-bios and Wikipedia demonstrate that FairFlow and ChatGPT-4 generate more robust counterfactual texts. Compared to ChatGPT-4, Meta-llama-3-8B-Instruct generates more inaccurate counterfactuals.