Counterfactually Fair Conformal Prediction

Ozgur Guldogan, Neeraj Sarna, Yuanyuan Li, Michael Berger

TL;DR

This paper introduces Counterfactually Fair Conformal Prediction (CF-CP), a novel method for generating prediction sets that are both statistically valid (guaranteeing coverage) and fair at an individual level (counterfactual fairness). CF-CP achieves this by symmetrizing conformity scores across hypothetical changes to protected attributes, offering a simple, training-free approach to fair uncertainty quantification.

What Problem Does This Paper Address?

In high-stakes applications like healthcare and criminal justice, machine learning models need to provide not just accurate predictions but also reliable uncertainty estimates. Conformal Prediction (CP) offers a way to generate prediction sets with guaranteed coverage, but these sets can still exhibit unfairness, particularly at the individual level (counterfactual fairness). While counterfactual fairness for point predictions is well-studied, extending it to prediction sets, which are crucial for decision-making under uncertainty, has been an open challenge. Existing fair prediction set methods primarily focus on group fairness, which might not be sufficient for applications demanding individual guarantees.

Methods

The core innovation of CF-CP lies in its approach to generating "fair" prediction sets. Instead of retraining a model or manipulating prediction sets post-hoc, CF-CP modifies the conformity score used in standard split CP. For each data point, it calculates conformity scores under various hypothetical interventions on the protected attribute (e.g., what if this person's gender was different?). These per-intervention scores are then aggregated using a symmetric, permutation-invariant function (like mean, max, or min) to create a single, "symmetrized" conformity score. This symmetrized score is then used within the standard split CP framework to produce the final prediction set. The authors prove that this method guarantees both marginal coverage and set-level counterfactual fairness, even if the underlying point predictor is not counterfactually fair.

Datasets

The authors evaluated CF-CP on a variety of datasets:

  • Synthetic Regression: A nonlinear SCM with a binary protected attribute, adapted from prior work.
  • Synthetic Classification: A multi-class SCM (10 classes) extending previous binary settings.
  • Law School: A real-world dataset predicting first-year average grades, using race as the protected attribute.
  • Bias in Bios: A real-world dataset predicting profession from biography text, using gender as the protected attribute.

They also explored the impact of noisy counterfactuals on these datasets.

Key Insights and Ideas

  • Counterfactual Fairness for Sets is Crucial: The paper highlights that while point prediction fairness is important, for decision-making under uncertainty, fair prediction sets are essential.
  • Symmetrization is Key: The novel idea of symmetrizing conformity scores across counterfactual interventions is the mechanism that bridges the gap between standard CP and counterfactual fairness for prediction sets.
  • Training-Free and Simple: CF-CP is a post-hoc procedure that doesn't require retraining the base predictor or complex feature engineering, making it practical.
  • Robustness to Noisy Counterfactuals: The method shows resilience even when counterfactuals are not perfectly accurate, a common scenario in real-world applications.
  • Preserves Predictive Accuracy: Unlike some fairness methods that trade accuracy for fairness, CF-CP aims to maintain the performance of the original predictor.

Key Results

  • Counterfactual Fairness Achieved: CF-CP significantly reduces counterfactual set disparity (CSD) across various datasets, often achieving CSD=0 (perfect fairness) with oracle counterfactuals.
  • Guaranteed Coverage: The method maintains the marginal coverage guarantee of standard split CP.
  • Minimal Set Size Increase: Prediction sets generated by CF-CP are only slightly larger than those from standard split CP, and comparable to or smaller than other counterfactually fair methods.
  • Robustness Demonstrated: Even with noisy counterfactuals, CF-CP methods show similar robustness to other fair methods and maintain a significant reduction in CSD compared to split CP.
  • Comparison to Baselines: CF-CP outperforms post-hoc union methods (which lead to overcoverage) and retraining-based methods (which can reduce accuracy or require more complex setups).

Limitations and Future Work

  • Invertible SCM Assumption: The theoretical guarantees rely on an invertible structural causal model (SCM) assumption. While the authors note that approximate fairness can still be achieved without this, it's a theoretical limitation.
  • Computational Overhead: CF-CP introduces an O(|A|) factor overhead for generating counterfactuals, where |A| is the cardinality of the protected attribute. This is manageable for small attribute sets.
  • Future Directions: The authors suggest extending CF-CP to:
  • Path-dependent counterfactual fairness, considering specific causal pathways.
  • Dynamic settings where covariates and protected attributes evolve over time.

Summary updated

BibTeX
@inproceedings{guldogan2026counterfactually,
  author = {Ozgur Guldogan and Neeraj Sarna and Yuanyuan Li and Michael Berger},
  title = {{Counterfactually Fair Conformal Prediction}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=JoBnhpd9PQ},
}
Figure