Testing for Causal Fairness

Jiarun Fu, Lizhong Ding, Pengqi Li, Qiuning Wei, Yurong Cheng, Xu ChenarXiv 2025

Abstract

Causality is widely used in fairness analysis to prevent discrimination on sensitive attributes, such as genders in career recruitment and races in crime prediction. However, the current data-based Potential Outcomes Framework (POF) often leads to untrustworthy fairness analysis results when handling high-dimensional data. To address this, we introduce a distribution-based POF that transform fairness analysis into Distributional Closeness Testing (DCT) by intervening on sensitive attributes. We define counterfactual closeness fairness as the null hypothesis of DCT, where a sensitive attribute is considered fair if its factual and counterfactual potential outcome distributions are sufficiently close. We introduce the Norm-Adaptive Maximum Mean Discrepancy Treatment Effect (N-TE) as a statistic for measuring distributional closeness and apply DCT using the empirical estimator of NTE, referred to Counterfactual Fairness-CLOseness Testing (CF-CLOT). To ensure the trustworthiness of testing results, we establish the testing consistency of N-TE through rigorous theoretical analysis. CF-CLOT demonstrates sensitivity in fairness analysis through the flexibility of the closeness parameter $\epsilon$. Unfair sensitive attributes have been successfully tested by CF-CLOT in extensive experiments across various real-world scenarios, which validate the consistency of the testing.

Introduction

Causality is a cornerstone of fairness analysis, used to detect and mitigate discrimination based on sensitive attributes like gender or race. Traditional approaches often rely on the Potential Outcomes Framework (POF), which evaluates individual-level counterfactuals. However, in high-dimensional settings, data sparsity makes it difficult to find comparable individuals, leading to unreliable results. Furthermore, existing tests often lack the flexibility to distinguish between systemic bias and acceptable statistical variance.

The CF-CLOT Framework

To address these challenges, we propose Counterfactual Fairness-CLOseness Testing (CF-CLOT). This framework shifts the focus from individual data points to entire distributions.

Distributional Closeness Testing (DCT)

Instead of point-to-point equality, CF-CLOT employs Distributional Closeness Testing. We define counterfactual closeness fairness as the null hypothesis where the factual and counterfactual potential outcome distributions are within a distance $\epsilon$ of each other.

Norm-Adaptive MMD Treatment Effect (N-TE)

The core of our method is the N-TE statistic, derived from Maximum Mean Discrepancy (MMD). MMD measures distances between distributions in a Reproducing Kernel Hilbert Space (RKHS). We normalize this into the N-TE statistic (ranging from 0 to 1), providing an interpretable measure of the "degree of unfairness."

Flexible Sensitivity

A key feature of CF-CLOT is the closeness parameter $\epsilon$. By adjusting $\epsilon$, practitioners can tune the test's sensitivity. A value of $\epsilon=0$ represents strict fairness (e.g., for racial bias), while $\epsilon > 0$ allows for acceptable variance in less critical attributes.

Experimental Evaluation

We evaluated CF-CLOT across diverse datasets, including UCI Student Performance, Obesity Estimation, Students' Dropout, Credit Risk (CRA), and the high-dimensional RAF-DB image dataset.

Comparison with State-of-the-Art

CF-CLOT was compared against IFair, a state-of-the-art Structural Causal Model (SCM). As shown in Figure 5, CF-CLOT achieves competitive fairness (1-unfairness) and accuracy results while requiring fewer assumptions about data structure and offering lower computational complexity.

Comparison of CF-CLOT and IFair across UCI and CRA datasets.

Sensitivity and Accuracy Trade-offs

The framework's ability to handle trade-offs was tested by varying $\epsilon$ in the SFA (Sensitive Feature Attribution) models. In the CRA dataset (Figure 6), we observe that as $\epsilon$ increases, the model can retain higher accuracy by relaxing the fairness constraint, demonstrating the practical utility of the "Fairness Confidence" parameter.

Accuracy and 1-unfairness results for the CRA dataset across different methods and epsilon values.

Conclusion

CF-CLOT provides a mathematically rigorous and flexible approach to causal fairness. By leveraging distributional comparisons and the N-TE statistic, it overcomes the limitations of traditional POF in high-dimensional and sparse data environments. Future work will explore automated kernel selection and the computational optimization of the bootstrap empirical estimator for larger scales.

Summary updated

BibTeX
@misc{fu2025testing,
  author = {Jiarun Fu and Lizhong Ding and Pengqi Li and Qiuning Wei and Yurong Cheng and Xu Chen},
  title = {{Testing for Causal Fairness}},
  year = {2025},
  eprint = {2502.12874},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.12874},
}
Figure