Counterfactual Fairness for Predictions using Generative Adversarial Networks

Yuchen Ma, Dennis Frauen, Valentyn Melnychuk, Stefan Feuerriegel · Submission to ICLR 2024 · Rejected

TL;DR

Existing methods for counterfactual fairness typically rely on Variational Autoencoders (VAEs) to infer unobservable latent background variables—a process plagued by unidentifiability, representation bias, and poor sample quality. This paper introduces the Generative Counterfactual Fairness Network (GCFN), which bypasses latent variable inference altogether by using a tailored GAN to directly map observed mediators to their counterfactual distributions, enforcing fairness via a novel mediator regularization term with provable guarantees.

What Problem Does This Paper Address?

In algorithmic decision-making (e.g., credit lending, recidivism prediction), counterfactual fairness requires that a model's prediction for an individual remains unchanged had that individual belonged to another demographic group (e.g., a different race or gender), holding all non-descendant background traits constant.

Achieving this is notoriously difficult because counterfactual states are never observed in the real world. Prior neural approaches typically learn an exogenous latent noise variable $U$ via VAEs (e.g., mCEVAE, DCEVAE) using Pearl’s three-step abduction–action–prediction framework. However, this strategy faces three major bottlenecks:

  1. Non-identifiability: In non-linear latent variable models, the inferred latent variables are generally not identifiable, meaning multiple distinct latent distributions can explain the observed data equally well, leading to arbitrary counterfactual conclusions.
  2. Information Leakage & Bias: Standard Gaussian priors often fail to model complex distributions, allowing sensitive attributes to leak into latent variables or causing significant downstream utility loss.
  3. Lack of Theoretical Guarantees: Existing VAE models lack formal bounds proving that their predictions are strictly counterfactually fair.

Methods

GCFN solves these issues by skipping the latent variable estimation step entirely. It splits the workflow into two distinct stages:

[Step 1: Tailored GAN]
Inputs: Covariates X, Sensitive Attribute A, Factual Mediator M
  ├── Generator G ──────> Produces Counterfactual Mediator M̂_{A'}
  └── Discriminator D ──> Distinguishes factual M from generated M̂_{A'}

[Step 2: Fair Predictor Training]
Inputs: X, M, and generated M̂_{A'}
  └── Predictor h ─────> Min: Cross-Entropy Loss + λ * R_cm(h)
                         where R_cm(h) = || h(X, M) - h(X, M̂_{A'}) ||²
  1. Step 1: Learning the Counterfactual Mediator Distribution with a GAN:
  2. Rather than generating entire synthetic individuals, GCFN only generates the mediator variables $M$ (descendants of the sensitive attribute $A$ that causally impact outcome $Y$).
  3. The generator outputs candidate potential mediators for both factual and counterfactual values of $A$, penalized with a reconstruction loss $L_f$ on the factual output to ensure stability.
  4. The discriminator is modified: instead of judging "real vs. fake," it determines which component in a paired vector corresponds to the factual mediator versus the counterfactual mediator. Under Bijective Generation Mechanism (BGM) assumptions, the authors prove that this minimax game consistently identifies the true counterfactual mediator distribution.
  5. Step 2: Fair Predictor Training via Mediator Regularization:
  6. A downstream predictor $h(X, M)$ is trained using standard supervised classification loss combined with a counterfactual mediator regularization penalty: $$R_{\text{cm}}(h) = \mathbb{E}\left[ \|h(X, M) - h(X, \hat{M}_{A'})\|_2^2 \right]$$
  7. Theoretical Guarantee (Lemma 1): Assuming the predictor $h$ is Lipschitz continuous (enforced via spectral normalization), the authors prove that the true counterfactual fairness error is strictly upper-bounded by the counterfactual estimation error of the GAN plus the regularization penalty $R_{\text{cm}}(h)$.

Datasets

The authors evaluated GCFN on both synthetic and real-world benchmarks:

  • Synthetic Data: A simulated dataset generating non-linear dependencies among $X$, $A$, $M$, and $Y$.
  • Semi-Synthetic Datasets (LSAC Law School): Based on 101,570 law school admission records with gender as $A$, LSAT/GPA as mediators $M$, and bar exam passage as target $Y$. The mediator was simulated using either a smooth sigmoid transformation or an oscillatory sine transformation (which tests the limits of latent estimation).
  • UCI Adult Dataset: Tabular census data predicting income ($>$\$50k) with gender as $A$ and education/occupation as mediators.
  • COMPAS Recidivism Dataset: Pretrial recidivism risk predicting reoffense within 2 years, evaluating bias across Black and Caucasian defendants.

Key Insights and Ideas

  • Direct Counterfactual Mapping Beats Latent Abduction: You do not need to solve the impossible problem of unravelling unobserved confounders and latent exogenous variables $U$. Modeling the transition distribution directly between factual and counterfactual mediators is mathematically sufficient for enforcing fair decisions.
  • BGM Identifiability Holds for GANs: Under the assumption that the mediator generation mechanism is bijective and smooth with respect to noise, GANs converge to one of two valid BGM counterfactual solutions (Lemma 2). When conditional mediator variance is reasonably low, the difference between these solutions is negligible.
  • Flexible Accuracy-Fairness Pareto Frontier: The hyperparameter $\lambda$ on $R_{\text{cm}}$ provides practitioners an explicit dial to navigate trade-offs between performance and anti-discrimination constraints.

Key Results

  • Synthetic & Semi-Synthetic Benchmarks: Across various multi-criteria utility weights $\gamma$, GCFN outperformed existing approaches (including mCEVAE, DCEVAE, ADVAE, CFGAN, and HSCIC), offering utility improvements of up to ~30%. On the difficult sine-function dataset, baseline VAEs collapsed or showed massive variance across runs, while GCFN remained stable.
  • Mediator Estimation Quality: Normalized mean squared error between the generated counterfactual mediator $\hat{M}_{A'}$ and ground-truth counterfactual mediator $M_{A'}$ was close to zero ($0.01$ to $0.03$), while divergence from the factual mediator remained ~1.0, verifying that the GAN did not collapse to the identity function.
  • Real-World Recidivism (COMPAS):
  • GCFN achieved higher predictive accuracy ($0.6753$ vs. $0.6644$) and positive predictive value ($0.7143$ vs. $0.6874$) than the actual COMPAS scoring algorithm.
  • More importantly, GCFN reduced the False Positive Rate for Black defendants from 41.98% down to 35.19%, correctly reclassifying lower-risk individuals who had low prior charges but were penalized by existing systemic bias.

Limitations and Future Work

  • Causal Graph & BGM Assumptions: The consistency guarantees rely on standard causal assumptions (consistency, overlap, unconfoundedness conditional on $X$) and bijective mediator generation mechanisms. If the underlying causal mechanism is non-bijective or unobserved confounding between $M$ and $Y$ is severe, identifiability breaks down.
  • High Variance Mediators: As acknowledged in Remark 2, if the conditional variance of the mediator is exceptionally large, the two possible BGM solutions diverge. Enforcing worst-case fairness under such settings may require an ensemble of multiple GANs.
  • Beyond the Algorithmic Layer: The authors emphasize that algorithmic counterfactual adjustments cannot erase broader historically ingrained social disparities present in observational data.

Summary updated

BibTeX
@misc{ma2023counterfactual,
  author = {Yuchen Ma and Dennis Frauen and Valentyn Melnychuk and Stefan Feuerriegel},
  title = {{Counterfactual Fairness for Predictions using Generative Adversarial Networks}},
  year = {2023},
  eprint = {2310.17687},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.17687},
}

Loading related content...

Figure