Relationship between Batch Size and Number of Steps Needed for Nonconvex Optimization of Stochastic Gradient Descent using Armijo Line Search
Yuki Tsukada, Hideaki Iiduka
TL;DR
The paper addresses how batch size interacts with the number of steps in nonconvex optimization when using SGD with Armijo-line-search learning rates. It derives a convergence bound showing that the best-case gradient norm scales as $\min_{k< K} \mathbb{E}[\|\nabla f(\bm{\theta}_k)\|^2] \le C_1/K + C_2/b$, and proves that the required steps $K(b)$ are monotone decreasing and convex in $b$, while the SFO complexity $N(b)=K(b)b$ is convex with a unique minimizer $b^* = \frac{2 C_2}{\epsilon^2}$. The results imply a critical batch size beyond which additional batching yields diminishing returns, and the theory is supported by numerical experiments on ResNets and MLPs that identify near-optimal $b^*$ values. Overall, the work provides a principled framework for selecting batch size to minimize gradient evaluations while achieving a given accuracy in nonconvex SGD with Armijo line search.
Abstract
While stochastic gradient descent (SGD) can use various learning rates, such as constant or diminishing rates, the previous numerical results showed that SGD performs better than other deep learning optimizers using when it uses learning rates given by line search methods. In this paper, we perform a convergence analysis on SGD with a learning rate given by an Armijo line search for nonconvex optimization indicating that the upper bound of the expectation of the squared norm of the full gradient becomes small when the number of steps and the batch size are large. Next, we show that, for SGD with the Armijo-line-search learning rate, the number of steps needed for nonconvex optimization is a monotone decreasing convex function of the batch size; that is, the number of steps needed for nonconvex optimization decreases as the batch size increases. Furthermore, we show that the stochastic first-order oracle (SFO) complexity, which is the stochastic gradient computation cost, is a convex function of the batch size; that is, there exists a critical batch size that minimizes the SFO complexity. Finally, we provide numerical results that support our theoretical results. The numerical results indicate that the number of steps needed for training deep neural networks decreases as the batch size increases and that there exist the critical batch sizes that can be estimated from the theoretical results.
