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

Eyal Cohen, Christophe Denis, Mohamed Hebiri

TL;DR

This paper introduces a novel framework for fair set-valued classification, where models predict a set of plausible labels to handle ambiguity without amplifying systemic bias. The authors propose two data-driven approaches—an optimal oracle-based method and a rapid two-step proxy—that successfully enforce demographic parity and control output set size with distribution-free guarantees.

What Problem Does This Paper Address?

In multi-class classification, models often encounter ambiguous cases where multiple labels are highly plausible. Set-valued classification addresses this by returning a subset of candidate labels rather than a single forced guess, effectively reducing misclassification risk. However, if the training data contains historical biases, these set-valued models can inadvertently amplify discrimination against sensitive groups (e.g., based on gender, ethnicity, or socioeconomic status).

This paper tackles the challenge of enforcing Demographic Parity (DP) within set-valued classification—ensuring that the probability of any given class being included in the predicted set is identical across different sensitive groups. Crucially, they must achieve this fairness while simultaneously controlling the average size of the predicted set to ensure the output remains informative and doesn't simply default to returning all classes.

Methods

The authors present two distinct strategies using a semi-supervised setup, leveraging labeled data to estimate base class probabilities and independent unlabeled data to calibrate fairness and size constraints:

  1. Oracle-Based Plug-In Method: This approach directly solves a constrained optimization problem derived via Lagrangian duality. It minimizes overall classification risk while strictly bounding the expected set size and enforcing exact demographic parity. The authors provide a data-driven plug-in algorithm using an empirical Lagrangian formulation solved via standard numerical optimization tools (such as L-BFGS-B).
  2. Size-to-Fairness Two-Step Proxy: To circumvent the computational burden of complex optimization solvers, the authors introduce a simpler post-processing alternative. First, it builds an optimal unfair classifier that satisfies the size constraint globally. Second, it adjusts the thresholds for each sensitive group using stratum-specific quantiles to enforce fairness.

Datasets

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

  • Synthetic Data: Generated from a Gaussian mixture model with 4 classes and a binary sensitive attribute, allowing the authors to test the algorithms under both idealized (true probabilities known) and practical (probabilities estimated) settings.
  • DRUG Dataset: A real-world benchmark containing demographic and personality data for 1,885 individuals. The task is to predict cannabis usage levels (grouped into 4 classes: never used, not used in the past year, used in the past year but not today, and used in the past day), with the sensitive attribute being whether or not the respondent holds a college degree.

Key Insights and Ideas

  • Post-Processing Power: A key feature of both methods is their post-processing nature. You can use any black-box machine learning model (e.g., Gradient Boosting, Random Forests) to estimate initial class probabilities, and then enforce fairness and size constraints using unlabeled data alone.
  • Distribution-Free Guarantees: Remarkably, the finite-sample bounds on constraint violations (both fairness and set size) scale at a parametric rate of $\mathcal{O}(1/\sqrt{N})$ and are completely distribution-free. They hold uniformly regardless of the underlying data distribution or the quality of the base probability estimator.
  • The Quantile Non-Commutativity Catch: The authors demonstrate mathematically why the two-step proxy method is slightly suboptimal in terms of classification risk compared to the oracle. Because the quantile operator is non-linear, sorting by size first and then adjusting for fairness does not yield the exact same thresholding rules as optimizing for both constraints simultaneously.

Key Results

  • Effective Bias Mitigation: On both synthetic and real data, the proposed fair classifiers successfully reduced unfairness metrics to near-zero, contrasting sharply with standard set-valued classifiers whose unfairness scores spiked as the allowed set size ($\beta$) increased.
  • Massive Computational Speedup: For large numbers of classes ($K$), the two-step proxy method scales dramatically better than the optimizer. While the optimizer's complexity can grow cubically with the number of classes and groups ($\mathcal{O}(T(K|S|)^3N)$), the two-step method requires only simple empirical quantile computations, running in $\mathcal{O}(K|S|N)$ time.
  • Numerical Stability: In edge cases where misclassification risk approaches zero, the numerical optimizer frequently suffered from instability and violated constraints. The two-step proxy proved significantly more robust in these regions.

Limitations and Future Work

  • Risk Suboptimality: As acknowledged by the authors, the computationally efficient two-step proxy method sacrifices a bit of predictive accuracy (higher classification risk) compared to the optimal oracle approach.
  • Limited to Demographic Parity: This work focuses exclusively on Demographic Parity. Extending set-valued classification to other popular fairness criteria, such as Equalized Odds or Equal Opportunity, remains an open challenge.
  • Structured Outputs: The current framework handles standard multi-class settings; adapting it to structured output spaces, such as hierarchical classification where classes have parent-child relationships, is noted as a promising future direction.

Summary updated

BibTeX
@misc{cohen2025set,
  author = {Eyal 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