Random-reshuffled SARAH does not need full gradient computations

Aleksandr Beznosikov, Martin Takác

Introduction

In large-scale optimization for machine learning, the goal is typically to minimize a "finite-sum" objective function $P(w) = \frac{1}{n} \sum_{i=1}^n f_i(w)$. While Stochastic Gradient Descent (SGD) is the standard approach, its convergence is often slowed by the inherent noise (variance) of stochastic gradients. Variance reduction methods like SARAH (Stochastic Recursive grAdient algoritHm) were designed to achieve linear convergence by using recursive gradient estimates. However, SARAH traditionally requires periodic "full gradient" computations—calculating the gradient over the entire dataset of $n$ points—to reset its estimate. This "full gradient tax" becomes a massive computational hurdle when $n$ is in the millions.

Shuffled-SARAH: Methods and Innovation

Aleksandr Beznosikov and Martin Takáč introduce Shuffled-SARAH, a variant that eliminates the need for these costly full gradient checkpoints. Instead of random sampling with replacement, Shuffled-SARAH employs data shuffling strategies such as Random Reshuffling (RR), Shuffle-Once (SO), or Incremental Gradient (IG).

The core innovation is the algorithm's ability to aggregate gradient information on the fly. As it passes through a shuffled permutation of the data, it maintains a running average of the gradients encountered. This accumulated average from the previous pass serves as the "anchor" for the current pass's recursive updates. Crucially, this method only requires $O(d)$ additional memory, maintaining the same footprint as standard SGD while providing the benefits of variance reduction.

Theoretical Insights

The authors prove that Shuffled-SARAH achieves deterministic convergence estimates regardless of whether RR, SO, or IG is used. This is a significant departure from standard SGD analysis, where shuffling strategies often lead to different theoretical rates. Furthermore, the algorithm's complexity is tied to a Hessian similarity parameter $\delta$. In datasets where individual loss functions are similar, the algorithm achieves exceptional speed.

Empirical Results

The performance of Shuffled-SARAH was evaluated on logistic regression problems with $\ell_2$-regularization using standard benchmarks: mushrooms, a9a, and w8a.

Convergence of Shuffled-SARAH variants compared to standard SARAH across three benchmark datasets.

As shown in the convergence plots above, Shuffled-SARAH (both RR and SO variants) significantly outperforms the original SARAH algorithm. Even when the original SARAH is given "optimal" tuned parameters, the shuffled versions converge in fewer epochs.

A key insight of the paper is that the internal gradient estimate $v$ naturally converges to the true full gradient $\nabla P(w)$ as the model approaches the optimum.

Evolution of the gradient estimation error on the a9a dataset, demonstrating the vanishing error of the internal estimate.

This vanishing gradient error, visualized in the figure above, validates the intuition that a full gradient reset is unnecessary if the data is accessed in a structured, shuffled manner.

Conclusion

Shuffled-SARAH provides a powerful alternative to traditional variance reduction methods by removing the requirement for full gradient computations. While the current theoretical analysis is limited to strongly convex functions, the empirical results demonstrate its state-of-the-art efficiency. Future work will investigate its application in non-convex landscapes and the impact of high data heterogeneity.

Summary updated

BibTeX
@article{beznosikov2024random,
  author = {Aleksandr Beznosikov and Martin Takác},
  title = {{Random-reshuffled SARAH does not need full gradient computations}},
  journal = {Optim. Lett.},
  year = {2024},
  doi = {10.1007/s11590-023-02081-x},
}
Figure