Skip to main content
QUICK REVIEW

[Paper Review] Contrastive Learning for Fair Representations

Aili Shen, Xudong Han|arXiv (Cornell University)|Sep 22, 2021
Adversarial Robustness in Machine LearningComputer Science36 references19 citations
TL;DR

This paper proposes a contrastive learning-based method to reduce bias in neural classifier representations by jointly optimizing for task accuracy and fairness: it pulls together instances with the same main task label while pushing apart those sharing a protected attribute (e.g., gender, race). The approach achieves state-of-the-art fairness with minimal computational cost and no performance drop on main tasks across four NLP and vision benchmarks.

ABSTRACT

Trained classification models can unintentionally lead to biased representations and predictions, which can reinforce societal preconceptions and stereotypes. Existing debiasing methods for classification models, such as adversarial training, are often expensive to train and difficult to optimise. In this paper, we propose a method for mitigating bias in classifier training by incorporating contrastive learning, in which instances sharing the same class label are encouraged to have similar representations, while instances sharing a protected attribute are forced further apart. In such a way our method learns representations which capture the task label in focused regions, while ensuring the protected attribute has diverse spread, and thus has limited impact on prediction and thereby results in fairer models. Extensive experimental results across four tasks in NLP and computer vision show (a) that our proposed method can achieve fairer representations and realises bias reductions compared with competitive baselines; and (b) that it can do so without sacrificing main task performance; (c) that it sets a new state-of-the-art performance in one task despite reducing the bias. Finally, our method is conceptually simple and agnostic to network architectures, and incurs minimal additional compute cost.

Motivation & Objective

  • To address bias in neural classifiers that arise from spurious correlations between protected attributes (e.g., gender, race) and task labels.
  • To overcome limitations of existing debiasing methods like adversarial training, which are computationally expensive and hard to optimize.
  • To develop a simple, architecture-agnostic method that reduces bias while maintaining high main task performance.
  • To explore whether contrastive learning can be effectively leveraged to learn fair representations by encouraging similarity within task classes and dissimilarity within protected attribute groups.

Proposed method

  • The method combines a standard cross-entropy loss with two contrastive loss components: one for task label similarity and one for protected attribute dissimilarity.
  • It uses a contrastive objective to maximize similarity between representations of instances sharing the same main task label, regardless of protected attribute.
  • It simultaneously minimizes similarity between representations of instances sharing the same protected attribute but differing in task label.
  • The model is trained end-to-end with a shared encoder, and the protected attribute is used only to guide the contrastive loss, not to fine-tune the embedding function.
  • The approach is agnostic to model architecture and does not add extra parameters, making it lightweight and easy to integrate.
  • The contrastive loss is applied in a self-supervised manner, using data augmentations to create positive and negative pairs for both task and protected attribute views.

Experimental results

Research questions

  • RQ1Can contrastive learning be effectively used to learn fair representations that reduce bias in neural classifiers?
  • RQ2Does combining contrastive losses for task labels and protected attributes improve fairness without degrading main task accuracy?
  • RQ3How does the proposed method compare to adversarial and post-processing debiasing baselines in terms of fairness and performance?
  • RQ4Is the method effective across diverse NLP and computer vision tasks with different data distributions and class structures?
  • RQ5What is the impact of using binary versus multi-class classification settings on the effectiveness of the contrastive debiasing approach?

Key findings

  • The proposed method, Con*, achieves state-of-the-art fairness across all four evaluated tasks—Moji, Hate Speech, Bios, and imSitu—without sacrificing main task accuracy.
  • On the Bios dataset in a binary classification setting (nurse vs. surgeon), Con* reduced GAP from 21.60 (CE m) to 4.88, leakage@h from 98.98 to 85.61, and leakage@ŷ from 93.67 to 85.61, while maintaining high accuracy.
  • In the binary setting, Con* outperformed both INLP and adversarial baselines in reducing gender bias, with a 53% reduction in GAP compared to CE m.
  • The method achieved the best accuracy–fairness trade-off on all four datasets, demonstrating consistent improvements over competitive baselines.
  • Ablation studies confirmed that both contrastive loss components are necessary: removing either one significantly degrades fairness performance.
  • The t-SNE visualization showed that Con* representations cluster by sentiment (main task) while mixing by race (protected attribute), confirming the method’s design goal.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.