Papers
Topics
Authors
Recent
Search
2000 character limit reached

Counterfactually Fair Regression via Optimal Transport

Published 27 May 2026 in stat.ML, cs.CY, and cs.LG | (2605.28251v1)

Abstract: We consider the problem of learning a counterfactually fair regressor. We adopt a causal uncertainty view in which counterfactual fairness is defined with resampled noise. We focus on obtaining theoretical fairness guarantees for a new post-processing estimator. We begin by showing that counterfactual fairness is equivalent to satisfying demographic parity conditional on the latent variable. This allows us to provide a closed-form expression of the optimal fair regressor via a barycentric quantile map. In order to handle continuous latent variables, we propose a discretized post-processing method. Then, under mild regularity assumptions, we prove high-probability finite-sample fairness guarantees for our estimator, providing an unfairness decay at rate $\tilde O(n{-1/3})$, and establishing a matching risk bound of order $\tilde O(n{-1/3})$. We provide a matching lower bound on the excess risk of almost fair predictions. Finally, we extend our results to the setting of relaxed counterfactual fairness. We validate our approach on real-world and synthetic data.

Summary

  • The paper reduces counterfactual fairness to conditional demographic parity, establishing a formal equivalence under latent variable assumptions.
  • It derives a closed-form CF-optimal predictor with a barycentric quantile map, achieving optimal nonparametric convergence rates of approximately n^(-1/3).
  • The method robustly calibrates black-box regressors through latent space discretization, enabling tunable fairness with minimal accuracy loss in both synthetic and real-world settings.

Counterfactually Fair Regression via Optimal Transport: An Expert Analysis

Motivation and Problem Statement

This work addresses the regression problem under counterfactual fairness (CF) constraints, focusing on rigorous theoretical guarantees and practical post-processing algorithms. While the literature on fair ML is extensive, most counterfactual fairness methods are either in-processing or rely heavily on structural causal models (SCMs), with limited practical deployability and a lack of statistical guarantees. The paper innovates by reducing CF (in the causal uncertainty/Level-2 SCM setting) to demographic parity (DP) conditional on unobserved latent variables, facilitating the use of optimal transport (OT) techniques to enforce CF in a model-agnostic post-processing regime.

Theoretical Contributions

The key theoretical insight is the equivalence of CF and conditional DP under mild SCM and latent recoverability assumptions, specifically:

CF as Conditional Demographic Parity: The paper establishes—formally and constructively—that counterfactual fairness (in the sense of invariance to interventions on sensitive attributes, marginalized over resampled noise) is equivalent to enforcing demographic parity conditional on a latent ability variable VV. This reduction is non-trivial, as global DP is known to be insufficient for CF, but conditional DP exactly matches the counterfactual requirement in this setting.

Closed-Form CF-Optimal Predictor: Leveraging the OT framework, the authors derive a closed-form expression for the CF-optimal regressor as a barycentric quantile map. Explicitly, for a predictor ff^*, the fair predictor is

f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),

where v=ψ(x,s)v=\psi(\mathbf{x}, s) is the latent, wsw_{s'} are group weights, and F1F^{-1} is the conditional quantile.

Statistical and Computational Guarantees: The paper provides a discretized post-processing scheme, partitioning the latent space and matching groupwise conditional distributions to their Wasserstein barycenter. Finite-sample statistical guarantees are proven—specifically, unfairness and excess risk decay at optimal nonparametric rates,

O~(n1/3),\tilde O(n^{-1/3}),

where nn is the number of samples used in post-processing. A matching minimax lower bound is established, showing that this rate is unimprovable for conditionally fair regression. Figure 1

Figure 1

Figure 1: Empirical convergence vs. Theoretical bound. The theoretical rate is aligned at n=500n=500. Empirical decay is notably faster than the worst-case bound, reaching near-zero unfairness rapidly.

Relaxed CF via Explicit Tuning: The authors generalize to relaxed CF, introducing an α\alpha-parameterized interpolation between the optimal unconstrained (potentially unfair) and fair predictors. The optimal solutions for both risk and unfairness are given analytically. They provide a practical recipe to tune ff^*0 to match a prescribed unfairness budget, and prove that the risk-unfairness tradeoff interpolates explicitly as a function of ff^*1.

Algorithmic Methodology

The main methodology is to recalibrate any fixed, possibly proprietary or black-box regressor ff^*2, using only its predictive output, observed sensitive attribute ff^*3, and proxy for ff^*4. The algorithm:

  • Discretizes the latent variable ff^*5 into ff^*6 intervals, balancing bias and variance.
  • Within each interval, estimates the conditional distribution of predictions for each group.
  • Applies a monotonic quantile transformation that maps group-level conditional distributions to their barycenter according to OT, ensuring conditional DP (thus CF). Figure 2

Figure 2

Figure 2

Figure 2: LSAC: Analysis of fairness and risk trade-offs. (Left) Unfairness vs. number of intervals ff^*7, showing the bias-variance trade-off with the theoretical ff^*8 indicated.

Empirical Evaluation

Experiments span both synthetic and real-world settings, including the LSAC Law School Admissions dataset and Communities and Crime. The method is benchmarked against:

  • Fair K: Counterfactual fairness by discarding all non-latent features (maximal safety, maximal information loss).
  • Wasserstein Fair Regression (WFR): Post-processing to enforce global DP using OT, which does not satisfy CF in the presence of conditional disparities.

Synthetic Results: The method dominates WFR on the counterfactual fairness-accuracy tradeoff, matching the fairness of strict CF approaches but at substantially lower accuracy cost due to preservation of non-biased predictive signal. Figure 3

Figure 3

Figure 3

Figure 3: Empirical validation of the bias-error trade-off (Thm 1) across multi-class sensitive attributes (ff^*9).

LSAC Results: On real data, the post-processor sharply reduces conditional unfairness by an order of magnitude relative to WFR, with negligible accuracy loss compared to the unconstrained base. This remains robust when latent f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),0 is estimated by a VAE (with and without explicit de-biasing). The practical f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),1-selection is shown to match the bias-variance sweet spot predicted by theory.

Robustness: The method's unfairness guarantee degrades smoothly under both random noise in the proxy and systematic proxy leakage, and remains robust to group imbalance until extremely low group sizes. Figure 4

Figure 4

Figure 4: Robustness to unbiased proxy noise. As noise f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),2 increases, unfairness rises mildly (peaking below f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),3) while RMSE decreases.

Computational Efficiency: The algorithm scales as f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),4 due to 1D OT computations and empirical quantile operations.

Limitations and Implications

The framework's guarantees are contingent on three core assumptions:

  • Existence and recoverability of a meaningful latent f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),5 underlying observed features and outcomes
  • Sufficient sample size for meaningful conditional distribution estimation post-discretization
  • Absence of profound violations of proxy-based causal deconfounding (e.g., f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),6 is not sufficiently separated from f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),7 in practice)

These are standard caveats in the CF literature, but the methodology minimizes the need for explicit SCMs and can operate with estimated proxies (e.g., via VAEs), lowering barriers to adoption.

Implications for Practice: The post-processing approach is model-agnostic, requiring neither retraining nor access to raw predictions or gradients. This is ideal for deployment in settings where only black-box access to models or data is possible, including regulation-compliance auditing or retrofitting existing systems for fairness.

Theoretical Significance: By demonstrating the equivalence of CF and conditional DP in a general Level-2 SCM setting, this work provides a unifying foundation that connects the causal and distributional fairness literatures. The closed-form OT-based solution generalizes existing results for demographic parity to the counterfactual case, with tight minimax optimality.

Opportunities for Future Work

  • Proxy Estimation: The practical challenge of inferring high-quality proxies for latent ability remains open. Improved proxy estimation methods (e.g., via weak supervision, causal representation learning, disentangled VAEs) would further enhance the practical utility of the method.
  • Extension to Classification: While the paper focuses on regression, similar OT-based approaches may be adapted for classification, especially in contexts with ordinal or continuous-outcome structure.
  • Beyond Latent Awareness: Extending the framework to settings where f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),8 cannot be reliably recovered, or to more complex causal discovery scenarios, is a direction for further theory and methodology.

Conclusion

This study puts forth a mathematically rigorous, practically tractable framework for counterfactually fair regression, bridging causal and distributional perspectives by exploiting the equivalence of CF and conditional DP. The developed post-processing method is optimal with respect to statistical convergence, is robust in empirical settings, and admits full control over the risk-unfairness tradeoff. Its flexibility, theoretical optimality, and computational efficiency make it an attractive foundation for real-world deployment of fair regression under complex structural biases. Figure 5

Figure 5: Discretization Trade-off on the Law School Dataset for black-box models not satisfying smoothness/CDF regularity. The impact of non-smoothness dissipates as f0(x,s)=(swsFfv,s1)Ffv,s(f(x,s)),f_0^*(\mathbf{x}, s) = \left( \sum_{s'} w_{s'} F_{f^*\mid v, s'}^{-1} \right)\circ F_{f^*\mid v, s}(f^*(\mathbf{x}, s)),9 increases, demonstrating robustness.

Figure 6

Figure 6

Figure 6: Robustness to minority group imbalance (v=ψ(x,s)v=\psi(\mathbf{x}, s)0). The method maintains near-zero unfairness down to low minority prevalence.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 4 likes about this paper.