MMD-B-Fair: Learning Fair Representations with Statistical Testing

Namrata Deka, Danica J. Sutherland

Abstract

We introduce a method, MMD-B-Fair, to learn fair representations of data via kernel two-sample testing. We find neural features of our data where a maximum mean discrepancy (MMD) test cannot distinguish between different values of sensitive attributes, while preserving information about the target. Minimizing the power of an MMD test is more difficult than maximizing it (as done in previous work), because the test threshold’s complex behavior cannot be simply ignored. Our method exploits the simple asymptotics of block testing schemes to efficiently find fair representations without requiring the complex adversarial optimization or generative modelling schemes widely used by existing work on fair representation learning. We evaluate our approach on various datasets, showing its ability to hide information about sensitive attributes, and its effectiveness in downstream transfer tasks.

Introduction

Machine learning models often inadvertently learn and amplify societal biases present in training data. To combat this, researchers aim to learn "fair representations"—transformed versions of data that strip away sensitive attributes while keeping the information necessary for the task at hand.

Existing approaches usually fall into two camps: adversarial training (where a discriminator tries to guess the sensitive attribute) and generative modeling. Adversarial methods are notoriously difficult to stabilize and often fail to completely "hide" sensitive info because they are tied to the specific complexity of the discriminator used. MMD-B-Fair addresses these challenges by leveraging the statistical power of kernel two-sample tests in a stable, adversarial-free framework.

Methods: The MMD-B-Fair Framework

The authors introduce MMD-B-Fair, which uses a specific flavor of MMD called a block estimator.

  1. The Power Objective: Instead of just minimizing the raw MMD distance, the method minimizes the statistical power of the test. Power is the probability that a test correctly identifies that two groups are different.
  2. Asymptotic Simplicity: By using "block testing" (dividing data into small chunks), the test statistic follows a predictable normal distribution in large samples. This allows the authors to write a simple, differentiable formula for test power that a neural network can optimize directly.
  3. Minimax without the Headache: To ensure the representation is truly fair, it should be indistinguishable under any kernel. While this sounds like a GAN-style minimax problem, the authors find that using a "grid" of Gaussian kernels with different scales works effectively, avoiding the instability of training a separate adversarial discriminator.
  4. Fairness Variants: The method is flexible enough to target Demographic Parity (making the marginal distributions of groups identical) or Equalized Odds (making distributions identical given the target label).

Experimental Evaluation

The researchers evaluated their method on three standard fairness benchmarks:

  • UCI Adult: Predicting if an individual's income exceeds $50k, with gender as the sensitive attribute.
  • COMPAS: Predicting criminal recidivism, with race as the sensitive attribute.
  • Heritage Health: Predicting a patient's health risk, with age as the sensitive attribute.

Key Results

MMD-B-Fair consistently outperformed baselines like LAFTR and CFAIR across datasets. Specifically, the Equalized Odds version achieved higher accuracy for the same level of fairness.

Figure 1: Fairness-accuracy trade-offs across Adult, COMPAS, and Heritage Health datasets for both Demographic Parity (DP) and Equalized Odds (EO) metrics. MMD-B-Fair variants (blue and red) consistently maintain higher fairness scores across accuracy levels compared to baselines like LAFTR (black).

In "fair transfer" scenarios—where a representation is learned on one task and then used for a new, unseen task—MMD-B-Fair maintained high fairness and accuracy, whereas adversarial methods often saw their fairness "leak" when the task changed.

Figure 4: Detailed view of the Equalized Odds vs. Accuracy trade-off on the COMPAS dataset. MMD-B-Fair (Eq) maintains high fairness (EO) even as accuracy increases, significantly outperforming the LAFTR baseline.

Discussion and Insights

  • Power is a Better Metric than Distance: Minimizing the power of a test is more effective than minimizing the raw MMD value. Because power is bounded between 0 and 1, it provides a more stable signal for the optimizer and doesn't get "drowned out" by the classification loss.
  • The Sensitivity Gap: Two-sample tests are far more sensitive to "attribute leakage" than simple classifiers. A representation might yield random guessing accuracy for a sensitive attribute, yet an MMD test might still show 100% power to distinguish the groups. MMD-B-Fair is designed to satisfy this stricter statistical standard.
  • Adversarial-Free Stability: By using the closed-form asymptotics of block tests, the method achieves the goals of adversarial training without the "cat-and-mouse" instability of training two competing networks.

Conclusion

MMD-B-Fair provides a robust and theoretically grounded approach to learning fair representations. While currently focused on discrete attributes, future work could extend this to continuous attributes using the Hilbert-Schmidt Independence Criterion (HSIC). The method's efficiency and stability make it a promising alternative to complex adversarial or generative schemes in fair machine learning.

Summary updated

BibTeX
@inproceedings{deka2023mmd,
  author = {Namrata Deka and Danica J. Sutherland},
  title = {{MMD-B-Fair: Learning Fair Representations with Statistical Testing}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2023},
  url = {https://openreview.net/forum?id=Yhcv3NYZHS},
}
Figure