AdapFair: Ensuring Continuous Fairness for Machine Learning Operations

Yinghui Huang, Zihao Tang, Xiangyu Chang · DOI

Abstract

In the dynamic environment of Machine Learning Operations (MLOps), models frequently encounter data drift, evolving legal regulations, and shifting fairness requirements. Traditional fairness interventions are often static, requiring expensive retraining or failing when environmental conditions change. This paper introduces AdapFair, an adaptive debiasing framework designed to maintain model fairness and accuracy throughout the deployment lifecycle. By utilizing invertible normalizing flows and Wasserstein distance, AdapFair acts as a "fairness adapter" for black-box classifiers. Our results across diverse benchmarks, including tabular data and high-stakes medical imaging, demonstrate that AdapFair provides robust fairness guarantees with minimal computational overhead and no need to modify underlying model weights.

Introduction

In modern MLOps, a model is never truly "finished." Once deployed, it faces a gauntlet of real-world challenges: data distributions shift, legal landscapes evolve, and new societal expectations for fairness emerge. Most existing fairness techniques are "one-and-done" solutions that break the moment the environment changes. AdapFair addresses this gap by providing a flexible framework designed to keep models fair and accurate without constant, expensive retraining.

The Challenge of Dynamic MLOps

Fairness in machine learning is typically treated as a static problem: a model is trained on a specific dataset and expected to remain fair indefinitely. However, the authors identify three major hurdles in real-world deployment:

  1. Data Drift: A model fair on training data may become biased if the population it encounters during deployment changes (e.g., geographic shifts in hiring tools).
  2. Evolving Requirements: Regulatory changes may demand a shift from one fairness metric (e.g., Demographic Parity) to another (e.g., Equal Opportunity) overnight.
  3. Scalability: Retraining massive state-of-the-art models or proprietary "black-box" systems is often computationally ruinous or technically impossible.
The MLOps lifecycle and the AdapFair framework's approach to maintaining performance and fairness without exhaustive retraining.

The AdapFair Framework

AdapFair functions as a pre-processing adapter placed in front of an existing classifier. Its architecture relies on several key innovations:

  • Pre-processing with Normalizing Flows: AdapFair uses bijective (invertible) transformations. This ensures that while data is "cleaned" of bias, critical predictive information is retained, addressing the classic accuracy-fairness trade-off.
  • Wasserstein Distance Metric: The framework employs Wasserstein distance from Optimal Transport theory to measure unfairness between groups. This provides a more stable and smoother optimization signal than traditional metrics like KL-divergence.
  • Efficient Optimization: By utilizing the sharp Sinkhorn approximation, the authors derive closed-form gradients, making the training of the pre-processor fast and scalable for real-time systems.
  • Black-Box Compatibility: The system only requires the output and input-gradients of the downstream classifier, leaving internal weights untouched.

Experimental Evaluation

The researchers evaluated AdapFair across a diverse range of benchmarks, including tabular datasets (Communities & Crime, Law School), data drift scenarios (Heritage Health, ACS Income), and high-dimensional image data (ISIC skin lesion dataset).

Accuracy vs. fairness trade-offs across different datasets and metrics, comparing AdapFair to baseline methods.

Key Results

  • Superior Robustness: In geographic drift tests (ACS Income), traditional post-processing methods failed as performance collapsed. AdapFair successfully adapted inputs to maintain both high accuracy and low bias.
  • High-Stakes Imaging: On the ISIC skin tone fairness task, AdapFair reduced the demographic parity gap from 0.171 to 0.047 with a negligible accuracy drop of only 0.1%.
  • Dynamic Adaptation: The framework demonstrated the ability to pivot a model to satisfy entirely new fairness metrics without retraining the original classifier.

Conclusion

AdapFair represents a significant step toward trustworthy AI in production. By decoupling fairness from model training, it allows for "attribute-blind" deployment where fairness is maintained even when sensitive attributes are unavailable during inference. While the framework currently requires gradient access to the classifier, future work may extend this adapter approach to even more restricted environments and other areas of AI safety, such as model robustness and explainability.

Summary updated

BibTeX
@misc{huang2024adapfair,
  author = {Yinghui Huang and Zihao Tang and Xiangyu Chang},
  title = {{AdapFair: Ensuring Continuous Fairness for Machine Learning Operations}},
  year = {2024},
  eprint = {2409.15088},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.15088},
}
Figure