Fast Variance Reduction Method with Stochastic Batch Size

Xuanqing Liu, Cho-Jui Hsieh

This paper bridges a critical gap between theoretical optimization and the messy reality of computer hardware. While many variance reduction methods focus strictly on minimizing the number of data points processed, the authors argue that how you access those points—sequentially or randomly—is just as important for real-world speed.

The Disconnect Between Theory and Hardware

In large-scale machine learning, Stochastic Gradient Descent (SGD) is popular but suffers from high variance, requiring a decaying learning rate that slows down convergence. Variance Reduction (VR) methods like SAGA and SVRG solve this, achieving a "linear" convergence rate that gets to the optimal answer much faster.

However, there is a fundamental disconnect between optimization theory and hardware practice:

  1. The Theory: Standard mathematical analysis suggests that a batch size of 1 is optimal for minimizing the total number of data points accessed to reach convergence.
  2. The Reality: Modern hardware (CPUs, RAM, and Disks) is deeply optimized for sequential access. Reading a continuous block of data is significantly faster than jumping around to random memory addresses (random access).

The authors set out to create a framework that allows for randomized batch sizes, specifically accounting for this "cache/disk IO effect" to minimize actual wall-clock running time rather than just theoretical iteration counts.

Introducing SAGA++

The paper introduces a unified framework for Variance Reduction with Stochastic Batch Size. At each step, the algorithm randomly chooses a batch size $b$ from a distribution and then samples a batch of that size to perform a variance-reduced update.

Their primary contribution is the SAGA++ algorithm, which strategically mixes two types of updates to balance hardware efficiency with algorithmic progress:

  • Sequential High-Speed Updates: With probability $p$, it performs a full gradient update (batch size $n$). This benefits massively from high-speed sequential data access.
  • Random High-Frequency Updates: With probability $1-p$, it performs a single-sample update (batch size 1), which provides the rapid, high-frequency progress characteristic of standard SAGA.

Additionally, for sparse datasets (like those using $\ell_1$ regularization), the authors developed a "lazy update" technique. This allows the algorithm to skip updating variables that aren't in the current batch until they are actually needed, keeping the cost per iteration low even when the gradient memory is dense.

Key Insights and Ideas

The authors formalize the hardware constraints by defining the "Cache Effect Ratio" ($\eta$). This is the ratio of time taken for sequential access versus random access ($T_{seq} / T_{rand}$). If $\eta$ is small (meaning sequential access is vastly faster), the algorithm should perform full-gradient passes more frequently.

Furthermore, they demonstrate that the "optimal" average batch size isn't just a hardware constant; it depends heavily on the condition number ($\kappa$) of the optimization problem. For well-conditioned problems, larger batches are better; for ill-conditioned ones, smaller batches are preferred.

Theoretical properties and empirical performance of SAGA++.

The authors also prove that "SAGA-style" updates (which update the gradient memory every time a sample is seen) are theoretically superior to "SVRG-style" updates (which only update the memory once per epoch). SAGA++ leverages this SAGA-style update, ensuring it always uses the "freshest" possible gradient information.

Empirical Results

The authors evaluated their method on three large-scale click-through rate (CTR) prediction datasets from the LIBSVM repository (kddb, avazu, and criteo), which contain tens of millions of samples. These datasets are ideal for testing the cache effect because they are too large to fit easily into the fastest levels of memory, making IO efficiency critical.

  • Hardware Validation: The authors measured that sequential access was roughly 2x to 3x faster than random access across their test machines, justifying the core design philosophy of SAGA++.
  • Theoretical Convergence: They successfully proved a linear convergence rate for their stochastic batch size framework under the assumption of strong convexity and smoothness.
  • Wall-Clock Speedup: In experiments, SAGA++ consistently outperformed SAGA, SVRG, and even the highly optimized LIBLINEAR (a proximal Newton method) in terms of actual time required to reach a target suboptimality.
Wall-clock time comparison across different regularization parameters.

Limitations and Future Work

While highly effective, SAGA++ has a few limitations:

  • Memory Overhead: Like standard SAGA, SAGA++ requires storing a scalar for each training sample to maintain the gradient memory. While this $O(n)$ requirement is manageable for Generalized Linear Models (GLMs), it can become a significant memory burden for more complex models or extremely large datasets.
  • Parameter Sensitivity: The optimal probability $p$ for choosing a full batch depends on knowing the condition number $\kappa$ and the hardware ratio $\eta$. In practice, these might need to be estimated or tuned, adding complexity for the end-user.
  • Non-Convexity: The current theoretical analysis is limited to strongly convex functions. Extending this framework to non-convex problems, such as deep learning, remains an open and promising area for future research.

Summary updated

BibTeX
@inproceedings{liu2018fast,
  author = {Xuanqing Liu and Cho-Jui Hsieh},
  title = {{Fast Variance Reduction Method with Stochastic Batch Size}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=BJ4CPo-uWH},
}
Figure