SOREL: A Stochastic Algorithm for Spectral Risks Minimization

Yuze Ge, Rujun Jiang

Introduction

Machine learning typically optimizes for average performance using Empirical Risk Minimization (ERM), which treats the loss of every training sample equally. While effective for general accuracy, ERM often ignores the "tail" of the distribution—the specific samples or minority groups where the model performs terribly. Real-world applications increasingly require us to care about these worst-case scenarios, fairness, and outliers.

To address this, researchers employ spectral risk minimization, which assigns higher weights to samples with higher losses. A common example is Conditional Value at Risk (CVaR), which focuses exclusively on the top $\alpha$% of worst losses.

Common spectral risks and their parameter formulations.

However, optimizing spectral risks is mathematically challenging. Because the weights depend on the ranking of the losses, the objective function is inherently non-smooth.

  • Deterministic methods can solve this but require calculating the loss for every sample at every step ($O(n)$ complexity), making them prohibitively slow for large datasets.
  • Existing stochastic (mini-batch) methods either fail to converge to the true minimum due to biased gradient estimates, or they rely on adding a strongly concave smoothing function. This smoothing makes the problem solvable but means the algorithm is no longer optimizing the original spectral risk.

This paper introduces SOREL (Stochastic Optimizer for Spectral Risks minimization with trajectory Stabilization), the first stochastic gradient-based algorithm with theoretical convergence guarantees for minimizing true spectral risks without relying on mathematical smoothing approximations.

How SOREL Works

SOREL tackles the non-smooth optimization gap through three core mechanisms:

  1. Minimax Reformulation: Instead of sorting losses at every step to determine weights, SOREL frames the problem as a primal-dual "minimax" game. It alternates between updating the model parameters to minimize loss and updating the sample weights to maximize the penalty on bad predictions.
  2. Trajectory Stabilization: A major issue with alternating updates is wild oscillation. If two samples have the exact same loss, the algorithm can get confused about which one to weight higher, causing the model parameters to bounce back and forth. SOREL neutralizes this by adding a "proximal term" to the weight update—a mathematical penalty that prevents the weights from changing too drastically from one step to the next.
  3. Variance Reduction: To accelerate the stochastic updates for the model parameters, SOREL employs a variance reduction technique inspired by SVRG. It occasionally computes a full-batch gradient to keep the stochastic mini-batch steps anchored in the correct direction.

Key Results and Insights

The authors evaluated SOREL across several domains, including tabular regression, fair machine learning, and out-of-distribution (OOD) generalization.

Optimization Precision and Speed SOREL consistently reached the true optimal solution (suboptimality $< 10^{-7}$). In contrast, baselines like SGD, LSVRG, and Prospect often plateaued or failed to converge to the exact optimum because of their inherent biases or smoothing approximations. SOREL achieved these results with lower sample complexity and faster CPU runtimes than state-of-the-art methods, largely because it avoids calculating expensive projections at every single stochastic step.

Convergence comparison of SOREL against baselines across various datasets and spectral risks.

Fairness and Robustness * Fairness Improvements: On the acs classification dataset (predicting employment), using SOREL with the Extremile spectral risk improved the Equal Opportunity fairness metric by ~94% compared to standard ERM, while achieving the lowest suboptimality among all optimizers. * Robustness to Distribution Shifts: On the amazon dataset (predicting review ratings based on BERT embeddings across different reviewers), SOREL achieved the lowest worst-group classification error. This proves that optimizing the true spectral risk translates directly to better out-of-distribution generalization.

Theoretical Guarantees Crucially, SOREL proves you do not have to settle for solving a "smoothed" approximation of your risk metric. The algorithm achieves an $\tilde{O}(1/\sqrt{\epsilon})$ convergence rate. This mathematically matches the known lower limit for deterministic methods, meaning SOREL is theoretically near-optimal for this class of problems.

Limitations and Future Work

Currently, SOREL's theoretical convergence proofs rely on the individual loss functions being convex and having a strongly convex regularizer (like L2 regularization).

However, the authors suggest extending these theoretical guarantees to non-convex problems, such as deep neural networks, in future work. Preliminary experiments training 2-layer neural networks showed that SOREL empirically outperformed baselines, suggesting the algorithm is highly effective in practice even without formal non-convex proofs. Future research will also explore broader applications in distributionally robust optimization (DRO).

Summary updated

BibTeX
@inproceedings{ge2025sorel,
  author = {Yuze Ge and Rujun Jiang},
  title = {{SOREL: A Stochastic Algorithm for Spectral Risks Minimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=pdF86dyoS6},
}
Figure