Abstract
Counterfactual fairness (CF) ensures that a model's prediction for an individual remains unchanged across hypothetical scenarios where sensitive attributes differ. However, practical implementation is hindered by unfaithful counterfactual generation and weak fairness metrics. We propose a framework using Neural Causal Models (NCMs) with a kernel-based loss to enforce $L_3$ consistency and a Maximum Mean Discrepancy (MMD) regularizer for distribution-aware fairness. Our approach demonstrates superior performance-fairness trade-offs on synthetic and real-world datasets.
Introduction
Machine learning models often perpetuate biases found in training data. Counterfactual fairness offers a robust solution by requiring that a prediction $h(x)$ for an individual with sensitive attribute $A=a$ be the same as if $A=a'$, holding all other causal factors constant.
Implementing CF requires addressing two primary challenges:
- Faithful Generation: Accurately "abducting" unobserved confounders ($U$) to generate counterfactuals that adhere to the causal graph, achieving what is known as $L_3$ consistency.
- Strong Fairness Metrics: Moving beyond simple mean-matching proxies (like MSE) which fail to capture differences in the tails of distributions.
Methodology
The proposed framework consists of a two-stage approach to build a fair predictor:
1. Improved Counterfactual Generation
We utilize Neural Causal Models (NCMs) where neural networks parameterize causal mechanisms. To ensure $L_3$ consistency, we introduce:
- Kernel Least Squares for Abduction: A non-parametric approach to estimate the posterior of $U$ given evidence, avoiding restrictive invertibility assumptions.
- Explicit $L_3$ Loss ($\ell_{ctf}$): A novel loss term that acts as a causal guardrail, ensuring generated counterfactuals remain consistent with the model's marginal distributions even under finite sample errors.
2. Distribution-Aware Fairness Finetuning
To train the predictor $h_\phi$, we replace weak proxies with a Maximum Mean Discrepancy (MMD) regularizer ($\ell_{fair}$). MMD measures the distance between entire probability distributions in a Reproducing Kernel Hilbert Space (RKHS). By minimizing MMD, we ensure that the full distributions of factual and counterfactual predictions are identical, satisfying the formal definition of CF.
Experimental Results
The model was evaluated on a Synthetic Insurance Dataset and the Crimes Dataset, a high-dimensional real-world benchmark.
Key findings include:
- Superior Trade-offs: Our method achieves a higher Area Under the Curve (AUC) in performance-fairness plots compared to state-of-the-art baselines like [Grari et al., 2022].
- The "Mean" Trap: We empirically confirm that matching means (MSE) is insufficient for fairness; MMD provides a more rigorous guarantee by aligning entire distributions.
- Ablation Success: The inclusion of the $\ell_{ctf}$ loss significantly improves the fidelity of the generated counterfactual samples, making them more representative of the true causal world.
Conclusion
This work advances counterfactual fairness by integrating NCMs with kernel-based consistency losses and distribution-aware regularization. While future work should explore broader categorical data and the computational scaling of MMD, this framework provides a mathematically grounded path toward truly fair automated decision-making.
Summary updated