Distributionally Robust Learning with Weakly Convex Losses: Convergence Rates and Finite-Sample Guarantees

Landi Zhu, Mert Gürbüzbalaban, Andrzej RuszczyńskiarXiv 2023 · DOI · arXiv

TL;DR

This paper introduces a new algorithm, Stochastic Compositional Subgradient (SCS), to solve distributionally robust optimization (DRO) problems involving non-convex and non-smooth loss functions. By reformulating the problem as a two-level stochastic composition, the authors achieve a state-of-the-art sample complexity of $O(\varepsilon^{-3})$ for finding stationary points, providing a theoretical foundation for robust deep learning.

What Problem Does This Paper Address?

Standard machine learning models often fail when the test data distribution differs slightly from the training data—a phenomenon known as distribution shift. Distributionally Robust Optimization (DRO) aims to fix this by training models to perform well against the "worst-case" distribution within a certain "ambiguity set" around the training data.

However, most existing DRO methods assume the loss functions are either convex or smooth. In modern machine learning (like deep learning), losses are typically non-convex and can be non-smooth (e.g., using ReLU activations or non-convex regularizers). This paper tackles the challenge of weakly convex losses—a broad class of functions that are non-convex but "not too far" from convex—and provides the first finite-sample convergence guarantees for this setting.

Methods

The authors reformulate the DRO problem (specifically using the mean-semideviation risk measure) into a two-level stochastic compositional optimization problem. This means the objective looks like $f(x, h(x))$, where both $f$ and $h$ are stochastic functions.

They propose the Stochastic Compositional Subgradient (SCS) method, which features:

  • Single Time-Scale Update: Unlike nested algorithms that require many inner-loop steps for every outer step, SCS updates both levels simultaneously, making it more efficient.
  • Two Tracking Variants:
    1. For smooth losses, they use linearized tracking.
  • For non-smooth losses, they integrate the SPIDER estimator (Stochastic Path-Integrated Differential Estimator) to track the inner function values more accurately and reduce the bias inherent in stochastic compositions.
  • Moreau Envelope Analysis: To measure convergence in a non-smooth, non-convex landscape, they use the norm of the gradient of the Moreau envelope as their stationarity metric.

Datasets

The authors evaluated their algorithm on two main tasks:

  1. MNIST (Deep Learning): A convolutional neural network (CNN) with ELU activations was trained to classify handwritten digits. This tested the algorithm's robustness against adversarial "PGM attacks" and "semi-deviation attacks."
  2. Blog Feedback Dataset: A regression task involving 281 variables to predict the number of comments on blog posts. This was used to test the algorithm with non-convex penalties like SCAD and MCP, which are common in high-dimensional statistics but difficult to optimize.

Key Insights and Ideas

  • Composition is the Key: By viewing DRO through the lens of compositional optimization, the authors can leverage specialized tools to handle the "bias" that occurs when an expectation is nested inside a non-linear function.
  • The Power of Weak Convexity: Weakly convex functions (functions that become convex if you add a large enough quadratic term) cover a huge range of practical ML applications, including most neural networks with smooth activations and many robust regression models.
  • Efficiency Gains: Achieving $O(\varepsilon^{-3})$ sample complexity is a significant result. For context, many general non-convex stochastic problems require $O(\varepsilon^{-4})$ samples. The authors show that the "cost" of being robust (DRO) doesn't necessarily ruin the convergence rate.

Key Results

  • Theoretical Guarantee: The authors proved that SCS achieves a sample complexity of $O(\varepsilon^{-3})$ for both smooth and non-smooth weakly convex losses.
  • Robustness in Deep Learning: On MNIST, the SCS algorithm produced models that were significantly more resilient to distribution shifts and adversarial noise compared to standard Stochastic Gradient Descent (SGD).
  • Superiority over WRM: In "semi-deviation" attacks, SCS outperformed the state-of-the-art Wasserstein Robust Method (WRM), demonstrating that the mean-semideviation approach is a powerful alternative for certain types of data perturbations.
  • Consistent Regression Performance: The algorithm showed nearly identical convergence speeds whether using convex (Lasso) or non-convex (SCAD/MCP) regularizers, proving its versatility.

Limitations and Future Work

  • Ambiguity Set Choice: The results are specific to the mean-semideviation risk measure. While powerful, other ambiguity sets (like those based on KL-divergence or general Wasserstein balls) might require different algorithmic treatments.
  • Hyperparameter Sensitivity: The SPIDER-based version of the algorithm requires careful tuning of batch sizes ($B$ and $b$) and epoch lengths ($T$), which can be computationally demanding to find in practice.
  • Higher-Level Compositions: Real-world problems sometimes involve more than two levels of nested expectations (e.g., reinforcement learning). Extending this $O(\varepsilon^{-3})$ complexity to multi-level compositions remains an open challenge.

Summary updated

Abstract

We consider a distributionally robust stochastic optimization problem and formulate it as a stochastic two-level composition optimization problem with the use of the mean--semideviation risk measure. In this setting, we consider a single time-scale algorithm, involving two versions of the inner function value tracking: linearized tracking of a continuously differentiable loss function, and SPIDER tracking of a weakly convex loss function. We adopt the norm of the gradient of the Moreau envelope as our measure of stationarity and show that the sample complexity of $\mathcal{O}(\varepsilon^{-3})$ is possible in both cases, with only the constant larger in the second case. Finally, we demonstrate the performance of our algorithm with a robust learning example and a weakly convex, non-smooth regression example.
BibTeX
@misc{zhu2023distributionally,
  author = {Landi Zhu and Mert Gürbüzbalaban and Andrzej Ruszczyński},
  title = {{Distributionally Robust Learning with Weakly Convex Losses: Convergence Rates and Finite-Sample Guarantees}},
  year = {2023},
  eprint = {2301.06619},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.06619},
}
Figure