Size-adaptive Hypothesis Testing for Fairness

Antonio Ferrara, Francesco Cozzi, Alan Perotti, André Panisson, Francesco Bonchi

TL;DR

Standard algorithmic fairness audits rely on rigid, arbitrary thresholds that ignore statistical uncertainty, making them highly unreliable for small, intersectional demographic groups. This paper introduces SAFT (Size-Adaptive Fairness Testing), a unified framework that blends a frequentist Wald test for large subgroups with a Bayesian Dirichlet-multinomial model for small ones, turning fairness auditing into a rigorous, sample-size-aware statistical decision.

What Problem Does This Paper Address?

When auditing machine learning models for bias, practitioners typically calculate a point estimate of a fairness metric (like Statistical Parity) and check if it exceeds a fixed threshold (e.g., the EEOC's "four-fifths rule"). However, this approach treats a subgroup of 10 people the same as a subgroup of 10,000, completely ignoring sampling error.

This issue becomes critical when dealing with intersectionality—analyzing fairness at the cross-section of multiple attributes (e.g., "Asian women over 45"). As combinations become more granular, the data splits into a long tail of tiny, sparse subgroups. In these small groups, fairness metrics exhibit massive variance. A fixed-threshold audit will frequently trigger false alarms by mistaking random sampling noise for systemic discrimination, or conversely, fail to detect statistically significant bias in massive subgroups because the disparity falls just below an arbitrary threshold.

Methods

The authors propose SAFT (Size-Adaptive Fairness Testing), a framework that dynamically adapts its mathematical approach based on the size of the subgroup being audited:

  1. Large-Sample Regime ($\tilde{n} \ge 30$): The authors prove a new Central Limit Theorem (CLT) result for the statistical parity difference. This allows them to calculate analytic confidence intervals and deploy a frequentist Wald test. If the $p$-value is below a chosen significance level $\alpha$, the null hypothesis of "no disparity" is rejected.
  2. Small-Sample Regime ($\tilde{n} < 30$): For the long tail of small intersectional groups where asymptotic assumptions break down, SAFT switches to a fully Bayesian Dirichlet-multinomial model. By leveraging posterior conjugate updates, it uses Monte Carlo sampling to estimate finite-sample credible intervals.

Crucially, as the sample size grows, the Bayesian credible intervals naturally smooth and converge into the frequentist Wald intervals, providing a seamless transition across all group sizes.

Datasets

The framework was evaluated using an XGBoost classifier trained on four standard fairness benchmark datasets:

  • COMPAS: Recidivism risk screening data, audited across race, age, and sex.
  • Adult Income: Census data predicting whether annual income exceeds \$50k, audited across race, age, and sex.
  • German Credit: Bank loan applicant data, audited across sex, age, and foreign worker status.
  • Student Performance: Secondary school academic achievement data, audited across age, sex, parental cohabitation status, and address type.

Key Insights and Ideas

  • The "Resolution Limit" of Intersectionality: There is a hard statistical floor to fairness auditing. If a subgroup is too small, it is mathematically impossible to prove discrimination, no matter how extreme the observed point-estimate disparity is. SAFT explicitly charts this "no-power" zone.
  • Class Imbalance Steepens the Hill: The paper demonstrates that as the global negative prediction rate increases, the required subgroup size to prove a fairness violation grows steeply. Under severe class imbalance, auditing rare subgroups becomes exceptionally difficult.
Figure 1: Resolution limits for Statistical Parity violations under varying global negative rates P(f(x) = 0), when detecting disadvantaged groups (the dual figure showing the boundary for deciding if a group is being advantaged, is reported in Figure 5 of the Appendix). Each curve traces the minimal fraction of negative outcomes needed to reject H0: SP(S) = 0 at α = 0.05 as a function of the group size ns. To the left of each vertical bar is the “no-power” zone, where subgroups are too small to detect discrimination, regardless of the observed disparity. The shaded region above each curve is the “discrimination zone”, where the subgroup’s negative rate is enough to establish a statistically significant parity violation.

Key Results

The empirical evaluation highlights the severe pitfalls of fixed-threshold auditing ($\delta$SP) compared to SAFT:

  • Preventing False Alarms: For small groups (e.g., the "Other, >45, Female" group in COMPAS, where $n$ ranges from 1 to 6), a fixed threshold flags a fairness violation. SAFT correctly reveals that the confidence intervals are too wide to make a definitive claim, preventing a false positive.
  • Detecting Hidden Bias: For very large groups, SAFT can confidently reject the null hypothesis and signal a violation even if the point estimate sits safely inside a standard fixed-threshold "no-detection" band, because the massive sample size makes even minor variations statistically significant.
Point-wise estimation vs. SAFT confidence intervals on the COMPAS dataset. Panel (b) shows a small group where fixed thresholds falsely flag a violation, while SAFT's wide intervals correctly show the data is too noisy.

Limitations and Future Work

  • Prior Sensitivity: The small-sample Bayesian component inherently requires choosing a prior distribution. While the authors use a weakly informative flat Dirichlet prior by default, this remains a modeling choice that can influence results when data is extremely scarce.
  • Metric Scope: The primary focus and mathematical proofs in this work center on group fairness definitions (specifically Statistical Parity and Equal Opportunity). The authors leave the empirical validation of other group metrics, as well as extensions to individual and counterfactual fairness frameworks, to future work.

Summary updated

BibTeX
@inproceedings{ferrara2025size,
  author = {Antonio Ferrara and Francesco Cozzi and Alan Perotti and André Panisson and Francesco Bonchi},
  title = {{Size-adaptive Hypothesis Testing for Fairness}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=v34WBRPSon},
}
Figure