Abstract
We propose a post-processing algorithm for fair classification that mitigates model bias under a unified family of group fairness criteria covering statistical parity, equal opportunity, and equalized odds, applicable to multi-class problems and both attribute-aware and attribute-blind settings. It achieves fairness by re-calibrating the output score of the given base model with a "fairness cost" -- a linear combination of the (predicted) group memberships. Our algorithm is based on a representation result showing that the optimal fair classifier can be expressed as a linear post-processing of the loss function and the group predictor, derived via using these as sufficient statistics to reformulate the fair classification problem as a linear program. The parameters of the post-processor are estimated by solving the empirical LP. Experiments on benchmark datasets show the efficiency and effectiveness of our algorithm at reducing disparity compared to existing algorithms, including in-processing, especially on larger problems.
Introduction
Machine learning models often inherit or amplify social biases present in training data. While many "fairness-aware" algorithms exist, they are often limited: some only work for binary classification, others require knowing an individual's sensitive attributes at test time, and many "in-processing" methods are computationally expensive or unstable.
LinearPost is a unified, computationally lightweight post-processing framework designed to achieve optimal group fairness across various metrics. It works for both binary and multiclass problems and remains effective even in "attribute-blind" settings where sensitive traits (like race or gender) are not visible during inference. By adjusting a model's outputs after training, LinearPost offers a flexible, model-agnostic solution that avoids the complexities of re-training.
The LinearPost Framework
The core of LinearPost is a theoretical insight: the mathematically optimal fair classifier can be expressed as a linear transformation of a standard (unfair) model's scores. Instead of simply selecting the class with the highest probability, LinearPost adds a "fairness risk" term to the model's predicted risk. This term is a weighted combination of the person's (predicted) group memberships.
The algorithm treats fairness as a set of constraints on "group-conditional moments." This perspective allows for a unified mathematical treatment of different fairness criteria, as shown in the table below.
Key components of the methodology include:
- Dual Linear Programming: The optimal weights for the transformation are found by solving a specific Linear Program (LP). This approach is significantly faster than re-training deep learning models and provides robust solutions even under strict fairness requirements.
- Attribute-Blind Handling: In scenarios where sensitive attributes are unavailable at test time, the algorithm utilizes a "group membership predictor." A key theoretical result is that this predictor only needs to be multicalibrated—accurate on average across subsets—rather than perfectly accurate to guarantee fairness.
- Randomization: To achieve exact fairness, the algorithm may use random perturbation (adding minimal noise) to break ties between classes, ensuring group-level targets are met.
Experimental Evaluation
The researchers evaluated LinearPost on several standard fairness benchmarks, including Adult & ACSIncome (income prediction), COMPAS (recidivism prediction), and BiasBios (a 28-class job title classification task).
Key Results
- Superior Tradeoffs: LinearPost consistently achieved better accuracy-fairness tradeoffs than existing post-processing methods such as MBS or FairProjection.
- Multiclass Scalability: In complex tasks like BiasBios, LinearPost scaled effortlessly, whereas competing methods often encountered memory issues or failed to converge.
- Robustness in High Fairness Regimes: The algorithm is particularly effective when strict fairness (low α tolerance) is required. Unlike in-processing methods that may struggle with optimization stability, LinearPost’s LP approach remains stable.
- Efficiency: The post-processing stage typically completes in seconds, making it suitable for large-scale applications.
Discussion and Limitations
LinearPost demonstrates that accuracy does not necessarily have to be sacrificed for fairness during the post-processing stage. If the base model is "Bayes optimal" (perfectly capturing the data distribution), LinearPost produces the best possible fair classifier.
However, some limitations remain:
- Individual vs. Group Fairness: The use of randomization to meet group-level targets means two identical individuals could receive different predictions, which may be controversial in certain sensitive applications.
- Threshold Invariance: Fairness guarantees are tied to specific decision thresholds calculated during post-processing; manual adjustments to model "strictness" later may invalidate these guarantees.
- Intersectional Complexity: While the framework supports intersecting groups (e.g., "Black Women"), the number of constraints grows exponentially with the number of sensitive attributes, potentially leading to computational bottlenecks.
Summary updated