Fair Bayesian Optimisation

Description

Fair Bayesian Optimisation (FairBO) tunes a model's hyperparameters, the settings fixed before training such as tree depth or regularisation strength, to find the most accurate model that also meets a fairness threshold chosen in advance, for example a difference in positive-prediction rates between two groups of at most 0.05. Because it only changes hyperparameters and retrains, it treats the model and its training pipeline as a black box, so it works with any model class and any group fairness metric, can enforce several metrics at once, and returns a model that need not use the protected attribute at prediction time (the attribute is still needed to measure fairness during the search). Each step trains a model with a candidate configuration and measures its validation accuracy and fairness, and two Gaussian processes (statistical models that predict a value together with its uncertainty) are fitted to the results of the configurations tried so far. The next configuration is the one with the highest expected improvement in accuracy weighted by the predicted probability of meeting the fairness constraint; until a fair configuration has been found, the search maximises that probability alone. The output is the best configuration that met the constraint, with its accuracy and fairness measurements.

Example Use Cases

Fairness

A lender's model risk team tunes a gradient-boosted credit-risk model under a constraint that the approval-rate difference between applicants of different nationality stays at or below 0.05. It records the most accurate configuration that met the constraint beside the result of unconstrained tuning, so the model approval committee can see what accuracy the constraint cost.

An HR analytics team at a large employer tunes a random forest that ranks job applications for interview, enforcing limits on the gender gap in true positive rates and on the gap in shortlisting rates at the same time, because its policy commits to both equal opportunity and comparable shortlisting rates.

A data science team at a health insurer already runs an adversarially debiased claims-triage model whose fairness changed sharply with its learning rate and adversary weight. It uses FairBO to tune those hyperparameters under a statistical parity constraint, rather than tuning them for accuracy alone and checking fairness afterwards.

A local authority building a model to prioritise benefit-fraud reviews cannot use ethnicity as an input at decision time. It holds ethnicity only in a validation extract, uses FairBO to select hyperparameters that keep the referral-rate gap within its equality impact assessment threshold, and then confirms the gap on a separate held-out sample before deployment.

Limitations

  • It can only reach fairness that some hyperparameter setting already provides. If no configuration in the search space meets the threshold, it returns no fair model. The originating paper found that regularisation hyperparameters (tree depth, weight penalties, learning rate) have the largest effect on fairness, so a search space without them leaves fewer fair options.
  • The fairness metric and its threshold must be fixed before the search, and the result says nothing about metrics that were not constrained. Choosing them is a normative decision the method does not make. If decision-makers need to see the whole accuracy-fairness trade-off before picking a threshold, a multi-objective search is needed, which the paper found slower to reach a model meeting a given threshold.
  • A constraint can be met by a model that barely distinguishes between anyone. The paper argues that as regularisation grows, predictions approach a constant and satisfy every group fairness metric, and in its example run on the Adult dataset (random forest, parity gap at most 0.05) random search found fair models only at the accuracy of always predicting the majority class. Check accuracy and error rates within each group, not only the fairness gap, before accepting the result.
  • Every step trains a full model, so the cost is the training cost multiplied by the number of evaluations (the paper used up to 100), which is expensive for large models. The fairness value guiding the search is estimated on the validation split used during tuning, so it carries sampling error that is large when a group is small; confirm the gap on held-out data before relying on it.
  • It has little evidence behind it and no maintained implementation. The paper tests only binary classification with a binary protected attribute on three tabular datasets, leaving regression, image and language tasks to future work. The code shipped in AutoGluon 0.3.1 (2021) and was dropped in 0.4.0; Syne Tune moved it to a legacy folder in 0.14 and removed it in 0.15 (December 2025), though its documentation still describes it. Use means pinning an old release or rebuilding it.

Resources

Research Papers

Fair Bayesian Optimization
Valerio Perrone et al.•Jan 1, 2021

Given the increasing importance of machine learning (ML) in our lives, several algorithmic fairness techniques have been proposed to mitigate biases in the outcomes of the ML models. However, most of these techniques are specialized to cater to a single family of ML models and a specific definition of fairness, limiting their adaptibility in practice. We introduce a general constrained Bayesian optimization (BO) framework to optimize the performance of any ML model while enforcing one or multiple fairness constraints. BO is a model-agnostic optimization method that has been successfully applied to automatically tune the hyperparameters of ML models. We apply BO with fairness constraints to a range of popular models, including random forests, gradient boosting, and neural networks, showing that we can obtain accurate and fair solutions by acting solely on the hyperparameters. We also show empirically that our approach is competitive with specialized techniques that enforce model-specific fairness constraints, and outperforms preprocessing methods that learn fair representations of the input data. Moreover, our method can be used in synergy with such specialized fairness techniques to tune their hyperparameters. Finally, we study the relationship between fairness and the hyperparameters selected by BO. We observe a correlation between regularization and unbiased models, explaining why acting on the hyperparameters leads to ML models that generalize well and are fair.

Software Packages

Syne Tune v0.13.0: constrained Bayesian optimisation searcher (ConstrainedGPFIFOSearcher)

Large scale and asynchronous Hyperparameter and Architecture Optimization at your fingertips. - syne-tune/syne-tune

AutoGluon v0.3.1: constrained GP FIFO searcher (constrained_bayesopt)

Fast and Accurate ML in 3 Lines of Code. Contribute to autogluon/autogluon development by creating an account on GitHub.

Tutorials

Fair Bayesian Optimization (AutoGluon 0.3.1 tutorial)

Tags

Fairness Dimensions

Other Categories

Data Type:
Evidence Type:
Expertise Needed:
Technique Type: