Phase 18 · Lesson 21 of 30

Fairness Criteria — Group, Individual, Counterfactual

Three families structure the fairness literature. Group fairness: demographic parity, equalized odds, conditional use accuracy equality — equal rates across protected groups on average. Individual fairness (Dwork et al. 2012): similar individuals receive similar decisions; Lipschitz condition on the decision map. Counterfactual fairness (Kusner et al. 2017): a decision is fair to an individual if it is unchanged when sensitive attributes are counterfactually altered. 2024 theoretical result (NeurIPS 2024): there is an inherent CF-vs-accuracy trade-off; a model-agnostic method converts an optimal-but-unfair predictor into a CF one with bounded accuracy loss. Backtracking counterfactuals (arXiv:2401.13935, January 2024): new paradigm that avoids requiring interventions on legally protected attributes. Philosophical reconciliation (ICLR Blogposts 2024): with causal graphs, satisfying certain group fairness measures entails counterfactual fairness.

Lesson 21 of 30Learn~60 minutesPython (stdlib, three-criteria comparison)

Before this: Lesson 20 of Phase 18 (bias), Phase 02 (classical ML)

On this page

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. Lesson 21 is about defining the fairness standard the measurement should serve. The three families give structurally different standards — a model can be group-fair and individual-unfair, counterfactually fair and group-unfair. Choosing a standard is a policy decision; no standard is universally optimal.

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): these three cannot be satisfied simultaneously under unequal base rates.

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.

Requires defining d. Policy question, not statistical.

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.

Requires a causal DAG. The DAG is a modeling choice. Counterfactual fairness is only as justified as the DAG.

The CF-vs-accuracy trade-off

NeurIPS 2024 theoretical: there is an inherent trade-off between counterfactual fairness and predictive accuracy. A model-agnostic method can convert an optimal-but-unfair predictor into a CF one, at a bounded accuracy cost. The accuracy cost depends on the magnitude of the sensitive-attribute coefficient in the optimal unfair predictor.

Backtracking counterfactuals

arXiv:2401.13935 (January 2024). Traditional counterfactuals require interventions on the sensitive attribute — "would the decision change if this person had been a different gender." Legally, this is problematic: protected attributes cannot be intervened on in classification law.

Backtracking counterfactuals flip the direction: instead of intervening on the attribute, ask what combination of the individual's actual features would have produced the counterfactual outcome. This sidesteps the legal objection.

Philosophical reconciliation

ICLR Blogposts 2024. With a causal graph in hand, satisfying certain group-fairness measures entails counterfactual fairness. The three families are not orthogonal; they are different facets of the same underlying causal structure.

This does not resolve the impossibility theorems (unequal base rates still prevent simultaneous group fairness). But it shows the apparent opposition between "group" and "individual / counterfactual" is partially an artifact of not being explicit about the causal model.

Where this fits in Phase 18

Lesson 20 is bias measurement. Lesson 21 is fairness definition. Lesson 22 is privacy (differential privacy). Lesson 23 is watermarking. These are the allocation-adjacent lessons complementing the deception-adjacent Lessons 7-11.

an-fairness-trilemma

Use It

code/main.py builds a toy binary-classification dataset with a sensitive attribute and unequal base rates. Compute demographic parity, equalized odds, and conditional use accuracy equality on a simple classifier. Observe the three metrics disagreeing. Apply a re-weighting for demographic parity and observe its cost on the other two.

Ship It

This lesson produces outputs/skill-fairness-criterion.md. Given a fairness claim or policy, identifies which criterion is being claimed, whether the model can satisfy the remaining criteria under the claimed unequal base rates, and what causal DAG the claim depends on.

Exercises

  1. Run code/main.py. Report the three group metrics on the default data. Apply the demographic-parity-targeted re-weighting and re-report.

  2. 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.

  3. Read Kusner et al. 2017. Construct a simple two-feature causal DAG for resume scoring and identify the counterfactual-fairness condition it implies.

  4. The 2024 backtracking-counterfactuals paper avoids intervention on protected attributes. Describe a scenario where this matters for legal compliance.

  5. The ICLR 2024 reconciliation argues group and counterfactual fairness are facets of the same structure. Pick two of the three criteria in code/main.py and 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

Check yourself

Quick quiz

  1. Which best matches the demographic-parity definition for groups A=a and A=a'?

    1. Equal predictive value across groups
    2. Equal true-positive and false-positive rates across groups
    3. Equal acceptance rates: P(Y=1 | A=a) = P(Y=1 | A=a')
    4. Equal Lipschitz constant across groups
    Show the answer

    C. Equal acceptance rates: P(Y=1 | A=a) = P(Y=1 | A=a')

  2. What does the Chouldechova / Kleinberg-Mullainathan-Raghavan 2017 impossibility result say?

    1. Under unequal base rates, demographic parity, equalized odds, and conditional use accuracy equality cannot all hold simultaneously
    2. Individual fairness implies counterfactual fairness for any DAG
    3. Counterfactual fairness implies demographic parity
    4. Group fairness is always achievable by re-weighting
    Show the answer

    A. Under unequal base rates, demographic parity, equalized odds, and conditional use accuracy equality cannot all hold simultaneously

  3. Dwork et al. 2012 define individual fairness via:

    1. A causal DAG with a sensitive-attribute intervention
    2. Equal accuracy across protected groups
    3. A Lipschitz condition on the decision map relative to a task-specific similarity metric, so similar individuals get similar decisions
    4. Demographic parity at the individual level
    Show the answer

    C. A Lipschitz condition on the decision map relative to a task-specific similarity metric, so similar individuals get similar decisions

  4. Counterfactual fairness (Kusner et al. 2017) requires:

    1. Equal Lipschitz constants for all groups
    2. Only group-level statistics
    3. No causal assumptions
    4. A causal DAG; the decision is unchanged when the individual's sensitive attribute is counterfactually altered
    Show the answer

    D. A causal DAG; the decision is unchanged when the individual's sensitive attribute is counterfactually altered

  5. Why do backtracking counterfactuals (arXiv:2401.13935) matter for legal compliance?

    1. They replace embedding-based bias metrics
    2. They eliminate the need for any causal model
    3. They prove the impossibility theorem is wrong
    4. Instead of intervening on a protected attribute (which is legally problematic), they ask which combination of actual features would have produced the counterfactual outcome
    Show the answer

    D. Instead of intervening on a protected attribute (which is legally problematic), they ask which combination of actual features would have produced the counterfactual outcome

  6. What does the ICLR Blogposts 2024 philosophical reconciliation argue?

    1. With an explicit causal graph, satisfying certain group-fairness measures entails counterfactual fairness, so the apparent opposition between families is partly an artifact of leaving the causal model implicit
    2. Group and counterfactual fairness are unrelated
    3. Only individual fairness is justifiable
    4. The impossibility theorems are resolved by re-weighting
    Show the answer

    A. With an explicit causal graph, satisfying certain group-fairness measures entails counterfactual fairness, so the apparent opposition between families is partly an artifact of leaving the causal model implicit

Questions people ask

What is the difference between group fairness and individual fairness?

Group fairness checks that outcomes or error rates are similar across groups on average. Individual fairness checks that two similar people receive similar decisions. A system can pass one test and fail the other.

Can an AI model be fair by every definition at once?

Usually not. Research shows that when groups have different base rates, common fairness measures like equal error rates and equal predictive value cannot all be met together. Teams have to choose which criteria matter for the use case and explain the trade-off.

Next lessonDifferential Privacy for LLMsPrevious: Bias and Representational Harm in LLMs

Lessons from AI Engineering from Scratch by Rohit Ghumare and contributors, MIT license. Notes for owners by Lozo. License

Next step

Rather have it built for you?

Reading is optional. Tell me what's stuck and I'll build it into the business you already run.

  • A real conversation, not a pitch
  • You keep your accounts
  • Nothing sends without your yes