Why Counterfactual Fairness Requires a Causal Model
A prediction can be unchanged when a sensitive attribute is removed from the model’s input list and still depend on that attribute through other variables. Conversely, a difference associated with a sensitive attribute does not by itself establish that the attribute caused the difference. To ask what a prediction would have been for the same case under a different value of the attribute, we need a model of how the variables are causally connected.
Counterfactual fairness makes this comparison at the level of a particular case, using the observed evidence about that case. It is a causal criterion, not a group error-rate measure. Its conclusion depends on the causal model, the evidence used, and which pathways from the sensitive attribute are considered acceptable.
Let \(A\) be a sensitive attribute, \(O\) the observed evidence for a case, and \(\hat{Y}\) the model prediction. The evidence is factual: it is what was observed in the actual case, including \(A=a\). For a different value \(a'\), the counterfactual prediction is evaluated using the same factual evidence to infer the case’s latent characteristics, while the causal model determines which variables change under the intervention.
The phrase “full conditional distribution” matters. For a continuous prediction, the probability of any single exact value is often zero, so equality of point probabilities would not show that two distributions are alike. Comparing the cumulative distribution functions, or probabilities over all measurable sets, avoids that problem.
How the Counterfactual Comparison Is Calculated
In an SCM, the exogenous variables \(U\) represent background factors not determined by the other variables in the model. They remain fixed when an intervention is considered. The observed evidence updates what is known about \(U\); it does not generally reveal \(U\) exactly. Consequently, a counterfactual prediction may have a distribution even when the prediction rule is deterministic for a fully specified set of variables.
Suppose a model has a mediator \(M\), which is a variable on a causal pathway from \(A\) to the prediction. Write the prediction under intervention \(a'\) as \(h(a',M_{a'}(U),U,V)\), where \(V\) represents any randomness in the prediction process. The conditional distribution is obtained by averaging over the posterior distribution of the background variables given the factual evidence:
This follows by conditioning first on \(U=u\): within each possible background state, the intervention determines the relevant mediator and prediction distribution; averaging those conditional probabilities over the posterior distribution of \(U\) gives the probability for the case as observed. If the model is deterministic once \(U\) is specified, the inner probability is an indicator: it is one when the resulting prediction lies in \(B\) and zero otherwise.
A useful sufficient condition follows directly. If changing \(A\) leaves the prediction function unchanged for every background state that has positive posterior probability, then the counterfactual prediction distributions agree. But this condition is not necessary: distinct state-by-state predictions can, in some models, produce the same overall distribution. The definition concerns distributions, not only whether a particular equation contains \(A\).
Worked Example: A Prediction Invariant to the Intervention
Method: specify the causal equations, update the latent-state distribution using the stated conditional independence, and compare the prediction laws. In a hypothetical eligibility review, let \(A\) be a binary sensitive attribute and \(U\) a binary background risk state. Assume \(P(U=1)=0.5\), \(A\) is independent of \(U\), and \(X\) is generated from \(U\) with \(P(X=1\mid U=1)=0.8\) and \(P(X=1\mid U=0)=0.4\). Assume \(A\perp X\mid U\). The prediction rule is \(\hat{Y}=0.2+0.6U\). For a case with \(X=1,A=0\), compare the prediction distributions under \(A\leftarrow0\) and \(A\leftarrow1\).
First calculate the posterior probability of the latent state from the joint assumptions:
The conditional independence assumption gives \(P(X=1\mid U,A=0)=P(X=1\mid U)\), and independence of \(A\) and \(U\) gives \(P(U=1\mid A=0)=0.5\). Thus \(P(U=0\mid X=1,A=0)=1/3\). Because neither the equation for \(U\) nor the prediction rule changes when \(A\) is intervened upon, the prediction is \(0.2\) with probability \(1/3\) and \(0.8\) with probability \(2/3\), under either intervention.
As a check, the mean prediction in either case is \(0.2(1/3)+0.8(2/3)=0.6\), and the entire two-point distribution—not only its mean—is the same. Common mistake avoided: independence of \(A\) and \(U\), by itself, would not justify this posterior calculation. The additional assumption \(A\perp X\mid U\) is what permits the likelihood terms to be used without conditioning them differently on \(A=0\).
A Causal Pathway Can Change the Prediction
If \(A\) causes a mediator that the prediction uses, intervening on \(A\) may change the prediction even if \(A\) is not supplied as a direct input. For example, \(A\to M\to\hat{Y}\) is a causal pathway from the sensitive attribute to the prediction. Whether that pathway should be treated as permissible is a substantive judgment about the decision context, not a conclusion supplied by the statistical definition.
Worked Example: A Mediator Produces Different Counterfactual Scores
Method: hold the factual evidence fixed, propagate each intervention through the structural equations, and compare the resulting distributions. Consider a hypothetical outreach score. Let \(A\) be binary, \(U\sim\operatorname{Bernoulli}(0.25)\), and assume \(A\) is independent of \(U\). Let \(M=\max(A,U)\), and let the deterministic score be \(\hat{Y}=0.1+0.7M\). For a case observed with \(A=0\), with no further evidence about \(U\), compare interventions \(A\leftarrow0\) and \(A\leftarrow1\).
Under the factual value \(A=0\), the mediator is \(M=\max(0,U)=U\). Thus \(M=0\) with probability \(0.75\) and \(M=1\) with probability \(0.25\). The score distribution is:
Under \(A\leftarrow1\), the mediator becomes \(M=\max(1,U)=1\) for either value of \(U\). Therefore:
The distributions differ: under the first intervention, the probability of a score at or below \(0.1\) is \(0.75\); under the second it is zero. The mean scores also provide a check: \(0.1(0.75)+0.8(0.25)=0.275\) under \(A\leftarrow0\), compared with \(0.8\) under \(A\leftarrow1\). This prediction is not counterfactually fair under the specified model and evidence. Common mistake avoided: checking only whether the score rule explicitly includes \(A\) would miss its effect through \(M\).
Assumptions Limit What the Result Means
A counterfactual fairness assessment requires more than a fitted prediction model. The analyst must specify a causal model: which variables cause which others, how interventions affect descendants, and how unobserved factors are represented. The model must also support the required conditional distributions. In particular, a calculation involving \(P(U\mid O,A)\) needs a justified joint distribution for those variables; independence statements must not be used to infer conditional independence that they do not imply.
The causal graph and the classification of pathways also have substantive limits. Suppose an attribute affects access to training, and training affects a measured experience variable used in a model. Treating the path through experience as permissible will produce a different fairness question from treating it as impermissible. A pathway can reflect a historical disadvantage even if it is not a direct effect of the attribute. Calling a path “permissible” does not make its consequences harmless; it records a choice about the normative standard being applied.
Counterfactual fairness is also not the same as a group-level fairness criterion. A group-level comparison summarizes rates or errors across populations. Counterfactual fairness asks whether a case’s prediction distribution would change under an intervention on \(A\), conditional on that case’s factual evidence. Either type of assessment may be informative, but neither alone establishes that a decision is appropriate in every context.
Worked Example: A Common-Cause Association Changes the Posterior
Method: write a complete structural model and calculate both the conditional and marginal posterior rather than substituting one for the other. In a hypothetical claim-triage analysis, let \(C\sim\operatorname{Bernoulli}(0.5)\) be a common cause, let \(A=C\), and let \(U\sim\operatorname{Bernoulli}(0.5)\) be independent of \(C\). Set \(X=\max(C,U)\). Thus \(A\) and \(X\) share the cause \(C\), but the structural equation for \(X\) does not use \(A\): intervening on \(A\) alone does not change \(C\) or \(X\). A reviewer observes \(X=1,A=0\) and uses score \(\hat{Y}=0.2+0.6U\). Find the relevant posterior and compare it with the tempting marginal calculation.
Since \(A=C\), observing \(A=0\) establishes \(C=0\). With \(C=0\), the equation \(X=\max(C,U)\) reduces to \(X=U\). Consequently, \(X=1,A=0\) establishes \(U=1\), so:
For comparison, without conditioning on \(A\), \(X=1\) occurs either when \(U=1\), with probability \(0.5\), or when \(U=0,C=1\), with probability \(0.5(0.5)=0.25\). Therefore:
The two posterior probabilities are not equal. In the observed case, the score is \(0.2+0.6(1)=0.8\). Under either intervention on \(A\), \(U\) remains fixed and the score rule uses only \(U\), so its conditional distribution is a point mass at \(0.8\). This score is counterfactually invariant in this particular SCM and evidence, even though \(A\) and \(X\) are associated. Common mistake avoided: independence of \(A\) and \(U\), and the fact that \(A\) is not a cause of \(X\), do not imply \(P(U\mid X,A)=P(U\mid X)\). Here \(A\perp U\), but the common cause \(C\) makes conditioning on \(A\) informative about \(X\) and \(U\).
Interpreting a Fairness Conclusion
A careful conclusion states the result conditionally: under a specified SCM, for stated evidence, and under stated assumptions about the causal pathways, the prediction distributions do or do not agree across the considered interventions. It should not present the result as a model-free property of the prediction algorithm. In applied work, the causal assumptions should be explained and challenged with subject-matter experts; alternative plausible graphs may produce different conclusions.
This distinction matters in actuarial settings because variables such as prior claims, employment history, and service access may be both predictive and causally connected to sensitive attributes or historical decisions. The purpose of the analysis is not to declare a variable acceptable solely because it improves prediction, or unacceptable solely because it is associated with a sensitive attribute. It is to make the causal question explicit, test the implications of the chosen assumptions, and communicate what the result does and does not establish. This treatment is aligned with the SOA Exam PA (Predictive Analytics) syllabus.
Check Your Understanding
For each problem, use the stated assumptions rather than adding independence conditions that are not given.
- Let \(U\sim\operatorname{Bernoulli}(0.4)\), let \(A\) be independent of \(U\), and assume \(A\perp X\mid U\). Suppose \(P(X=1\mid U=1)=0.75\) and \(P(X=1\mid U=0)=0.25\). For evidence \(X=1,A=0\), calculate \(P(U=1\mid X=1,A=0)\). (Answer: \(0.30/(0.30+0.15)=0.6667\).)
- Let \(U\sim\operatorname{Bernoulli}(0.4)\), independent of factual \(A=0\), with \(M=\max(A,U)\) and score \(\hat{Y}=0.2+0.5M\). Compare the score distributions under \(A\leftarrow0\) and \(A\leftarrow1\), given no other evidence. (Answer: under \(A\leftarrow0\), score \(0.2\) with probability \(0.6\) and \(0.7\) with probability \(0.4\); under \(A\leftarrow1\), score \(0.7\) with probability \(1\); not counterfactually fair.)
- For fixed evidence, suppose \(U=0\) with probability \(0.75\) and \(U=1\) with probability \(0.25\). A deterministic score is \(0.3A+0.5U\). Compare the distributions under \(A\leftarrow0\) and \(A\leftarrow1\). (Answer: under \(A\leftarrow0\), scores \(0\) and \(0.5\) with probabilities \(0.75\) and \(0.25\); under \(A\leftarrow1\), scores \(0.3\) and \(0.8\) with probabilities \(0.75\) and \(0.25\); not counterfactually fair.)
- Let \(C\sim\operatorname{Bernoulli}(0.4)\), \(A=C\), and \(U\sim\operatorname{Bernoulli}(0.3)\) independently of \(C\). Set \(X=\max(C,U)\). Calculate \(P(U=1\mid X=1,A=0)\) and \(P(U=1\mid X=1)\). (Answer: \(1\) and \(0.3/(0.3+0.4(0.7))=0.5172\), respectively.)
- Why is equality of point probabilities for every exact score value insufficient to define equality of distributions for a continuous prediction? (Answer: every exact-point probability can be zero under distinct continuous distributions; compare probabilities for all measurable sets, equivalently the CDF at every threshold.)