fairBERTs: Erasing Sensitive Information Through Semantic and Fairness-aware Perturbations

Jinfeng Li, Yuefeng Chen, Xiangyu Liu, Longtao Huang, Rong Zhang, Hui XuearXiv 2024 · DOI

Abstract

Pre-trained Language Models (PLMs) like BERT and RoBERTa frequently internalize societal biases from large-scale training data, leading to unfair predictions in downstream tasks. We introduce fairBERTs, a framework that utilizes Generative Adversarial Networks (GANs) to apply semantic-aware perturbations to a model's latent space. By erasing sensitive information while preserving task-relevant features, fairBERTs mitigates social bias without the typical performance degradation associated with fairness-utility trade-offs. Our evaluation on Jigsaw Toxicity and Yelp Sentiment benchmarks demonstrates that fairBERTs significantly improves fairness metrics, such as Demographic Parity Difference (DPD), while maintaining or even enhancing task accuracy.

Introduction

Pre-trained Language Models are the backbone of modern NLP, but they often rely on "protected attributes" (e.g., religion, gender, or race) as shortcuts for prediction. For example, a standard toxicity classifier might incorrectly flag sentences containing identifiers like "Muslim" as toxic due to biased patterns in its training data. Existing solutions, such as word-blinding or dataset re-balancing, are difficult to scale and often degrade model performance. fairBERTs addresses this by treating debiasing as an adversarial game aimed at scrubbing sensitive information from the model's internal representations.

Methodology

The fairBERTs framework treats debiasing as an adversarial optimization problem involving four primary components:

  1. The Backbone (BPLM): A standard fine-tuned model (e.g., BERT-base).
  2. The Generator ($G$): Analyzes semantic-rich sequence outputs to generate a specific perturbation mask ($\delta$).
  3. The Discriminator ($D$): Attempts to predict sensitive attributes (e.g., gender) from the perturbed internal representation.
  4. The Classifier ($F_\theta$): Ensures the model retains its ability to perform the primary task (e.g., sentiment analysis).
The fairBERTs architecture featuring the Generator, Discriminator, and Classifier components.

The Generator is trained to create perturbations that cause the Discriminator to fail (erasing sensitive info) while ensuring the Classifier succeeds. To enhance robustness, the authors employ counterfactual adversarial training, intentionally flipping sensitive labels during training to help the model more effectively neutralize biased features.

Experiments and Datasets

The researchers evaluated fairBERTs on two real-world benchmarks:

  • Jigsaw Toxicity: A dataset for detecting toxic public comments, using "gender" as the protected sensitive attribute.
  • Yelp Sentiment: A dataset of business reviews where gender annotations were used for fairness testing.

Key Results

fairBERTs demonstrates that intelligent latent-space perturbations can decouple fairness from utility, often improving both simultaneously.

  • Fairness Gains: On the Jigsaw Toxicity task, fairBERTs reduced the Demographic Parity Difference (DPD) from 0.0670 (vanilla) to 0.0090, a nearly sevenfold improvement.
  • Utility Preservation: Unlike other debiasing methods that see accuracy drops of 2-4%, fairBERTs maintained high accuracy (90.67% on Jigsaw) and slightly increased accuracy on the Yelp dataset (from 0.9920 to 0.9953).
  • Reduced Reliance on Sensitive Words: Using LIME (an interpretation tool), the authors found that the influence of sensitive gendered words on model decisions decreased by over 30%.
Visual comparison of word importance (saliency) between Vanilla BERT and fairBERTs across toxicity and sentiment tasks.

Conclusion and Future Work

fairBERTs successfully erases sensitive information from PLMs through semantic-aware perturbations. While the current study focuses on gender, future work will address intersectional biases (e.g., combinations of race and age) and adapt the framework for large-scale auto-regressive models like GPT-4. The authors suggest generalizing this framework to high-stakes domains such as medical diagnosis and legal technology.

Summary updated

BibTeX
@misc{li2024fairberts,
  author = {Jinfeng Li and Yuefeng Chen and Xiangyu Liu and Longtao Huang and Rong Zhang and Hui Xue},
  title = {{fairBERTs: Erasing Sensitive Information Through Semantic and Fairness-aware Perturbations}},
  year = {2024},
  eprint = {2407.08189},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.08189},
}
Figure