Loss Balancing for Fair Supervised Learning

Mohammad Mahdi Khalili, Xueru Zhang, Mahed Abroshan

Executive Summary

In the pursuit of fair machine learning, practitioners must often choose between competing definitions of fairness. While many interventions focus on equalizing discrete classification outcomes, ensuring that the expected cost of error—the loss—is equal across demographic groups is equally critical. This metric, known as Equalized Loss (EL), is conceptually elegant but notoriously difficult to optimize. Imposing an equality constraint on loss functions introduces non-convexity into the training process, causing standard optimization tools to fail or settle in local optima.

This paper introduces ELminimizer, a novel algorithm that guarantees a global optimum for Equalized Loss fairness. By reducing the non-convex problem into a sequence of standard convex optimizations, ELminimizer outperforms existing heuristic-based baselines and provides a mathematically grounded path to fair supervised learning.

The Challenge of Equalized Loss

Most fairness interventions target classification metrics, such as ensuring the same percentage of loan approvals across different racial groups (Statistical Parity) or equalizing true positive rates (Equal Opportunity). However, in high-stakes domains like medical diagnosis, risk assessment, or insurance pricing, the accuracy of the underlying probability estimate is paramount.

Equalized Loss (EL) addresses this by requiring that the average loss (e.g., Mean Squared Error or Binary Cross-Entropy) be identical across protected groups. The primary obstacle to EL is mathematical: even if the base loss function is perfectly convex (resembling a smooth, U-shaped bowl), the constraint that "Loss for Group A must exactly equal Loss for Group B" creates a non-convex feasible region. Consequently, standard convex programming tools cannot reliably find the optimal fair predictor, and existing fair learning algorithms either do not apply to EL or lack theoretical guarantees for global optimality.

Methodology: Taming Non-Convexity

To solve the EL optimization problem, the authors propose a framework that leverages off-the-shelf convex solvers (like CVXPY) through three distinct approaches:

  1. ELminimizer (The Global Optimizer): The core breakthrough of the paper is a reduction technique that bypasses the non-convex equality constraint. The authors demonstrate that the solution can be "sandwiched" using a binary search-like strategy. By solving a sequence of convex constrained problems—specifically, capping the loss of one group at a varying threshold $\lambda$—the algorithm reliably converges to the global optimum.
  2. Fast Sub-optimal Interpolation: For scenarios where computational speed is prioritized over strict optimality, the authors introduce a faster alternative. This method finds a "fair-enough" predictor by interpolating along a straight line between the best overall unconstrained model and the model optimized solely for the disadvantaged group.
  3. Deep Learning Fine-Tuning: While the theoretical guarantees of ELminimizer rely on convex loss functions, the authors extend its utility to deep neural networks. By freezing the feature extractor and applying the algorithm to fine-tune only the final classification or regression layer, practitioners can enforce EL fairness in complex, non-linear models without retraining from scratch.

Experimental Validation and Key Results

The researchers evaluated their methods on two classic fairness benchmarks: the Law School Admission Dataset (a regression task predicting first-year grades based on LSAT and GPA, with race as the sensitive attribute) and the Adult Income Dataset (a binary classification task predicting income levels, with race as the sensitive attribute).

  • Guaranteed Optimality: In the Law School regression task, ELminimizer achieved the lowest overall Mean Squared Error (MSE) while strictly satisfying the fairness constraint, outperforming baseline approaches like the Penalty Method and Linear Relaxation.
  • Stability and Reliability: In the Adult classification task, the proposed algorithms achieved the desired fairness level with significantly lower variance than FairBatch, a popular heuristic baseline that relies on sampling tricks and is highly sensitive to random seeds.
  • Success in Deep Learning: When applied to a neural network via the fine-tuning approach, the framework successfully reduced the loss disparity from a baseline of 0.65 down to nearly 0.07, incurring only a negligible penalty to overall accuracy.

Insights and Future Directions

The paper highlights several critical insights for the fairness community. First, by focusing on continuous loss rather than discrete labels, the EL framework transitions seamlessly between regression and classification tasks. Second, the authors establish a theoretical connection between EL and Bounded Group Loss (BGL), proving that an optimal EL-fair model inherently prevents any single group's loss from exceeding twice the target fairness threshold.

Despite its strengths, the approach has limitations. The theoretical guarantee for a global optimum strictly requires a convex loss function; while it works perfectly for training surrogates like Cross-Entropy, it does not directly apply to Zero-One loss (raw accuracy). Additionally, the current mathematical formulation is restricted to binary protected groups (e.g., $A \in \{0, 1\}$). Extending this framework to handle multiple or intersecting protected attributes (such as race, gender, and age simultaneously) remains an open challenge. Finally, while ELminimizer is highly efficient compared to blind non-convex searches, solving a sequence of optimization problems introduces computational overhead that may be prohibitive for extremely high-dimensional models without utilizing the final-layer fine-tuning shortcut.

Summary updated

BibTeX
@inproceedings{khalili2023loss,
  author = {Mohammad Mahdi Khalili and Xueru Zhang and Mahed Abroshan},
  title = {{Loss Balancing for Fair Supervised Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=aT7Q3Rz33o},
}
Figure