Contrastive fairness in machine learning

Tapabrata Chakraborti, Arijit Patra, J. Alison Noble

Abstract

Was it fair that Harry was hired but not Barry? Was it fair that Pam was fired instead of Sam? How can one ensure fairness when an intelligent algorithm takes these decisions instead of a human? How can one ensure that the decisions were taken based on merit and not on protected attributes like race or sex? These are the questions that must be answered now that many decisions in real life can be made through machine learning. However research in fairness of algorithms has focused on the counterfactual questions "what if?" or "why?", whereas in real life most subjective questions of consequence are contrastive: "why this but not that?". We introduce concepts and mathematical tools using causal inference to address contrastive fairness in algorithmic decision-making with illustrative examples.

Introduction: Moving Beyond "What If"

Most research in algorithmic fairness focuses on population-level metrics (e.g., Demographic Parity) or counterfactual questions (e.g., "Would I have been hired if I were a different race?"). However, real-world grievances are often contrastive: "Why was Harry hired, but Barry was not?"

Fairness is inherently a comparison. Current models often rely on "fairness through unawareness" (simply removing protected attributes) or population-level assumptions that fail at the individual level. For instance, a latent variable like "access to a library" might be independent of race across a whole population but highly correlated with race for a specific individual. This paper addresses the gap between broad statistical fairness and the nuanced, comparative fairness required for individual justice.

Methodology: Structural Causal Models and Contrastive Questions

The authors build their framework on Structural Causal Models (SCM) and do-calculus. They define three specific types of contrastive questions:

  1. D-contrast (Decision): Why did individual $I$ receive decision $D$ instead of $D'$?
  2. I-contrast (Individual): Why did individual $I$ receive decision $D$ while individual $J$ received $D'$?
  3. T-contrast (Time): Why did individual $I$ receive decision $D$ at time $t$, but $D'$ at time $t'$?
Structural Causal Model (SCM) illustrating the causal dependencies between protected attributes (Race, Sex), observed features (GPA, LSAT), and the target outcome (FYA).

The core innovation is that for a decision to be fair, the predicted probability of the chosen outcome must be higher than the alternative, even when protected attributes are counterfactually intervened upon. To handle complex, non-linear biases, the authors suggest using deep neural representations. By recasting the fairness problem as a cost function that minimizes the difference between actual and counterfactual predictions, they can "cancel out" factors independent of protected attributes, isolating the bias more effectively.

Case Study: The LSAC Dataset

The authors validated their approach using the Law School Admission Council (LSAC) dataset, comprising 21,790 law students across 163 U.S. law schools. The goal was to predict the First Year Average (FYA) grade point average while ensuring the prediction is not biased by protected attributes like race and sex.

Comparison between the observed causal graph (left) and the counterfactual model (right) where latent error terms (epsilon) are used to isolate merit from protected attributes.

As shown in the causal graphs, observed features like GPA and LSAT are descendants of protected attributes. By modeling the latent "noise" or error terms (epsilon_G, epsilon_L, epsilon_F), the contrastive approach can identify the underlying merit that is independent of race or sex.

Key Results and Insights

The authors compared their contrastive approach against several baselines using logistic regression on the LSAC dataset:

Model Average Accuracy (%)
Full (All features, high bias) 0.873
Unaware (Protected attributes removed) 0.894
Counterfactual Fairness 0.918
Contrastive Fairness 0.937

The results demonstrate that the contrastive approach not only maintains fairness but actually improves predictive accuracy over standard counterfactual methods. This suggests that by better modeling individual-level causal links, the algorithm becomes a more robust predictor.

Conclusion

Contrastive fairness ensures that discrimination happens on "fair grounds"---merit rather than protected status. While challenges remain in selecting appropriate distance metrics for similarity and managing the trade-offs between fairness and performance, this framework provides the theoretical and mathematical foundations for more ethical algorithmic decision-making. Future work will treat these trade-offs as a multi-objective Pareto front optimization, prioritizing fairness in high-stakes environments.

Summary updated

Abstract

Was it fair that Harry was hired but not Barry? Was it fair that Pam was fired instead of Sam? How can one ensure fairness when an intelligent algorithm takes these decisions instead of a human? How can one ensure that the decisions were taken based on merit and not on protected attributes like race or sex? These are the questions that must be answered now that many decisions in real life can be made through machine learning. However, research in fairness of algorithms has focused on the counterfactual questions “what if?” or “why?”, whereas in real life most subjective questions of consequence are contrastive: “why this but not that?”. We introduce concepts and mathematical tools using causal inference to address contrastive fairness in algorithmic decision-making with illustrative examples.
BibTeX
@article{chakraborti2020contrastive,
  author = {Tapabrata Chakraborti and Arijit Patra and J. Alison Noble},
  title = {{Contrastive fairness in machine learning}},
  journal = {Letters},
  year = {2020},
  doi = {10.1109/locs.2020.3007845},
}
Figure