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.

    Source: §1 · p. 1
  • 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.

    Source: §3.2 · p. 5, §6 · p. 9
  • Results

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

    Source: §6 · p. 9
  • Takeaways & Limitations

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

    Source: §6 · p. 9

    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.

    Source: S5 The Multifaceted Dynamics of Fairness · p. 16

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.Source: §1 · p. 1
  • Some fairness definitions can increase discrimination depending on the relationship between a protected attribute and the data.Source: §1 · p. 1
  • The paper introduces an explicitly causal approach that models relationships between protected attributes and observed data using Pearl’s causal framework.Source: §1 · p. 2
  • Counterfactual fairness requires an individual’s prediction distribution to remain unchanged if their protected attributes had differed in a causally defined counterfactual world.Source: §1 · p. 2
  • The paper develops an algorithm implementing this definition and illustrates it through fair prediction of law-school success.Source: §1 · p. 2

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.Source: §2.1 · p. 2

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.Source: §2.1 · p. 2

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.Source: §2.1 · pp. 2–3

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.Source: §2.2 · p. 3

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.Source: §2.2 · p. 3

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.Source: §3 · p. 3
  • 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.Source: §3 · p. 3

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.Source: §3 · pp. 3–4

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.Source: §3.1 · p. 4
  • 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.Source: §3.1 · pp. 4–5

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.Source: §3.2 · p. 5
  • 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.Source: §3.2 · pp. 5–6

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.Source: §4.1 · p. 6
  • 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.Source: §4.1 · p. 6
  • 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.Source: §4.1 · p. 6
  • 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.Source: §4.1 · p. 6

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.Source: §4.2 · p. 7
  • 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.Source: §4.2 · p. 7
  • 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.Source: §4.3 · p. 7

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.

Fair prediction

Accuracy

Counterfactual fairness

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.Source: §6 · p. 9
  • 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.Source: §6 · p. 9
  • 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.Source: §6 · p. 9
  • The authors aim to provide causal tools for customized fairness modeling across a wide array of fairness problems.Source: §6 · p. 9

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.

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.

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).Source: S3 Examples Revisited · p. 14
  • 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.Source: S3 Examples Revisited · p. 14
  • 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.Source: S3 Examples Revisited · p. 15

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′.Source: S3 Examples Revisited · p. 15

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.Source: S3 Examples Revisited · p. 15

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.Source: S4 Analysis of Individual Pathways · p. 16
  • 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.Source: S4 Analysis of Individual Pathways · p. 16
  • 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.Source: S4 Analysis of Individual Pathways · p. 16
  • 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.Source: S4 Analysis of Individual Pathways · p. 16

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.Source: S4 Analysis of Individual Pathways · p. 16

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.

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

Model

Counterfactual analysis

  • Figure 4 maps observed arrests alongside counterfactual arrests under universal White and universal Black Hispanic race assignments.Source: Figure 4 · p. 18

Results

Loading 1703.06856v3…