fAux: Testing Individual Fairness via Gradient Alignment

Giuseppe Castiglione, Ga Wu, Christopher Srinivasa, Simon PrincearXiv 2022

Abstract

Machine learning models are vulnerable to biases that result in unfair treatment of individuals from different populations. Recent work that aims to test a model's fairness at the individual level either relies on domain knowledge to choose metrics, or on input transformations that risk generating out-of-domain samples. We describe a new approach for testing individual fairness that does not have either requirement. We propose a novel criterion for evaluating individual fairness and develop a practical testing method based on this criterion which we call fAux (pronounced fox). This is based on comparing the derivatives of the predictions of the model to be tested with those of an auxiliary model, which predicts the protected variable from the observed data. We show that the proposed method effectively identifies discrimination on both synthetic and real-world datasets, and has quantitative and qualitative advantages over contemporary methods.

Introduction

Ensuring individual fairness—the principle that similar individuals should receive similar outcomes—is critical as machine learning (ML) models are increasingly deployed in high-stakes domains like credit scoring and policing. However, auditing models for individual fairness remains challenging. Traditional approaches like Fairness Through Unawareness (FTU) fail to account for proxy variables, while Fairness Through Awareness (FTA) requires subjective domain-specific similarity metrics. Counterfactual Fairness (CFF) methods often rely on complex generative models (e.g., GANs) that are difficult to train and may produce out-of-distribution samples.

Causal structures illustrating data generation and the distinction between fair and unfair models.

Methodology: Gradient Alignment via Auxiliary Models

The fAux framework introduces the Local Independence Criterion (LIC) to evaluate individual fairness without requiring explicit similarity metrics or generative models. The core intuition is that if a model is fair, its predictions should be independent of changes in the input that only affect the protected variable.

To implement this, fAux utilizes an auxiliary model trained to predict the protected variable from the input features. By comparing the gradients of the target model with those of the auxiliary model, fAux can detect sensitivity to protected characteristics. If the gradients are parallel and large, the model is likely unfair, as changes in the input that shift the protected variable also shift the prediction. Conversely, if the gradients are orthogonal or near zero, the model satisfies the LIC.

Gradient alignment between the target model (a) and the auxiliary model (b). Parallel gradients indicate potential bias.

The authors also propose variants such as fAux+NG (Normalized Gradients) to handle feature scaling and fAux+IG (Integrated Gradients) for improved stability.

Evaluation and Results

The researchers evaluated fAux using synthetic datasets with controllable bias levels and three real-world datasets: Adult Income (gender), Bank Marketing (age), and Chicago SSL (race). On synthetic data, fAux+NG achieved near-perfect Average Precision (often 0.99+), outperforming traditional similarity-based tests. On real-world data, fAux effectively distinguished between fair (adversarially regularized) and unfair models.

Key Advantages

  • Efficiency: fAux is computationally lightweight, requiring roughly 5% of the parameters and 10% of the training time of GAN-based methods like FlipTest.
  • Proxy Detection: By learning the relationship between features and protected variables, the auxiliary model automatically identifies proxy discrimination without manual feature specification.
  • Robustness: The method remains stable across various data fusion techniques where generative models often struggle.

Discussion and Limitations

While fAux offers a scalable solution for fairness testing, it has specific requirements and boundaries. It requires access to protected variables during the testing phase to train the auxiliary model. Additionally, as a first-order method based on Taylor expansion, it primarily captures local bias; future work may explore higher-order expansions to detect non-local discriminatory patterns. Finally, human interpretation remains necessary to determine if flagged proxies have legitimate business justifications (e.g., hours worked correlating with gender but being valid for income prediction).

Summary updated

BibTeX
@misc{castiglione2022faux,
  author = {Giuseppe Castiglione and Ga Wu and Christopher Srinivasa and Simon Prince},
  title = {{fAux: Testing Individual Fairness via Gradient Alignment}},
  year = {2022},
  eprint = {2210.06288},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.06288},
}
Figure