FairStacks: Fair Model Stacking
- FairStacks is a convex fair model stacking meta-learner that uses linear combinations of pre-trained classifiers to expand the fairness–accuracy Pareto frontier.
- It employs a constrained convex optimization framework integrating score-bias constraints, regularization, and a bias-budget parameter to enforce group fairness.
- Empirical evaluations demonstrate that FairStacks consistently improves both fairness and accuracy across diverse datasets and benchmark tasks.
FairStacks is a convex “fair model stacking” meta-learner designed to expand and optimize the empirical Pareto frontier of the fairness–accuracy tradeoff in machine learning, enabling practitioners to maximize accuracy for a prescribed level of group fairness. By leveraging linear combinations of pre-trained base classifiers and enforcing a strict score-bias constraint, FairStacks consistently improves both the best-achievable fairness and accuracy on benchmark tasks, providing a model-agnostic and post-processing approach to algorithmic fairness (Little et al., 2022).
1. Formalization of the Fairness–Accuracy Pareto Frontier
Let denote any finite collection of pre-trained predictors , where each maps features to a probability score or a hard label . Each model is evaluated by:
- an accuracy measure , increasing in “better” fits (e.g., classification accuracy, , etc.)
- a group-fairness measure , increasing in “more fair” behavior (e.g., )
Pareto Optimal Model: A model 0 is Pareto-optimal if there is no 1 with 2 and 3, with at least one inequality strict.
TAF Curve: The Tradeoff-between-Fairness-and-Accuracy curve for 4 is 5, where
6
7 reports the best achievable accuracy by any model in 8 meeting at least fairness level 9. Practically, this is computed by sorting 0 in decreasing fairness and tracking the running maximum of accuracy.
FAUC: For a nonnegative weight function 1, the weighted Fairness-Area-Under-the-Curve is
2
Unweighted (3), 4 is the ordinary area under the TAF curve. This enables direct, model-agnostic comparison of model families on fairness and accuracy, even when their tradeoff curves cross.
2. Score Bias and Group Fairness Constraint
FairStacks ensembles are constructed as linear combinations of base models 5. For two contrast groups 6 (e.g., 7 vs 8 for a binary attribute):
- Score Bias: For weight vector 9 and score matrix 0,
1
- For each base model 2, 3. By linearity,
4
The ensemble bias constraint directly encodes any group fairness constraint definable as a difference in expectation between groups.
3. FairStacks Convex Optimization Framework
FairStacks solves the constrained optimization:
5
where:
- 6 are training features and labels,
- 7 is the vector of base-model scores,
- 8 is a convex surrogate loss (e.g., squared error, binomial deviance),
- 9 is a ridge penalty for regularization,
- 0 is a bias-budget parameter (smaller 1 enforces stricter fairness).
Alternatively, a penalized form may be solved:
2
where 3 is varied across a grid to trace the fairness–accuracy frontier.
4. Algorithmic Solution and Implementation
The FairStacks algorithm proceeds as follows:
- Inputs: Pre-trained base models 4; training data 5; protected groups 6.
- Precompute:
- 7 for all 8.
- 9.
- Grid search: Select grid 0 for bias penalty; grid for 1 (via cross-validation).
- For each 2: Solve convex program for weights 3 (via Newton or QP solvers):
4
- Compute fairness 5; accuracy 6 or direct 7.
- Accumulate 8 pairs to form taf curve and compute area under it for fauc.
- Output: 9, 0, ensemble weights 1.
5. Theoretical Guarantees
FairStacks provides several formal properties:
- Frontier Expansion (Proposition 1): For original models 2 and FairStacks solutions 3,
4
Since all 5 can be realized as stacking solutions with 6, and the stacking set is a superset of 7, stacking always expands the Pareto frontier.
- Monotonicity in Fairness (Theorem 2): Under mild assumptions on the decision function 8 (e.g., thresholding), the decision-level fairness of weights 9 improves (bias decreases) as 0, so the constraint yields (approximately) monotonic increases in group fairness.
6. Empirical Evaluation
Performance of FairStacks was evaluated on five benchmark datasets:
| Dataset | Size / Features | Protected Attributes |
|---|---|---|
| Adult Income | 1k, 2 | gender, race |
| Bank Marketing | 3k, 4 | age 5? |
| COMPAS Recidivism | 6k, 7 | race, gender |
| Default of Credit Card | 8k, 9 | gender |
| Communities & Crime | 0k, 1 | race |
Base learners included standard random-forest trees, “minipatch” trees (1,000 sub-sample trees), Scikit-learn/XGBoost classifiers, and three in-processing fairness methods: Adversarial Debiasing [Zhang et al. 2018], Reduction-Based Fair Classification [Agarwal et al. 2018], and Fair Adversarial GBT [Grari et al. 2019]. Data were split 2 train / 3 stacking-CV / 4 test; 5-fold CV for 5 was performed within the stacking split to optimize the 6-step-weighted fauc. Brier score was used for 7 to emphasize calibrated probabilities.
Selected results (FAUC, Demographic Parity, mean 8 SE, 10 random splits):
| Method | Adult (gender) | COMPAS (race) | Default (gender) | C&C (race) |
|---|---|---|---|---|
| Random Forest | 9 | 0 | 1 | 2 |
| Zhang et al. (2018) | 3 | 4 | 5 | — |
| Grari et al. (2019) | 6 | 7 | 8 | — |
| Agarwal et al. (2018) | 9 | 00 | 01 | — |
| FS on minipatch trees | 02 | 03 | 04 | 05 |
| FS on RF trees | 06 | 07 | 08 | 09 |
| FS on all classifiers | 10 | 11 | 12 | 13 |
| FS Kitchen-Sink (all) | 14 | 15 | 16 | 17 |
In all settings, FairStacks ensembles dominate competing methods—their taf curves are strictly above all baselines for every fairness level, yielding the highest area (FAUC). The “kitchen-sink” ensemble, pooling all base learners, consistently achieves the best fairness–accuracy balance.
7. Relevance and Context
FairStacks is a simple, entirely model-agnostic, post-processing meta-learner. It can accept any collection of pre-fitted predictors and, by solving a single convex program per fairness budget 18, efficiently traces and expands the empirical Pareto frontier between fairness and accuracy. Theoretical guarantees and empirical results demonstrate pointwise expansion of the frontier and consistently higher FAUC on diverse real-world datasets, providing practitioners and researchers with an effective plug-and-play approach to optimize the fairness–accuracy tradeoff (Little et al., 2022).