Abstract
As recent literature has demonstrated how classifiers often carry unintended biases toward some subgroups, deploying machine learned models to users demands careful consideration of the social consequences. How should we address this problem in a real-world system? How should we balance core performance and fairness metrics? In this paper, we introduce a MinDiff framework for regularizing classifiers toward different fairness metrics and analyze a technique with kernel-based statistical dependency tests. We run a thorough study on an academic dataset to compare the Pareto frontier achieved by different regularization approaches, and apply our kernel-based method to two large-scale industrial systems demonstrating real-world improvements.
Introduction
Machine learning models often inadvertently learn societal biases present in training data, leading to "unintended bias." For example, a toxicity detector might unfairly flag comments from specific demographic subgroups more often than others, even when the content is benign. The challenge for engineers is the performance-fairness trade-off: making a model "fairer" typically involves a penalty that degrades its accuracy.
Existing solutions often fall into two camps. Simple correlation-based penalties are easy to implement but limited, as they don't guarantee statistical independence. Conversely, adversarial training is powerful but notoriously unstable in production environments. We propose MinDiff, a lightweight regularization framework that uses Maximum Mean Discrepancy (MMD) to achieve a mathematically rigorous yet stable "middle way."
Methodology: The MinDiff Framework
The core idea of MinDiff is to add a specialized "fairness loss" to the standard training objective:
$$Loss = L_{primary} + \lambda \cdot \text{MinDiffLoss}$$
The MinDiff term penalizes the model when its predictions for a "protected" subgroup look different from the "majority" group on negative examples. Our key innovation is using MMD as the MinDiff loss. MMD uses kernels (e.g., Gaussian or Laplace) to map prediction distributions into a high-dimensional space. Unlike simple correlation, which only looks at mean and variance, MMD can detect differences across the entire shape of the distribution, ensuring that the False Positive Rate (FPR) is truly equalized—a concept known as Equality of Opportunity.
Experimental Evaluation
We validated MinDiff on the UCI Adult dataset, predicting income levels with "sex" as the sensitive attribute. The results demonstrate that correlation-based fairness penalties hit a "floor"; they cannot achieve true statistical independence.
As shown in Figure 1, MMD shifts the Pareto frontier. For any given level of accuracy loss, MMD provides a significantly fairer model. On this benchmark, MMD reached an FPR gap below 0.01 while maintaining >83% accuracy, whereas correlation-based methods could not push the gap below 0.02 without a sharp drop in accuracy.
Industrial Applications
We applied MinDiff to two large-scale production systems:
- Industrial Classifier: MMD improved the fairness ratio gap by 45% compared to previous correlation-based approaches, with neutral impact on primary performance.
- Recommender System: In a production ranking environment, we applied MinDiff to ensure the system doesn't under-rank items for specific subgroups.
As illustrated in Figure 4, MMD reduced the ranking accuracy gap between subgroups by 65% over the correlation method, bringing the performance of the protected group closer to the majority across all satisfaction levels.
Discussion and Conclusion
While MMD is highly effective, it introduces hyperparameter sensitivity, particularly regarding the fairness weight ($\lambda$) and the kernel length. We found a "sweet spot" for kernel length that roughly corresponds to the standard deviation of the model's predictions.
MinDiff is production-ready and lightweight, integrating easily into existing gradient-descent pipelines. Future work will explore adapting this framework to other fairness definitions, such as demographic parity or equalized odds across all labels. By shifting the Pareto frontier, MinDiff allows practitioners to achieve better social outcomes without compromising system utility.
Summary updated