Variance Reduction Methods Do Not Need to Compute Full Gradients: Improved Efficiency through Shuffling

Daniil Medyakov, Gleb Molodtsov, Saveliy Chezhegov, Alexey Rebrikov, Aleksandr Beznosikov · DOI

TL;DR

This paper introduces a novel approach to variance reduction methods for large-scale machine learning that eliminates the need for computationally expensive full gradient calculations. By combining a shuffling heuristic with ideas from SAG/SAGA, they achieve competitive or improved convergence rates while being more memory-efficient, making them more practical for real-world applications.

What Problem Does This Paper Address?

Training machine learning models on massive datasets often involves solving a finite-sum minimization problem. While stochastic gradient descent (SGD) is a common approach, its convergence can be slow due to high variance in gradient estimates. Variance Reduction (VR) methods like SVRG and SARAH significantly improve convergence by reducing this variance. However, a major bottleneck for these methods is the requirement to periodically compute the full gradient of the objective function, which is computationally prohibitive for large datasets. This paper tackles the challenge of developing VR methods that achieve fast convergence without this expensive full gradient computation, while also being memory-efficient.

Methods

The core innovation of this paper lies in approximating the full gradient without actually computing it. They achieve this by:

  • Shuffling Heuristic: Instead of randomly sampling data points at each iteration, they use a shuffling heuristic. This ensures that each data point's gradient is computed exactly once per epoch.
  • SAG/SAGA Concept: They leverage the idea from SAG/SAGA methods, which use a moving average of past gradients to approximate the full gradient. In their approach, this moving average is updated iteratively within an epoch, effectively approximating the full gradient at a reference point without storing all past gradients.
  • Modified VR Algorithms: They adapt two popular VR algorithms, SVRG and SARAH, to incorporate this full gradient approximation. This allows them to eliminate the need for explicit full gradient computations at the end of each epoch or at specific intervals.

Datasets

The authors evaluated their methods on the following datasets:

  • CIFAR-10 and CIFAR-100: Used for image classification tasks with the ResNet-18 model.
  • ijcnn1 and a9a: Used for non-linear least squares regression experiments.
  • Tiny ImageNet: Used for fine-tuning a Swin Transformer model for image classification.

Key Insights and Ideas

  • Full Gradients are Overkill: The paper demonstrates that for variance reduction methods, computing the exact full gradient might not be necessary. An accurate approximation, especially when combined with a shuffling strategy, can yield comparable or even better results.
  • Shuffling is Key to Efficiency: The shuffling heuristic is crucial. It not only ensures that all data points are seen within an epoch but also provides a structured way to build an approximation of the full gradient over time.
  • Memory Efficiency Matters: By avoiding the storage of all past gradients (as in some SAG/SAGA variants) and eliminating periodic full gradient computations, their methods are significantly more memory-efficient, making them suitable for very large-scale problems.
  • Improved Strong Convexity Rates: While matching standard shuffling methods for non-convex objectives, their approach shows an improvement in convergence rates for strongly convex problems.

Key Results

  • Competitive Convergence: Their proposed "No Full Gradient" (NFG) SVRG and SARAH algorithms achieve convergence rates that match or improve upon existing methods, particularly in the strongly convex setting.
  • Efficiency Gains: Experiments on CIFAR-10 and CIFAR-100 with ResNet-18 show that NFG SVRG and NFG SARAH achieve faster convergence in terms of full gradient computations compared to their standard counterparts. They also demonstrate reduced training loss oscillations and improved test accuracy.
  • Scalability: The methods are shown to be scalable on large-scale image classification tasks.
  • Theoretical Guarantees: The paper provides theoretical convergence bounds for both non-convex and strongly convex objectives, demonstrating the validity of their approach.

Limitations and Future Work

  • Non-Optimality Gap: While their upper bounds are competitive, the paper acknowledges a gap between their theoretical upper bounds and existing lower bounds for shuffling methods, suggesting potential for further theoretical improvements.
  • Parameter Tuning: The paper notes that while their methods perform well with theoretical step sizes, optimal performance might require careful tuning of hyperparameters, a topic that falls outside the theoretical scope of the current work.
  • Mini-batching: The authors suggest that future research could explore incorporating mini-batching strategies into their framework to potentially achieve even better performance.
  • Adaptive Updates: The paper raises an intriguing question about whether more frequent or adaptive updates of the reference point ($w_s$) could further enhance convergence rates.

Summary updated

BibTeX
@misc{medyakov2025variance,
  author = {Daniil Medyakov and Gleb Molodtsov and Saveliy Chezhegov and Alexey Rebrikov and Aleksandr Beznosikov},
  title = {{Variance Reduction Methods Do Not Need to Compute Full Gradients: Improved Efficiency through Shuffling}},
  year = {2025},
  eprint = {2502.14648},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.14648},
}
Figure