Source-linked AI summary
FairFil: Contrastive Neural Debiasing Method for Pretrained Text Encoders
Pengyu Cheng, Weituo Hao, Siyang Yuan, Shijing Si, Lawrence Carin
TL;DR
Sentence-level fairness remains underexplored, and word-level debiasing may not remove bias arising from word combinations. FairFil filters pretrained sentence embeddings using contrastive learning with bias-shifted, semantically similar augmentations and a sensitive-word regularizer. It reduces measured bias and outperforms Sent-Debias in fairness and representativeness while achieving higher downstream classification accuracy.
Problem
Sentence-level debiasing remains challenging: word-level corrections may leave bias from word combinations, while retraining large encoders is costly and Sent-Debias assumes linear bias.
Source: §1 · pp. 1–2Method
FairFil learns a filter over pretrained sentence embeddings using semantically similar, bias-shifted augmentations and a regularizer against information in sensitive words.
Source: §1 · p. 2, §3.1 · p. 3, §3.3 · p. 4Results
FairFil outperforms Sent-Debias in fairness and representativeness, with higher downstream classification accuracy.
Source: §1 · p. 2, §5.4 · p. 7Takeaways & Limitations
Neural filtering can reduce sentence-embedding bias while preserving more semantic meaning than subtracting bias directions learned from PCA.
Source: §5.4 · p. 7The augmentation assumes that bias in a direction is caused only by the sentence’s identified sensitive words.
Source: §3.1 · p. 3
Abstract
from arXiv · showhide
Pretrained text encoders, such as BERT, have been applied increasingly in various natural language processing (NLP) tasks, and have recently demonstrated significant performance gains. However, recent studies have demonstrated the existence of social bias in these pretrained NLP models. Although prior works have made progress on word-level debiasing, improved sentence-level fairness of pretrained encoders still lacks exploration. In this paper, we proposed the first neural debiasing method for a pretrained sentence encoder, which transforms the pretrained encoder outputs into debiased representations via a fair filter (FairFil) network. To learn the FairFil, we introduce a contrastive learning framework that not only minimizes the correlation between filtered embeddings and bias words but also preserves rich semantic information of the original sentences. On real-world datasets, our FairFil effectively reduces the bias degree of pretrained text encoders, while continuously showing desirable performance on downstream tasks. Moreover, our post-hoc method does not require any retraining of the text encoders, further enlarging FairFil's application space.
1 INTRODUCTION
Pretrained sentence encoders are widely used, but their fairness has received less attention than their performance, efficiency, and robustness. Sentence-level debiasing remains difficult; FairFil uses a neural filter and contrastive learning to reduce bias while retaining semantic information.
1 INTRODUCTION
- Pretrained sentence encoders are mainstream for NLP tasks, but their fairness has received limited research attention.Social bias includes unbalanced behavior on sensitive topics such as gender, race, and religion.Source: §1 · p. 1
- Word-level debiasing may leave sentence-level bias from word combinations, while retraining large encoders is costly and Sent-Debias assumes linear bias.Sent-Debias also depends on training-data embeddings and the number of principal components, limiting generalization.Source: §1 · pp. 1–2
- FairFil filters pretrained sentence embeddings using contrastive learning and a sensitive-word regularizer, outperforming Sent-Debias in fairness and representativeness.It maximizes mutual information between debiased embeddings of original sentences and semantic-preserving augmentations, while minimizing their mutual information with sensitive-word embeddings.Source: §1 · p. 2
2 PRELIMINARIES
Mutual information measures information shared by two variables, but its exact calculation is intractable in the sample-based setting described. The section introduces estimators for mutual-information maximization and minimization and applies them to remove biased information while preserving semantics.
2 PRELIMINARIES
- Mutual information measures the amount of information between variables, while exact calculation is challenging because its expectation is intractable from samples.The passage defines the joint distribution p(x, y) and marginal distributions p(x) and p(y).Source: §2 · p. 2
- InfoNCE estimates mutual information for maximization, while CLUB provides an upper bound for minimization.InfoNCE uses noise contrastive estimation; CLUB uses a variational approximation of the conditional distribution.Source: §2 · p. 2
- The two estimators are used to induce the sentence encoder, eliminating biased information while preserving semantic information from raw text.Source: §2 · p. 2
3 METHOD
FairFil adds a fair-filter network to a pretrained sentence encoder and trains it to retain shared sentence meaning while reducing sensitive-word information.
3 METHOD
- FairFil applies a fair-filter network to pretrained encoder embeddings to produce debiased sentence representations.The filter takes the encoder’s original embeddings as input.Source: §3 · pp. 2–3
3.1 DATA AUGMENTATIONS WITH SENSITIVE ATTRIBUTES
- Augmented sentences preserve meaning while shifting bias direction by replacing sensitive attribute words with corresponding words from another direction.The method assumes embedding bias in a direction comes from the sentence’s sensitive words.Source: §3.1 · p. 3
3.2 CONTRASTIVE LEARNING FRAMEWORK
- InfoNCE maximizes mutual information between filtered embeddings of the original and augmented sentences, encouraging them to retain shared semantics.The framework uses a contrastive score to distinguish the paired embeddings from other batch embeddings.Source: §3.2 · pp. 3–4, Figure 1 · p. 4
3.3 DEBIASING REGULARIZER
- A CLUB-based regularizer minimizes mutual information between filtered embeddings and sensitive attribute words to reduce bias information.The method estimates this information using a variational approximation qθ(w|d).Source: §3.3 · p. 4
4 RELATED WORK
The related work reviews social bias in NLP embeddings and downstream tasks, then surveys contrastive learning and its applications.
4.1 BIAS IN NATURAL LANGUAGE PROCESSING
- Prior NLP bias research covers embedding spaces and downstream tasks; embedding studies include WEAT and its sentence-level extension, SEAT.Most debiasing methods address word-level representations, while Liang et al. (2020) describe the only sentence-level method, using PCA-derived bias directions.Source: §4.1 · p. 5
4.2 CONTRASTIVE LEARNING
- Contrastive learning distinguishes positive from negative embedding pairs, and SimCLR applies multi-view contrastive learning to augmented images.The cited work reports applications spanning metric learning, word and graph representations, and unsupervised visual representation learning.Source: §4.2 · p. 5
5 EXPERIMENTS
The experiments assess FairFil’s bias reduction and downstream representativeness on BERT, comparing it with Sent-Debias and other baselines. They also examine training-data quantity and visualize how gender-target distances change after filtering.
5.1 BIAS EVALUATION METRIC
- SEAT adapts WEAT by embedding target and attribute words in semantically bleached sentence templates; the absolute effect size serves as the bias measure, with values nearer zero indicating fairer embeddings.WEAT compares two target sets against two attribute sets; SEAT applies the test to sentence embeddings.Source: §5.1 · p. 6
5.2 PRETRAINED ENCODERS
- The experiments use BERT in two settings: FairFil is learned on pretrained BERT, or held fixed while BERT is fine-tuned jointly with it on task-specific data.Downstream tasks are SST-2, CoLA, and QNLI; the pretrained-only setting has no downstream accuracy result.Source: §5.2 · p. 6
5.3 TRAINING OF FAIRFIL
- FairFil uses one-layer fully connected ReLU filters and trains for 10 epochs; its training data comprise 183,060 sentences from five datasets, with gender as the main sensitive topic.The setup uses batch size 128 and learning rate 1 × 10^-5; the five corpora include WikiText-2, SST, Reddit, MELD, and POM.Source: §5.3 · p. 6
5.4 DEBIASING RESULTS
- FairFil reduces gender bias on most SEAT scenarios for pretrained and fine-tuned BERT, beats Sent-Debias on most individual tests and average absolute effect size, and achieves higher downstream accuracy.The paper reports the average-effect-size advantage as significant, without giving a value in these passages.Source: Table 2 · p. 7, Table 3 · p. 7, §5.4 · p. 7
- Both FairFil variants achieve lower average absolute SEAT bias than the compared baselines, while word-level methods have the worst debiasing performance.The authors conclude that word-level methods cannot reduce sentence-level social bias in these models.Source: Table 4 · p. 7, §5.4 · pp. 7–8
- Adding the debiasing regularizer improves average SEAT effect sizes but slightly reduces downstream performance, revealing a fairness–representativeness trade-off.Without the regularizer, FairFil still reduces bias and performs better on some individual SEAT tests.Source: §5.4 · p. 7
5.5 ANALYSIS
- With WikiText-2 training proportions from 20% to 100%, both FairFil and Sent-Debias generally improve and show smaller variance as data increases; FairFil removes more bias at 20%.Each proportion is evaluated over five random training runs.Source: §5.5 · p. 8, Figure 2 · p. 8
- A t-SNE visualization of template-averaged embeddings shows more balanced distances from “he” and “she” to attribute concepts after FairFil filtering.The comparison is between original pretrained BERT and FairFil embeddings across social domains.Source: §5.5 · p. 8, Figure 3 · p. 8
6 CONCLUSIONS
FairFil filters pretrained sentence embeddings to reduce bias while retaining semantic information and downstream utility, without retraining the encoder.
6 CONCLUSIONS
- FairFil takes original sentence embeddings as input and outputs debiased embeddings through a fair-filter network.The method is post hoc and does not require access to training corpora or retraining the pretrained encoder.Source: §6 · p. 8
- A multi-view contrastive framework maximizes mutual information between each sentence and an augmentation that replaces sensitive words with semantically similar words in different bias directions.A debiasing regularizer minimizes mutual information between debiased embeddings and the sentences’ sensitive words.Source: §6 · p. 8
- Experiments show FairFil reduces bias in sentence-embedding space while maintaining the embeddings’ semantic meaning.The paper also reports desirable downstream-task performance in the supplied abstract, but that passage is not available to this summary request.Source: §6 · p. 8
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam
The listed references span bias measurement and debiasing, sentence representation, contrastive learning, and fair representations.
- The references include work on measuring bias in contextualized word representations and sentence encoders, alongside methods for removing multiclass bias from word embeddings.Source: R Devon Hjelm, Alex Fedorov, Samuel… · pp. 10–11
- Cited sentence-representation work includes approaches based on self-attention, skip-thought vectors, and debiasing sentence representations.Source: R Devon Hjelm, Alex Fedorov, Samuel… · p. 10
- The bibliography also includes work on contrastive predictive coding and learning controllable fair representations.Source: R Devon Hjelm, Alex Fedorov, Samuel… · p. 11