Fairness-Aware Machine Learning

Machine Learning
Introduced by
Moritz Hardt, Eric Price & Nati Srebro
Year
2016
Type
Constrained supervised learning framework
Family
Trustworthy ML

What does it do?

Fairness-Aware Machine Learning is a family of techniques that train, constrain, or post-process predictive models so that their error rates or outcomes are comparable across protected demographic groups such as race, gender, or age.

The equalized odds and equality of opportunity criteria were formalized by Moritz Hardt, Eric Price, and Nati Srebro in their 2016 NeurIPS paper, which also proposes a post-processing approach based on group-specific decision rules.

The intuition behind the method

Consider two applicants with identical qualifications who belong to different demographic groups. A fair classifier should identify a qualified applicant as suitable at similar rates regardless of group. Fairness-aware methods check whether the model's true positive and false positive rates differ across groups, and where they do, they can set a separate decision threshold for each group so that the remaining gap falls within an agreed tolerance. The adjustment changes how decisions are made from the same score, so its effect on overall accuracy has to be measured and reported.

History

Hardt, Price, and Srebro (2016) introduced the equalized odds and equality of opportunity criteria and a post-processing procedure that assigns group-specific thresholds to meet them. Later work extended the area to in-processing constraints, pre-processing reweighting, and causal approaches to fairness.

When to use it

Consider Fairness-Aware ML when a predictive model's decisions affect individuals in legally or ethically protected groups, such as credit scoring, hiring, medical triage, or recidivism prediction. The post-processing approach described here needs the sensitive attribute at prediction time, because each group is assigned its own threshold, and stakeholders must agree on which fairness criterion to enforce. It is a poor fit when the protected attribute cannot be recorded or used legally, when the chosen criteria conflict for the data at hand, or when there are too few labeled examples per group to estimate group-level error rates reliably. In those cases, in-processing constrained optimization or pre-processing reweighting may be more suitable.

Limitations and considerations

  • Equalized odds, calibration, and demographic parity cannot in general be satisfied together when base rates differ across groups, so practitioners must choose which criterion to enforce.
  • Group-specific thresholds require the sensitive attribute at prediction time, which may be legally restricted or practically unavailable.
  • Equalizing error rates across groups does not guarantee individual fairness; two similar individuals from different groups may still receive different decisions.
  • Enforcing constraints on small protected subgroups can reduce overall accuracy and creates a trade-off that must be justified to stakeholders.
  • The method assumes that the validation and test data are representative of the deployment population and that the protected attribute is recorded correctly; errors in either shift the estimated group error rates.
  • Estimating true and false positive rates for each group requires enough labeled positive and negative cases in every group. With small samples, the fairness gap carries wide sampling uncertainty and can appear compliant or non-compliant by chance.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • The fairness gap is defined by a named criterion and can be measured directly on held-out data, with the tolerance epsilon making the target explicit.
  • The post-processing step works on the output scores of any existing classifier, so the base model does not need to be retrained.
  • The accuracy-fairness trade-off is visible because tightening epsilon can be tested and its effect on accuracy reported.
  • The literature on the incompatibility of fairness criteria gives a principled basis for deciding which criterion to enforce.

Applications

  • Credit scoring and loan approval systems regulated under equal credit opportunity laws.
  • Automated resume screening and candidate ranking in human resources.
  • Pretrial risk assessment and recidivism prediction in criminal justice.
  • Medical diagnosis support tools where demographic disparities in care quality exist.
  • Ad-targeting and content recommendation platforms subject to anti-discrimination norms.

How it works

How it works

1

Before training, a formal fairness criterion is chosen. Equalized odds requires that the classifier's true positive rate and false positive rate are equal across all values of the sensitive attribute A, so that neither group is systematically advantaged or penalized by the model's errors.

Formula
\text{Equalized Odds: } P(\hat{Y}=1 \mid A=0, Y=y) = P(\hat{Y}=1 \mid A=1, Y=y), \quad y \in \{0,1\}
2

A standard predictive model is trained on the labeled data by minimizing an empirical loss over a hypothesis class. At this stage the model takes no account of fairness, so its scores may still reflect biases present in the training data.

Formula
\hat{f} = \arg\min_{f \in \mathcal{F}} \mathbb{E}[\ell(f(X), Y)]
3

Group-specific decision rules are chosen on a held-out validation set, one for each value of the sensitive attribute, and applied to the shared score. Their operating points on each group's ROC curve are set so that the error-rate constraints hold within the tolerance epsilon.

Formula
\hat{Y}_a = \mathbf{1}[\hat{f}(X) \geq \tau_a], \quad \tau_a \text{ chosen per group } a \text{ to satisfy fairness constraints}
4

The gap Delta_EO, the absolute difference in true positive rates between groups, is measured on a separate test set and compared with epsilon. Delta_EO is the equal-opportunity gap. The equalized-odds criterion defined above also requires false positive rates to match, so the full check takes the larger of the true positive rate gap and the false positive rate gap and compares it with epsilon. The tolerance epsilon is a policy decision agreed with stakeholders before evaluation, not a statistical cut-off, and a gap of zero on a finite test set is an estimate rather than proof of fairness. Group-wise TPR and FPR should be reported with confidence intervals, and a subgroup with too few positive or negative cases gives unstable estimates that should be flagged rather than read as compliance. If the gap exceeds the tolerance, thresholds are re-optimized, and overall accuracy is reported alongside the fairness result so the trade-off is visible.

Formula
\Delta_{EO} = |TPR_{A=0} - TPR_{A=1}|, \quad \Delta_{EO} \leq \epsilon

Common pitfalls

  • Choosing a fairness criterion without stakeholder agreement can move the disparity to a different metric rather than remove it.
  • Checking only one protected attribute at a time can hide discrimination against intersectional subgroups, such as Black women considered apart from Black men and white women.
  • Fitting thresholds and evaluating fairness on the same data gives overly optimistic estimates; a separate held-out set is needed for the evaluation.
  • Group-specific thresholds fitted on past data can drift as the population changes, so the fairness gap should be re-measured after deployment.

Frequently asked questions

Can a model satisfy equalized odds and calibration at the same time?

In general, no. These two criteria cannot both be satisfied when base rates differ between groups, except in degenerate cases such as a perfect predictor. Practitioners therefore need to choose the criterion that fits their ethical and legal context.

Does removing the sensitive attribute from the feature set make the model fair?

Rarely. Other features, such as zip code, surname, or browsing history, can act as proxies for the sensitive attribute, so the model can recover and use demographic information indirectly. This is sometimes called redundant encoding, which is why fairness has to be enforced explicitly rather than assumed from removing the attribute.

Is post-processing or in-processing the better approach?

It depends on context. Post-processing (Hardt et al. 2016) works on the output scores of any classifier and is straightforward to audit, which suits cases where the base model cannot be retrained. In-processing methods add fairness constraints during training and may give better accuracy-fairness trade-offs, but they require access to the training pipeline and are specific to the model class.

Related methods

Sources

  1. Hardt, M., Price, E., & Srebro, N. (2016). Equality of opportunity in supervised learning. Advances in Neural Information Processing Systems, 29.

    Open publication reference