Fairness Criteria — Group, Individual, Counterfactual
Fairness has three families, and they define the standard differently. Group fairness asks for equal rates across protected groups on average: demographic parity, equalized odds, conditional use accuracy equality. Individual fairness (Dwork et al. 2012) asks that similar individuals get similar decisions, formalized as a Lipschitz condition on the decision map. Counterfactual fairness (Kusner et al. 2017) asks that a decision stay the same when the person's sensitive attributes are counterfactually altered. Recent work adds three twists. A NeurIPS 2024 result shows an inherent trade-off between counterfactual fairness and accuracy, along with a model-agnostic way to convert an optimal-but-unfair predictor into a counterfactually fair one at bounded accuracy cost. Backtracking counterfactuals (arXiv:2401.13935, January 2024) avoid intervening on legally protected attributes. And an ICLR Blogposts 2024 piece argues that, given a causal graph, satisfying certain group fairness measures entails counterfactual fairness.
Learning Objectives
- State the three group-fairness criteria (demographic parity, equalized odds, conditional use accuracy equality) and one impossibility result.
- Describe individual fairness via the Dwork et al. 2012 Lipschitz formulation.
- Describe counterfactual fairness and its causal-graph dependency.
- Explain backtracking counterfactuals and why they sidestep the intervention-on-protected-attribute problem.
The Problem
Lesson 20 was about measuring bias. This lesson is about defining the fairness standard that measurement should serve. The three families set structurally different standards, so a model can be group-fair and individual-unfair, or counterfactually fair and group-unfair. Choosing a standard is a policy decision.
The Concept
Group fairness
- Demographic parity. P(Y=1 | A=a) = P(Y=1 | A=a') for all groups. Equal acceptance rates.
- Equalized odds. P(Y=1 | Y*=y, A=a) = P(Y=1 | Y*=y, A=a'). Equal TPR and FPR across groups.
- Conditional use accuracy equality. P(Y*=y | Y=y, A=a) = P(Y*=y | Y=y, A=a'). Equal predictive value across groups.
Impossibility (Chouldechova, Kleinberg-Mullainathan-Raghavan 2017): when base rates differ across groups, these three cannot be satisfied simultaneously.
Individual fairness
Dwork et al. 2012. A decision map f is individually fair with respect to a task-specific similarity metric d if |f(x) - f(x')| <= L * d(x, x') for some Lipschitz constant L. Similar individuals get similar decisions.
You have to define d, and that is a policy question, not a statistical one.
Counterfactual fairness
Kusner et al. 2017. A decision is counterfactually fair to individual i if, under a causal model of the population, the decision is unchanged when i's sensitive attributes are counterfactually altered.
This needs a causal DAG, and the DAG is a modeling choice. Counterfactual fairness is only as justified as the DAG behind it.
The CF-vs-accuracy trade-off
A 2024 NeurIPS theory result says counterfactual fairness and predictive accuracy trade off against each other. A model-agnostic method can convert an optimal-but-unfair predictor into a CF one at a bounded accuracy cost, and that cost depends on the magnitude of the sensitive-attribute coefficient in the optimal unfair predictor.
Backtracking counterfactuals
arXiv:2401.13935 (January 2024). Traditional counterfactuals intervene on the sensitive attribute: "would the decision change if this person had been a different gender?" That is legally problematic, because classification law does not allow interventions on protected attributes.
Backtracking counterfactuals flip the direction. Instead of intervening on the attribute, you ask what combination of the individual's actual features would have produced the counterfactual outcome. That sidesteps the legal objection.
Philosophical reconciliation
ICLR Blogposts 2024. With a causal graph in hand, satisfying certain group-fairness measures entails counterfactual fairness. So the three families are not orthogonal. They look like different facets of one underlying causal structure.
This does not resolve the impossibility theorems, since unequal base rates still block simultaneous group fairness. What it shows is that the apparent opposition between "group" and "individual / counterfactual" is partly an artifact of leaving the causal model implicit.
Where this fits in Phase 18
Lesson 20 covers bias measurement and this one covers fairness definition. Lesson 22 is privacy (differential privacy) and Lesson 23 is watermarking. Together they are the allocation-adjacent lessons that complement the deception-adjacent Lessons 7-11.
Use It
code/main.py builds a toy binary-classification dataset with a sensitive attribute and unequal base rates. It trains a simple classifier and computes demographic parity, equalized odds, and conditional use accuracy equality, so you can watch the three metrics disagree. Then it applies a re-weighting aimed at demographic parity, and you can see what that does to the other two.
Ship It
This lesson produces outputs/skill-fairness-criterion.md. Given a fairness claim or policy, the skill identifies which criterion is being claimed, whether the model can satisfy the other criteria under the stated unequal base rates, and which causal DAG the claim depends on.
I'd run main.py first and read the printed gaps before the definitions. The data generator sets the base rate to 0.3 for group 0 and 0.6 for group 1, and a plain logistic classifier trained on it reports demographic parity, equalized odds (TPR and FPR), and conditional use (PPV and NPV) side by side. Seeing all five numbers per group makes the three criteria feel like three different questions about the same predictions.
Pay attention to what the re-weighting does. It scales the loss on positive examples, by 2.0 for group 0 and 0.5 for group 1, and nothing else changes. With the fixed seed, the demographic-parity gap shrinks while the PPV and NPV gaps between the groups get wider. That is the impossibility result at small scale, and I find it more convincing than the statement of the theorem.
Keep the scope of the code in mind. It implements only the group criteria. Individual fairness and counterfactual fairness have no code here, and both depend on choices the toy never makes: a similarity metric d for one, a causal DAG for the other. The sensitive attribute is also passed to the classifier as its third feature, so this model is not blind to it. Exercise 2 is where I'd start if you want to feel the individual-fairness side, because defining d forces the policy question the Concept section talks about.
Exercises
-
Run
code/main.py. Report the three group metrics on the default data. Apply the demographic-parity-targeted re-weighting and re-report. -
Implement the Dwork et al. 2012 individual-fairness metric using L2 on non-sensitive features. Report how many pairs violate Lipschitz with constant L=1.
-
Read Kusner et al. 2017. Construct a simple two-feature causal DAG for resume scoring and identify the counterfactual-fairness condition it implies.
-
The 2024 backtracking-counterfactuals paper avoids intervention on protected attributes. Describe a scenario where this matters for legal compliance.
-
The ICLR 2024 reconciliation argues group and counterfactual fairness are facets of the same structure. Pick two of the three criteria in
code/main.pyand state the causal assumption that would make them equivalent.
Key Terms
| Term | What people say | What it actually means |
|---|---|---|
| Demographic parity | "equal rates" | P(Y=1 |
| Equalized odds | "equal TPR/FPR" | Equal true-positive and false-positive rates across groups |
| Conditional use accuracy | "equal PPV/NPV" | Equal predictive values across groups |
| Individual fairness | "Lipschitz condition" | Similar individuals get similar decisions |
| Counterfactual fairness | "causal alteration invariance" | Decision unchanged under counterfactual attribute alteration |
| Backtracking counterfactual | "explain via actuals" | Counterfactual reasoned backward from outcome, not forward from attribute |
| Impossibility theorem | "the three conflict" | Chouldechova / KMR 2017: group criteria mutually exclusive under unequal base rates |
Further Reading
- Dwork et al.: Fairness through Awareness (arXiv:1104.3913): individual fairness
- Kusner, Loftus, Russell, Silva: Counterfactual Fairness (arXiv:1703.06856): counterfactual fairness
- Chouldechova: Fair prediction with disparate impact (arXiv:1703.00056): impossibility
- Backtracking Counterfactuals (arXiv:2401.13935): new paradigm for protected-attribute interventions
Code
- main.py (python, 138 lines)