Nonconvex Variance Reduced Optimization with Arbitrary Sampling

Samuel Horváth, Peter Richtárik

Introduction

In machine learning, training models often involves solving Empirical Risk Minimization (ERM) problems—finding model parameters that minimize the average loss across a massive dataset. While Stochastic Gradient Descent (SGD) is the workhorse of the field, it suffers from high variance because it only evaluates a small subset of data at a time.

Variance Reduction (VR) methods like SVRG and SAGA were developed to address this, offering faster convergence by progressively refining the gradient estimate. However, most existing VR research has focused on convex problems or relied on uniform sampling (picking data points with equal probability). In practice, most interesting problems—such as deep learning—are non-convex, and some data points are inherently "more important" or "noisier" than others.

This paper introduces the first importance sampling variants for variance-reduced algorithms (SVRG, SAGA, and SARAH) specifically designed for non-convex optimization. By leveraging a framework called "arbitrary sampling," the authors derive optimal minibatch selection strategies that can achieve superlinear speedups, outperforming standard uniform sampling by up to four orders of magnitude on real-world datasets.

Methods: The Arbitrary Sampling Framework

The authors utilize a mathematical framework called Arbitrary Sampling. Instead of selecting one item at a time, they treat the selection of a minibatch as a random set-valued mapping. This allows them to analyze virtually any randomized strategy for selecting data.

Key methodological contributions include:

  • General Analysis: The authors provide complexity results for non-convex versions of SVRG, SAGA, and SARAH that hold for any proper sampling strategy.
  • Optimal Sampling ($S^*$): They mathematically derive the exact probabilities needed to minimize iteration complexity. This strategy typically assigns higher sampling probabilities to data points with larger "smoothness constants" ($L_i$), which represent how volatile the gradient is for that specific point.
  • Approximate Independent Sampling ($S^a$): Recognizing that "perfect" independent sampling can be computationally expensive for large datasets, they designed a more efficient approximation that retains the benefits of importance sampling with lower overhead.

Experimental Setup

The researchers evaluated their methods using binary classification tasks with a non-convex sigmoid loss function. They used four standard datasets from the LIBSVM collection: covtype, ijcnn1, splice, and australian. These datasets were chosen because their smoothness constants ($L_i$) are non-uniform, making them ideal for testing whether importance sampling provides a tangible benefit over uniform sampling.

Training loss comparison between optimal ($S^*$) and uniform ($S^u$) sampling.

Key Insights and Results

  • The "Aha" Moment on Speedup: In standard stochastic optimization, doubling your minibatch size usually yields a linear speedup at best. Surprisingly, the authors found that with their optimal sampling, you can achieve superlinear speedup. In certain regimes, doubling the batch size might more than double the training speed.
  • Smoothness Matters: The core idea is that not all data points are created equal. By sampling points where the gradient changes rapidly (high $L_i$) more frequently, the algorithm reduces the overall variance of the gradient estimator much faster than uniform sampling.
  • Unified Theory: The "Arbitrary Sampling" approach allowed the authors to improve upon existing minibatch analyses even for the standard uniform case, providing tighter bounds than previous state-of-the-art papers.

Performance Gains

For all three algorithms (SVRG, SAGA, SARAH), the importance sampling variants reached lower loss values and smaller gradient norms significantly faster than their uniform counterparts.

Gradient norm reduction across multiple datasets.

Most notably, in experiments on the australian dataset, importance sampling outperformed uniform sampling by four orders of magnitude in terms of gradient norm reduction. The paper proves that their proposed $S^*$ sampling is the "optimal" choice among all possible sampling distributions for a fixed minibatch size, providing a new theoretical benchmark for the field.

Limitations and Future Work

  • Knowledge of Smoothness: The method requires knowing (or estimating) the smoothness constants $L_i$ for every data point. While the authors mention these can often be estimated, calculating these constants accurately in very complex models (like massive Transformers) remains a challenge.
  • Computational Overhead: While the $S^a$ sampling is efficient, there is still a slight computational cost to non-uniform sampling compared to simple uniform shuffling.
  • Deep Learning Scale: While the theory applies to non-convex functions generally, the experiments were conducted on classic ML datasets. Testing these optimal samplings on large-scale deep neural networks (like ResNets or LLMs) is a natural next step to see if the superlinear speedups hold in those high-dimensional spaces.

Summary updated

BibTeX
@inproceedings{horvath2019nonconvex,
  author = {Samuel Horváth and Peter Richtárik},
  title = {{Nonconvex Variance Reduced Optimization with Arbitrary Sampling}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
}
Figure