Source-linked AI summary

Counterfactual Fairness

Matt J. Kusner, Joshua R. Loftus, Chris Russell, Ricardo Silva

arXiv:1703.06856v3stat.MLcs.CYcs.LG

TL;DR

Automated decisions can perpetuate historical discrimination, while practitioners face difficulty choosing among fairness definitions. The paper uses causal models to define counterfactual fairness and develops algorithms that account for social biases. Experiments show an explicit causal approach exposes the trade-off between prediction accuracy and fairness in an unfair world.

  • Problem

    Historical bias can enter machine-learning predictions, and practitioners lack a clear basis for choosing among fairness definitions because their effects depend on relationships between protected attributes and data.

  • Method

    The paper models fairness explicitly with causal structures and counterfactual reasoning, including algorithms that account for social biases rather than simply ignoring protected attributes.

  • Results

    Experiments show that explicit causal models capture social biases and make the implicit trade-off between prediction accuracy and fairness clear.

  • Takeaways & Limitations

    The paper proposes regulating fairness by explicitly modeling the causal structure of the world.

  • Takeaways & Limitations

    The framework does not resolve the effect of discrimination that continues after fair decisions are made, such as customers avoiding female-owned businesses for unfair reasons.

Abstract

from arXiv · show

Machine learning can impact people with legal or ethical consequences when it is used to automate decisions in areas such as insurance, lending, hiring, and predictive policing. In many of these scenarios, previous decisions have been made that are unfairly biased against certain subpopulations, for example those of a particular race, gender, or sexual orientation. Since this past data may be biased, machine learning predictors must account for this to avoid perpetuating or creating discriminatory practices. In this paper, we develop a framework for modeling fairness using tools from causal inference. Our definition of counterfactual fairness captures the intuition that a decision is fair towards an individual if it is the same in (a) the actual world and (b) a counterfactual world where the individual belonged to a different demographic group. We demonstrate our framework on a real-world problem of fair prediction of success in law school.

1 Contribution

The paper frames fairness as a causal modeling problem because existing definitions can depend on protected-attribute relationships and may even increase discrimination. It introduces an explicitly causal approach and develops counterfactual fairness as its organizing framework.

  • Existing fair-prediction methods often formalize quantitative criteria for particular datasets, leaving practitioners uncertain which definition fits their task.
  • Some fairness definitions can increase discrimination depending on the relationship between a protected attribute and the data.
  • The paper introduces an explicitly causal approach that models relationships between protected attributes and observed data using Pearl’s causal framework.
  • Counterfactual fairness requires an individual’s prediction distribution to remain unchanged if their protected attributes had differed in a causally defined counterfactual world.
  • The paper develops an algorithm implementing this definition and illustrates it through fair prediction of law-school success.

2 Background

The paper reviews existing fairness criteria and motivates an explicit causal perspective for handling relationships among protected attributes and other variables. It introduces causal models and counterfactual inference as the formal tools for this approach.

  • Existing fairness criteria: Existing fairness research includes unawareness, individual fairness, demographic parity, and equality of opportunity.These approaches formalize fairness differently, and protected attributes may be binary or generalized.
  • Limitations of existing criteria: Fairness criteria can be incompatible, and choosing among them may require domain knowledge about relationships between protected attributes and observed features.Individual fairness depends on carefully selecting a similarity metric, while unawareness can fail when features contain discriminatory information analogous to a protected attribute.
  • Causal perspective: The paper approaches historical bias through explicit causal modeling rather than criteria based only on probabilistic independence.The authors argue that relationships among all attributes should inform fairness judgments, even when this requires strong assumptions.
  • Causal models: A causal model is a triple (U, V, F), where latent background variables, observable variables, and structural functions define how variables are generated.The structural functions form a directed acyclic graph through parent relationships.
  • Counterfactual inference: Counterfactual inference computes P(Y_Z←z(U) | W = w) through abduction, intervention, and subsequent evaluation under modified structural equations.Interventions replace a variable’s structural equation with a fixed value, enabling counterfactual quantities under the causal model.

3 Counterfactual Fairness

Counterfactual fairness requires an individual's prediction distribution to remain unchanged when the protected attribute is counterfactually changed, holding causally unaffected information fixed. The paper connects this criterion to causal models and illustrates how it addresses historically biased prediction settings.

  • Definition: Counterfactual fairness requires the prediction distribution to remain unchanged across factual and attainable counterfactual values of the protected attribute.The criterion is evaluated for every outcome y and context X = x, A = a.
  • Definition: The criterion is individual-level: changing A while holding non-descendants fixed must not change the individual's prediction distribution.It differs from comparing separate individuals who happen to share observed attributes.
  • Relation to other criteria: Counterfactual fairness can use causal relationships among attributes, unlike fairness-through-unawareness, which may overlook discriminatory information encoded in other features.The paper also relates the criterion to individual fairness and emphasizes causal structure rather than an unspecified similarity metric.
  • Examples: In the red-car insurance scenario, race affects a predictive feature without affecting aggression or accidents, making prediction from that feature alone counterfactually unfair.The paper reports that including race and the observed feature in a linear regression is equivalent to regressing on the latent aggression factor, whereas using the observed feature alone is not counterfactually fair.
  • Examples: In high-crime regions, arrest labels reflect differential policing, so a fair approach models enforcement-related latent factors rather than using neighborhood directly.The label Y = 0 indicates not being caught, not never committing a crime; equal-opportunity postprocessing therefore does not remedy the stated historical unfairness.
  • Implications: A predictor that is a function of non-descendants of A is counterfactually fair, providing the most straightforward sufficient construction.The proof relies on the invariance of non-descendants under counterfactual changes to A.
  • Implications: The framework separates the predictor from the outcome, allowing it to project Y onto variables not caused by A and thereby address historical bias.The resulting fair predictor is chosen as a function of non-descendants that minimizes predictive error for Y.

4 Implementing Counterfactual Fairness

The implementation learns a predictor from latent background variables and observable non-descendants of the protected attribute by minimizing an expected predictive loss. It offers several assumption levels, but counterfactual claims depend on strong, generally unfalsifiable causal-model assumptions.

  • Algorithm: The algorithm parameterizes the predictor as gθ(U, X⊁A), using latent background variables and observable non-descendants of A.The predictor may be implemented with models such as logistic regression or a neural network.
  • Algorithm: Training minimizes empirical expected loss over latent variables conditioned on each observed data point and its protected attribute.The expectation uses P_M(U | x, a), the causal model's conditional distribution of background variables.
  • Algorithm: When the latent-variable expectation is unavailable analytically, MCMC samples augment the training data before optimization.For each data point, the procedure draws m samples from P_M(U | x, a) and replaces the point with corresponding augmented examples.
  • Algorithm: The method can be viewed as deconvolution: it extracts latent sources from A ∪ X and passes them into a predictive model.The paper argues that causal assumptions are needed when extracted latent variation is treated as fair.
  • Assumptions: Causal models require strong assumptions because structural equations supporting counterfactual claims are generally unfalsifiable from observational or even fully interventional distributions.Infinitely many structural equations can be compatible with the same observable distribution.
  • Assumptions: Counterfactual fairness can be implemented under three assumption levels, from partial causal ordering to latent-variable models with increasing strength.Level 1 uses observable non-descendants; Levels 2 and 3 introduce nondeterministic or fully deterministic latent-variable models.
  • Assumptions: The framework explicitly models demographic causal claims as idealized interventions that summarize more specific causal interventions or perceptions.The paper notes that experiments such as randomizing names can be interpreted as interventions on an aspect of the race construct.

5 Illustration: Law School Success

The law-school illustration evaluates counterfactually fair predictors when race and sex may bias GPA, LSAT, and FYA. Fair K and Fair Add use different causal assumptions and trade some accuracy for fairness.

  • The dataset contains LSAT, pre-law-school GPA, and first-year average grades for 21,790 students across 163 U.S. law schools.
  • The task predicts high first-year grades while avoiding bias from race and sex, whose effects may also contaminate observed LSAT, GPA, and FYA.
  • Fair prediction: Level 1 excludes descendants of race and sex, Level 2 models latent fair parent variables, and Level 3 uses independent additive error terms.
  • Fair prediction: Fair K infers latent student knowledge from observed training data, then uses that posterior representation to construct predictions.
  • Fair prediction: Fair Add estimates race- and sex-related components of GPA and LSAT, computes residuals, and uses those residual estimates to predict FYA.
  • Accuracy: The Full model has the lowest RMSE, while counterfactually fair models sacrifice some accuracy; Fair K has the highest RMSE and Fair Add lowers RMSE under stronger assumptions.
  • Counterfactual fairness: Counterfactual fairness is evaluated by fitting the assumed causal model and comparing predictions generated under observed versus counterfactual race and sex values.

6 Conclusion

The paper presents counterfactual fairness as a causal framework for designing fair predictors. Experiments contrast it with prior approaches and expose an accuracy–fairness trade-off in an unfair world.

  • Counterfactual fairness allows algorithms to model social biases associated with sensitive attributes and compensate for them rather than merely ignoring protected attributes.
  • Experiments contrast the approach with previous fairness methods and show that explicit causal models capture social biases and clarify the trade-off between accuracy and fairness.
  • The paper argues that fairness should be regulated by explicitly modeling causal structure because probabilistic independence criteria cannot address how unfairness occurs in a task.
  • The authors aim to provide causal tools for customized fairness modeling across a wide array of fairness problems.

S1 Population Level vs Individual Level Causal Effects

The supplement distinguishes population-level causal effects from individual-level counterfactual effects. It explains why a nonzero average causal effect can coexist with counterfactual fairness and notes modeling limitations.

  • The average causal effect compares expected predictions under interventions do(A = a) and do(A = a′) while conditioning on X = x.
  • A nonzero average causal effect does not contradict counterfactual fairness because it compares different exchangeable individuals rather than the same individual under alternate attributes.
  • With X = A + U and predictor ˆY = λU, the average causal effect is λ(a − a′), although the corresponding within-individual counterfactual difference is zero.
  • Counterfactually fair predictors can use variables also used by unfair predictors when causal assumptions balance observables to cancel A’s effect.
  • Probability of sufficiency is presented as useful for assessing existing decision processes but less natural for designing a predictor because the outcome cannot provide prediction-time evidence about latent variables.
  • The paper addresses exact counterfactual fairness rather than approximate fairness and does not address validation of the causal assumptions in the input model.
  • The experiments assume a true model compatible with the algorithm’s causal assumptions, consistent with simulation-based causal assessment in machine learning.
  • A stricter almost-sure equality definition differs from equality in distribution when counterfactual predictions use independent randomness, though the definitions coincide for deterministic predictors.

S2 Relation to Demographic Parity

Counterfactual fairness is related to demographic parity but is defined through individual-level causal reasoning. Under specific structural assumptions, a counterfactually fair predictor can satisfy demographic parity.

  • A predictor based only on X need not satisfy demographic parity when X is caused by A.
  • The shared randomness U across counterfactual worlds is part of the individual-level interpretation of counterfactual fairness.
  • If X = αA + e_X and predictions use only e_X, marginal independence of e_X and A implies demographic parity.
  • When background variables are determined by A and X and observables are conditionally independent of A given them, counterfactually fair predictions satisfy demographic parity.
  • Counterfactual fairness is therefore a counterfactual analogue of demographic parity, not simply the same population-level comparison.

S3 Examples Revisited

The examples show that counterfactual fairness depends on causal structure: excluding protected attributes can fail, while appropriately using them can sometimes restore fairness. The analysis also identifies when predictors remain unchanged under counterfactual changes and when direct effects prevent fairness.

  • Scenario 1: The Red Car Revisited: In the Red Car structure, a predictor using only X is not counterfactually fair, whereas a predictor using both A and X can be fair.The lemma assumes a deterministic linear model with the structure in Figure 1(a).
  • Scenario 1: The Red Car Revisited: Fairness through unawareness fails because changing A changes X, so the predictor λ(αa + βU) differs from its counterfactual version.The procedure computes latent causes, substitutes a counterfactual protected attribute, and recomputes X and Y.
  • Scenario 1: The Red Car Revisited: When X changes because of A, the predictor can remain unchanged if its construction cancels that change through the protected-attribute term.This cancellation makes the predictor counterfactually fair and, in the stated model, also satisfies demographic parity and equality of opportunity.
  • Scenario 2: High Crime Regions Revisited: Adding the causal edge X → Y makes a predictor trained using X and A not counterfactually fair because it depends on variation in A unexplained by U.The resulting predictor differs between a and a′.
  • Scenario 3: University Success: In the University Success scenario, the direct effect Y = γU + ηA leaves the predictor dependent on A beyond U, so it cannot be counterfactually fair.The scenario models gender as affecting academic features and post-graduation success, while latent talent independently causes both features and success.

S4 Analysis of Individual Pathways

The pathway analysis allows some effects of a protected attribute to remain acceptable while excluding designated unfair causal paths. This path-dependent view permits using variables such as course choice when their pathway is not classified as unfair, but still disallows direct use of the protected attribute.

  • Path-dependent fairness: The analysis distinguishes an A → Y edge interpreted as discrimination from the A → X pathway, which need not make X unfair after controlling for X.This motivates defining fairness relative to a selected set of unfair directed paths.
  • Path-dependent fairness: Path-dependent counterfactual fairness intervenes on designated unfair paths from A to Y while preserving other pathways.The definition is related to controlled direct effects and reduces to the original definition when no paths are excluded from propagation.
  • Path-dependent fairness: Variables not present on any designated unfair path may be included in the predictor, allowing factual information from A and background causes to reconstruct them.The contribution of A is treated as acceptable for these variables and need not be deconvolved.
  • Path-dependent fairness: In the college-application example, course choice X may be used even though A confounds X and Y, but A itself may not be used directly.The permitted use of X reflects the path-dependent treatment of its causal relationship with A and Y.
  • Relation to prior approaches: A contrast with approaches based only on independence constraints is left for future work, although the paper describes the approaches as complementary.The authors emphasize that their motivation centers on settings requiring an explicit causal model.

S5 The Multifaceted Dynamics of Fairness

The framework changes machine-learning decisions at specific problems but cannot directly change society-wide biases. It considers whether fair decisions might indirectly reduce continuing discrimination, while acknowledging substantial challenges and imprecision.

  • The work is limited to changing machine-learning-aided decision making at specific problems, not society-wide biases.
  • Fair loan allocation may increase the proportion of successful female businesses, though it may come at a cost.
  • Localized acts of fairness could indirectly reduce continuing discrimination through feedback effects, but precise quantitative answers face many challenges.

S6 Case Study: NYC Stop-and-Frisk Data

The case study models 38,609 male NYPD stops from 2014 to examine how race relates to arrest through latent criminality and observed stop outcomes. Its counterfactual maps compare observed arrests with arrests predicted if everyone were White or Black Hispanic.

  • Data: The dataset contains 38,609 records of males stopped by the NYPD during 2014.
  • Model: The model treats latent Criminality and observed Race as causes of arrest, force, frisking, searching, and weapon observations.
  • Counterfactual analysis: Figure 4 maps observed arrests alongside counterfactual arrests under universal White and universal Black Hispanic race assignments.
  • Results: Arrests decrease from 5659 to 3722 if everyone were White and increase from 5659 to 6439 if everyone were Black Hispanic, according to the model.
Loading 1703.06856v3…