Abstract
Machine learning models often inherit and amplify biases present in training data. This paper addresses the challenge of ensuring counterfactual fairness (CF)—the principle that a decision for an individual should remain unchanged had a sensitive attribute been different—without requiring full knowledge of the underlying Structural Causal Model (SCM). We propose the FLAP (Fair Learning through dAta Preprocessing) algorithm, which transforms input features into a fair representation using Marginal Distribution Mapping (MDM). Additionally, we provide a theoretical bridge between CF and conditional independence, facilitating the first formal statistical test for detecting counterfactual discrimination. Our evaluations on synthetic and real-world datasets show that FLAP effectively mitigates bias with negligible impact on predictive accuracy.
Introduction
Standard machine learning models are "mirrors" of their training data. If historical datasets contain systemic biases—such as discriminatory loan approval practices—models trained on them will likely replicate these patterns. A common but ineffective approach is "Fairness Through Unawareness," which involves simply removing sensitive attributes like race or gender. However, because bias is often "baked into" other features (e.g., zip codes or education levels), this method fails to achieve true fairness.
This paper focuses on Counterfactual Fairness (CF). CF asks a fundamental causal question: "Would the decision for this individual have been the same if their sensitive attribute (like race or gender) had been different, while everything else remained the same?" Achieving CF is difficult because "everything else" often depends causally on the sensitive attribute. Existing solutions typically require an exact Structural Causal Model (SCM), which is rarely available in practice.
Methodology: The FLAP Algorithm
The authors introduce FLAP (Fair Learning through dAta Preprocessing), a model-agnostic approach that cleans data before training begins. By transforming the input features, FLAP ensures that any subsequent model trained on the data satisfies counterfactual fairness.
Causal Framework
The relationships between sensitive attributes ($S$), non-sensitive features ($A$), and outcomes ($Y$) are modeled using a causal graph and structural equations that define how bias propagates through the system.
Preprocessing Procedures
FLAP employs two primary methods for data transformation:
- Orthogonalization: Suitable for additive relationships where features can be decomposed into a component explained by the sensitive attribute and an independent residual.
- Marginal Distribution Mapping (MDM): A more robust "reparameterization trick" that maps attributes to a common distribution across all sensitive groups. MDM is the "heavy lifter" of the paper, guaranteeing fairness under weaker assumptions and handling non-linear dependencies.
Testing for Fairness
A significant theoretical contribution is Theorem 2, which proves that Counterfactual Fairness is equivalent to a specific type of Conditional Independence. This allows researchers to use standard statistical tools, such as the Conditional Distance Correlation test, to empirically measure if a decision-making process is discriminatory even when counterfactuals are unobservable.
Experimental Evaluation
The authors evaluated FLAP across several benchmarks, including simulated university admission data and the COMPAS recidivism dataset. A primary focus was a massive real-world dataset of 203,656 loan applications from a fintech company, where age and gender were treated as sensitive attributes.
Key Results
- Fairness vs. Accuracy: On the Fintech dataset, FLAP reduced the "CF-metric" (a measure of unfairness) from 0.0392 to as low as 0.0007, while incurring only a 0.1% drop in prediction accuracy.
- Baseline Comparison: FLAP consistently outperformed state-of-the-art algorithms like FairLearning and Affirmative Action in reducing the "CF-bound," particularly in complex scenarios where relationships between attributes were non-linear.
- Bias Detection: Using their new statistical test on the Fintech data, the authors found a p-value of nearly zero, confirming that the original human-driven loan decisions were statistically unfair toward certain age and gender groups.
Discussion and Limitations
FLAP's primary advantage is its learner agnosticism; because it is a preprocessing step, it can be paired with any machine learning architecture, from logistic regression to deep neural networks. However, the authors noted a "ceiling effect" in datasets with hard cutoffs (e.g., maximum test scores), where perfect CF may be mathematically impossible due to truncated distributions. Furthermore, MDM currently struggles with "mixed" variables that are partially continuous and partially discrete.
Future research will focus on developing preprocessing methods that handle these mixed distributions more gracefully and scaling the conditional independence tests to work more efficiently on extremely large datasets.
Summary updated