Fair Classification
Criteria, impossibility theorems and interventions.
Group fairness criteria are conditional independence statements, and conditional independence has a logic of its own. This lesson proves which criteria exclude each other, proves the Kleinberg–Mullainathan–Raghavan impossibility theorem, and then turns to what can be done: optimal post-processing, reweighing and reductions with guarantees, fairness for individuals and counterfactuals, and the finding that static constraints can harm the very groups they aim to protect.
What you’ll learn
- State independence, separation and sufficiency, and prove their pairwise incompatibilities together with the conditions under which they hold.
- Prove the Kleinberg–Mullainathan–Raghavan theorem and describe its approximate version.
- Derive optimal post-processing for equalized odds as the minimization of a linear loss over the intersection of the groups' ROC convex hulls, and explain reweighing, learned representations and the reductions approach.
- Contrast group criteria with individual fairness, counterfactual fairness and multicalibration, and explain the delayed-impact results.
Three criteria as independence statements
(1) Independence and sufficiency together make independent of the pair , hence of :
(2) Write . Separation lets the class-conditional score laws drop the group; independence says the mixture does not depend on :
Two groups with then force for every : the score carries no information about , contradicting .
(3) For strictly positive distributions, conditional independence has the intersection property: and together imply , and so , a contradiction. Without positivity the property can fail; the canonical exception is perfect prediction, , which satisfies both criteria.
A risk score is calibrated within each group, and the groups' base rates differ. Can its distribution also be the same in both groups?
- Yes, if the score is accurate enough
- Yes, by adding noise to the scores of one group
- Only if the score is a constant
- No: calibration gives sufficiency, and sufficiency with independence would force equal base rates
Show the answer
D. No: calibration gives sufficiency, and sufficiency with independence would force equal base rates
Part (1) of the theorem: and imply , so the base rates would be equal. Even a constant score cannot escape: calibrated within groups, it would have to equal each group's base rate, which then differ.
The Kleinberg–Mullainathan–Raghavan theorem
In group , with people of whom are expected to be positive, calibration says that in every bin the expected number of positives equals the total score in that bin. Summing over bins:
Let be the average score of negatives and that of positives. By balance, and are the same in both groups. Splitting the total score into negatives and positives gives one linear equation per group:
Each equation is a line in the plane passing through , since . Equal base rates give the same line, so the equations do not conflict (a single bin with score for everyone satisfies all three conditions). Different base rates give two distinct lines, which meet only at : negatives score 0 and positives score 1 on average, which with scores in means perfect prediction.
The theorem is about scores, but the same tension holds for binary decisions (Chouldechova's identity in Fairness, Interpretability & Causality). Pleiss, Raghavan, Wu, Kleinberg & Weinberger (2017) asked what survives if one relaxes to calibration plus a single error-rate constraint, such as equal false-negative rates: it is achievable, but any algorithm achieving it is no better than taking an existing calibrated classifier and randomizing a fraction of its predictions for one group. Calibration and error-rate balance are, in this precise sense, at odds.
Optimal post-processing
Hardt, Price & Srebro (2016) asked for the best predictor that satisfies equalized odds and is derived from an existing score and the group alone. For group , every threshold on gives a point on that group's ROC curve, and flipping a biased coin between two thresholds gives any point on the segment between them. So the achievable rates for group form , the convex hull of its ROC curve. Equalized odds requires one common point in every , and the expected loss is linear in it:
For a binary predictor each hull is a quadrilateral and the problem is a linear program in four variables. For a score the problem stays convex (a linear program when there are finitely many thresholds), and each group uses a threshold or a randomized mixture of two. Equal opportunity constrains only : with continuous scores whose ROC curves are concave, as for a score calibrated within each group, each group just needs its own deterministic threshold.
The widget's data show what randomization buys (our computation on its applicants, with its whole-number thresholds). Group B's ROC hull lies inside A's, so the intersection of the hulls is B's hull, and the best common operating point is B's own vertex at threshold 58, with false-positive rate 14.3% and true-positive rate 56.7%. Group B reaches it with a plain threshold; group A, whose curve passes far above that point, must mix two thresholds to land on it. Overall accuracy is 74.1% with exactly equal rates, against 67.3% for the best deterministic pair within 2 points. The price is paid by A: its accuracy falls from 86.0% to 71.2% while B's stays at 77.0%, close to B's best of 77.5%. Post-processing cannot lift the poorly measured group above its own ROC curve, so equalizing error rates degrades predictions for the well-measured group instead, a form of "leveling down". Hardt, Price & Srebro present this as shifting the cost of poor classification from the disadvantaged group to the decision-maker, who can respond by improving the classification accuracy.
Corbett-Davies, Pierson, Feller, Goel & Huq (2017) made the decision-theoretic version precise: the unconstrained utility-maximizing rule is a single threshold on calibrated risk for everyone, while the optimal rules under several fairness constraints use group-specific thresholds. A constraint that binds lowers the objective it overrides, and their study of pretrial decisions found that this trade-off can be large in practice.
Reweighing (Kamiran & Calders, 2012) gives each training example the weight . Group is half the data, 30% of its members are positive, and 40% of all examples are positive. What weight does a positive example from group receive?
Show the answer
1.33
, so . Under the weights, the joint law becomes : group and label are independent in the reweighted data, so a learner fitted to it is pushed toward demographic parity, while each example keeps its features and label.
Pre-processing and in-processing
Pre-processing changes the data. Besides reweighing, Zemel, Wu, Swersky, Pitassi & Dwork (2013) learned a representation, a soft assignment of each example to a set of prototypes, by minimizing a weighted sum of three losses: one making the two groups' distributions over prototypes equal, one preserving information about the inputs, and one keeping the representation predictive of the label. A downstream classifier that sees only the prototype inherits parity, but only to the extent that the penalty achieved it: parity is one term in a trade-off, not a hard constraint, and a model that also uses other features gets no guarantee.
In-processing changes the learning problem. The reductions approach of Agarwal, Beygelzimer, Dudík, Langford & Wallach (2018) writes many criteria, including demographic parity and equalized odds, as linear constraints on conditional moments of a randomized classifier , and solves the saddle-point problem of the Lagrangian:
For fixed the inner minimization is a cost-sensitive classification problem, which any standard learner can solve, while is updated by exponentiated gradient. If the classifier family has Rademacher complexity of order (with for most families, including those of finite VC dimension), the returned randomized classifier has error within of the best fair randomized classifier and violates each constraint by at most , where counts the training examples in the subgroup the constraint concerns (a group, or a group and label), with high probability.
| Stage | Method | Needs at prediction time | Guarantee |
|---|---|---|---|
| Pre-processing | reweighing; learned fair representations | nothing extra | group and label independent in the reweighted data, or approximate parity of the representation; nothing about a downstream model's predictions or errors |
| In-processing | reductions (exponentiated gradient over a cost-sensitive learner); constrained losses | a randomized classifier | near-optimal error among fair randomized classifiers, up to |
| Post-processing | group-specific (randomized) thresholds on a score | the group attribute | optimal among predictors derived from the score; optimal overall if the score is Bayes-optimal |
Beyond group averages
Group criteria constrain averages and can be satisfied while individuals are treated arbitrarily: a classifier can meet parity by approving the most qualified members of one group and random members of the other. Several notions aim deeper.
- Individual fairness (Dwork, Hardt, Pitassi, Reingold & Zemel, 2012): similar individuals should be treated similarly. Map each individual to a distribution over outcomes and require the Lipschitz condition for a task-specific similarity metric . Maximizing utility under the constraint is a linear program. Everything rests on the metric, which someone must specify and defend.
- Counterfactual fairness (Kusner, Loftus, Russell & Silva, 2017): given a causal model with background variables , a predictor is counterfactually fair if, for every individual, its distribution would be the same had the individual's group been different: . It requires committing to a causal model of how the group affects the features.
- Many groups at once. Fairness on two groups can hide unfairness on their intersections ("fairness gerrymandering"). Kearns, Neel, Roth & Wu (2018) demanded statistical parity, or equal false-positive rates, for every subgroup in a rich class defined by functions of the protected attributes, and showed that auditing this is equivalent to weak agnostic learning, hard in the worst case but tractable with learning oracles. Multicalibration (Hébert-Johnson, Kim, Reingold & Rothblum, 2018) asks for calibration on every subgroup identifiable by a class of computations; the authors show that in many settings it is attainable and aligned with the goal of accurate prediction.
Key takeaways
- Independence (), separation () and sufficiency () are pairwise incompatible when base rates differ, outside degenerate cases; the proofs are two lines of probability and the intersection property.
- Kleinberg–Mullainathan–Raghavan: calibration within groups plus balance for both classes forces equal base rates or perfect prediction, because each group's constraint is a line through ; approximate versions hold too.
- Optimal post-processing for equalized odds minimizes a linear loss over the intersection of the groups' ROC hulls (a linear program for a binary predictor), with randomized thresholds; it loses nothing if the score is Bayes-optimal, and on unequally informative scores it equalizes by degrading the better-measured group.
- Reweighing makes group and label independent in the training data; reductions solve fair classification with cost-sensitive learners and exponentiated gradient, to within .
- Individual fairness needs a similarity metric, counterfactual fairness a causal model, and subgroup fairness rich classes; static constraints can cause long-term harm.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Base rates differ between two groups, and every combination of group, score and outcome has positive probability. Can a score satisfy separation and sufficiency at the same time?
- Yes, if it is calibrated within groups
- Yes, if it is accurate enough
- No: by the intersection property the two together would make the group independent of the outcome
- Only if the groups have the same size
Show the answer
C. No: by the intersection property the two together would make the group independent of the outcome
For strictly positive distributions, and imply , hence equal base rates. Perfect prediction escapes only because it violates positivity.
Suppose a risk assignment is calibrated within groups and balanced for both classes, in groups with base rates 0.6 and 0.2. What must the average scores of negatives and positives be?
- No such assignment exists
Show the answer
C.
Each group gives a line through ; with the lines are distinct and meet only at . An assignment exists only in the perfect-prediction case, where it is forced to this point.
In Hardt, Price & Srebro's post-processing for equalized odds, why may one group's predictor be randomized?
- To hide the group attribute from the decision-maker
- To reach a common (FPR, TPR) point that lies strictly below that group's ROC curve, which no single threshold attains
- Because randomization always increases accuracy
- To satisfy demographic parity as well
Show the answer
B. To reach a common (FPR, TPR) point that lies strictly below that group's ROC curve, which no single threshold attains
The common operating point must lie in every group's ROC hull. For the group with the better ROC curve it is typically an interior point, reachable only as a mixture of two thresholds.
In the one-step lending model of Liu et al. (2018), how can a demographic parity constraint harm the disadvantaged group?
- By approving too few of its members
- It cannot: fairness constraints only help the protected group
- By lowering the lender's profit
- By approving so many of its members that the resulting defaults lower the group's average credit score
Show the answer
D. By approving so many of its members that the resulting defaults lower the group's average credit score
Approvals change scores: repayment raises them, default lowers them. Forcing equal approval rates can push the threshold for the disadvantaged group so low that the expected change in its average score turns negative, an "active harm" the unconstrained policy would not cause.
Further reading
- J. Kleinberg, S. Mullainathan & M. Raghavan, "Inherent trade-offs in the fair determination of risk scores," Innovations in Theoretical Computer Science (ITCS) (2017).
- M. Hardt, E. Price & N. Srebro, "Equality of opportunity in supervised learning," Advances in Neural Information Processing Systems 29 (2016).
- A. Agarwal, A. Beygelzimer, M. Dudík, J. Langford & H. Wallach, "A reductions approach to fair classification," ICML (2018).
- C. Dwork, M. Hardt, T. Pitassi, O. Reingold & R. Zemel, "Fairness through awareness," Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, 214–226 (2012).
- S. Barocas, M. Hardt & A. Narayanan, Fairness and Machine Learning: Limitations and Opportunities (MIT Press, 2023).