Set to Be Fair: Demographic Parity Constraints for Set-Valued Classification

Eyal Haïm Cohen, Christophe Denis, Mohamed Hebiri · DOI · OpenReview

Introduction

In many high-stakes decision-making environments, a single "top-1" prediction from a machine learning model can be overly restrictive or dangerously certain in the face of ambiguity. Set-valued classification offers a robust alternative by allowing models to output a set of candidate labels (e.g., predicting that an image contains either a "dog" or a "cat"). While this approach effectively reduces misclassification risk by accounting for uncertainty, it introduces a significant risk of bias amplification.

If a model exhibits higher uncertainty for specific demographic groups, it may consistently return larger, more vague sets for those individuals. In sensitive domains such as hiring, medical diagnostics, or credit scoring, such discrepancies can lead to systemic discrimination. This paper introduces a framework to ensure set-valued classifiers remain fair by enforcing demographic parity constraints without sacrificing predictive utility.

The Problem: Balancing Accuracy, Size, and Equity

The core challenge addressed in this research is the construction of a classifier that minimizes misclassification risk—the probability that the true label is excluded from the predicted set—while satisfying two competing constraints:

  1. Demographic Parity (DP): The probability of any specific class being included in the predicted set must be equal across different sensitive groups (e.g., gender, ethnicity, or educational background).
  2. Expected Size: To ensure the predictions remain useful and interpretable, the average number of labels in the output set must be capped at a predefined threshold.

Proposed Methodologies

The authors propose two post-processing strategies that can be applied to any existing model that outputs class probabilities. These methods are semi-supervised, utilizing a small labeled dataset to estimate probabilities and a larger unlabeled dataset to calibrate fairness and size constraints.

1. The Oracle-Based Plug-in

This method approaches the problem as a constrained optimization task using Lagrangian multipliers. It is theoretically optimal, identifying the best possible trade-off between risk and fairness. The Oracle method employs a thresholding rule where the threshold is dynamically adjusted for each class and sensitive group to ensure parity.

2. The Two-Step "Size-to-Fairness" Classifier

Recognizing that the Oracle method can become computationally expensive as the number of classes ($K$) increases, the authors developed a high-speed alternative:

  • Step 1: Construct a standard classifier that meets the size constraint but may remain unfair.
  • Step 2: Apply a fairness correction by re-thresholding based on the quantiles of the class-conditional distributions.

This two-step approach is particularly effective for large-scale problems and remains numerically stable even when the base model's risk is near zero.

Empirical Evaluation

The researchers evaluated these methods using both synthetic and real-world data:

  • Synthetic Data: A Gaussian mixture model with four classes and a binary sensitive attribute was used to simulate controlled levels of bias.
  • DRUG Dataset: This real-world dataset contains demographic and personality data for 1,885 individuals. The task was to predict cannabis usage levels (categorized into four levels of frequency) using "college degree status" as the sensitive attribute.

Key Insights and Results

Distribution-Free Guarantees

A major contribution of this work is the proof that fairness and size constraints are satisfied at a rate of $1/\sqrt{N}$ (where $N$ is the number of unlabeled samples), regardless of the underlying data distribution. This provides a high degree of reliability for real-world deployment where data distributions are often unknown or shifting.

The "Fairness Tax"

Empirical results demonstrate that enforcing demographic parity results in only a marginal increase in classification risk. The researchers found that the massive gain in equity—reducing unfairness to near-zero levels—far outweighs the minor drop in predictive performance.

Efficiency and Stability

While the Oracle method is mathematically optimal, the Two-Step method proved to be a practical necessity for complex tasks. For datasets with a large number of classes (e.g., $K=50$), the Two-Step method outperformed the Oracle by orders of magnitude in runtime. Furthermore, it remained robust in high-accuracy regimes where standard optimizers (like L-BFGS-B) often encounter numerical instability.

Conclusion and Future Directions

This framework demonstrates that it is possible to transform biased "black-box" models into fair, set-valued classifiers without the need for expensive retraining. By focusing on post-processing, the authors provide a model-agnostic tool for equitable machine learning.

Future work will look to expand this framework beyond Demographic Parity to other fairness criteria, such as Equalized Odds, which accounts for true positive rates across groups. Additionally, the authors aim to explore how these constraints can be applied to structured output problems, such as hierarchical classification or sequence tagging, where the relationship between labels is more complex.

Summary updated

BibTeX
@misc{cohen2025set,
  author = {Eyal Haïm Cohen and Christophe Denis and Mohamed Hebiri},
  title = {{Set to Be Fair: Demographic Parity Constraints for Set-Valued Classification}},
  year = {2025},
  eprint = {2510.04926},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.04926},
}
Figure