Abstract
We develop and analyze a new algorithm for empirical risk minimization, which is the key paradigm for training supervised machine learning models. Our method---SAGD---is based on a probabilistic interpolation of SAGA and gradient descent (GD). In particular, in each iteration we take a gradient step with probability $q$ and a SAGA step with probability $1-q$. We show that, surprisingly, the total expected complexity of the method (which is obtained by multiplying the number of iterations by the expected number of gradients computed in each iteration) is minimized for a non-trivial probability $q$. For example, for a well conditioned problem the choice $q=1/(n-1)^2$, where $n$ is the number of data samples, gives a method with an overall complexity which is better than both the complexity of GD and SAGA. We further generalize the results to a probabilistic interpolation of SAGA and minibatch SAGA, which allows us to compute both the optimal probability and the optimal minibatch size. While the theoretical improvement may not be large, the practical improvement is robustly present across all synthetic and real data we tested for, and can be substantial. Our theoretical results suggest that for this optimal minibatch size our method achieves linear speedup in minibatch size, which is of key practical importance as minibatch implementations are used to train machine learning models in practice.
Introduction: The Problem with Standard SAGA
In modern machine learning, Empirical Risk Minimization (ERM) involves minimizing loss functions across massive datasets. While Gradient Descent (GD) is stable, its per-iteration cost is prohibitive. Stochastic methods like SAGA offer a middle ground by using variance reduction to achieve linear convergence with single-sample updates. However, SAGA is often sub-optimal in practice because it doesn't naturally exploit the parallel processing power of modern hardware through minibatches. This paper addresses a surprising question: Can we improve SAGA by occasionally "resetting" the gradient memory with a full gradient or minibatch step?
Methods: Optimization with a Coin Flip
The proposed algorithm, SAGD (SAGA with Gradient Descent), is elegantly simple. In each iteration, the algorithm flips a biased coin with probability $q$:
- Heads (prob $q$): Perform a full Gradient Descent step (or a large minibatch SAGA step).
- Tails (prob $1-q$): Perform a standard, single-sample SAGA step.
Using a Lyapunov function analysis, we prove that there exists a non-trivial, optimal value for $q$ that minimizes the total expected complexity. This "reset" effect periodically refreshes the gradient memory, preventing variance-reduction errors from drifting too far and stabilizing the convergence path.
Experimental Results
We evaluated SAGD against standard SAGA and GD using synthetic datasets and real-world benchmarks from the LIBSVM database (e.g., ijcnn1, a9a, and australian). The results consistently show that the theoretical formulas for the optimal minibatch size ($\tau^*$) and reset probability ($q^*$) match experimental performance almost perfectly.
Key Insights
- Wall-Clock Speedup: In experiments on ridge regression and logistic loss, SAGD reached high accuracy ($10^{-10}$ error) significantly faster than SAGA in terms of actual seconds.
- Linear Speedup: The method achieves a linear speedup in minibatch size. Doubling the parallel processing capability (minibatch size) roughly halves the training time, which is essential for scaling on GPUs.
- Robustness: The improvement was present across all tested datasets, regardless of the problem's condition number.
Conclusion
SAGD demonstrates that standard SAGA is theoretically and practically sub-optimal. By introducing a probabilistic interpolation with gradient descent, we can stabilize variance reduction and achieve significant wall-clock speedups. Crucially, SAGD provides a theoretical foundation for linear speedup in minibatch size, making it a highly practical choice for modern, parallelized machine learning workflows. Future work will explore extending this probabilistic framework to non-convex landscapes typical of deep learning.
Summary updated