[Paper Review] Learning Rates as a Function of Batch Size: A Random Matrix Theory Approach to Neural Network Training
This paper proposes a random matrix theory-based framework to model the Hessian of deep neural networks under mini-batching, showing that batch Hessian extremal eigenvalues exceed empirical Hessian values due to sampling fluctuations. It derives analytically that SGD learning rates should scale linearly with batch size, while Adam learning rates should scale with the square root of batch size—offering a principled, generalizable rule for hyperparameter scheduling across architectures and datasets.
We study the effect of mini-batching on the loss landscape of deep neural networks using spiked, field-dependent random matrix theory. We demonstrate that the magnitude of the extremal values of the batch Hessian are larger than those of the empirical Hessian. We also derive similar results for the Generalised Gauss-Newton matrix approximation of the Hessian. As a consequence of our theorems we derive an analytical expressions for the maximal learning rates as a function of batch size, informing practical training regimens for both stochastic gradient descent (linear scaling) and adaptive algorithms, such as Adam (square root scaling), for smooth, non-convex deep neural networks. Whilst the linear scaling for stochastic gradient descent has been derived under more restrictive conditions, which we generalise, the square root scaling rule for adaptive optimisers is, to our knowledge, completely novel. %For stochastic second-order methods and adaptive methods, we derive that the minimal damping coefficient is proportional to the ratio of the learning rate to batch size. We validate our claims on the VGG/WideResNet architectures on the CIFAR-$100$ and ImageNet datasets. Based on our investigations of the sub-sampled Hessian we develop a stochastic Lanczos quadrature based on the fly learning rate and momentum learner, which avoids the need for expensive multiple evaluations for these key hyper-parameters and shows good preliminary results on the Pre-Residual Architecure for CIFAR-$100$.
Motivation & Objective
- To understand how mini-batching affects the Hessian’s extremal eigenvalues in deep neural networks.
- To derive general, architecture- and dataset-agnostic rules for learning rate scaling with batch size in both SGD and adaptive optimizers.
- To develop a Lanczos-based algorithm for direct learning rate and momentum optimization using batch Hessian curvature.
- To validate theoretical predictions on real-world models like VGG-16 and WideResNet on CIFAR-100 and ImageNet.
- To investigate the persistence of spectral outliers (outliers in Hessian eigenvalue spectrum) during training and their implications for generalization and optimization dynamics.
Proposed method
- Models the batch Hessian as a spiked, field-dependent random matrix, where the full Hessian is perturbed by sampling fluctuations due to mini-batching.
- Derives analytical expressions for the extremal eigenvalues of the batch Hessian as a function of batch size, showing dependence on spectral outliers: inverse proportionality to batch size if outliers are well-separated, inverse square root otherwise.
- Applies the same framework to the Generalised Gauss-Newton (GGN) matrix approximation of the Hessian, extending results to second-order optimization contexts.
- Uses stochastic Lanczos quadrature to estimate curvature-based learning rates and momenta directly from the batch Hessian, avoiding costly multiple evaluations.
- Empirically validates scaling rules on VGG-16 and WideResNet-28×10 using CIFAR-100 and ImageNet-32, with controlled hyperparameters including weight decay and batch normalization.
- Analyzes spectral outliers in Hessian eigenvalue distributions at initialization and training end, linking their presence to model generalization and training stability.
Experimental results
Research questions
- RQ1How does mini-batching affect the extremal eigenvalues of the Hessian in deep neural networks?
- RQ2What is the functional dependence of the maximal stable learning rate on batch size for SGD and Adam optimizers?
- RQ3Can spectral outliers in the Hessian eigenvalue spectrum be linked to model generalization and training dynamics?
- RQ4How does the batch Hessian differ from the empirical Hessian in terms of curvature fluctuations due to sampling?
- RQ5Can a Lanczos-based algorithm effectively learn optimal learning rates and momenta directly from the batch Hessian without full Hessian computation?
Key findings
- The extremal eigenvalues of the batch Hessian are larger than those of the empirical Hessian due to sampling-induced fluctuations, with magnitude inversely proportional to batch size when spectral outliers are well-separated.
- For SGD, the maximal stable learning rate scales linearly with batch size, generalizing prior results under less restrictive assumptions.
- For adaptive optimizers like Adam with fixed damping, the maximal stable learning rate scales with the square root of the batch size—a novel rule not previously derived.
- The proposed learning rate scaling rules outperform alternative rules in training stability and convergence, with failures observed when using incorrect scaling in high-batch regimes.
- Spectral outliers persist from initialization to training end in VGG-16 and 1-layer MLPs on CIFAR-100, suggesting a link between outlier structure and model capacity or generalization.
- The Lanczos-based learning rate and momentum learner, trained on the batch Hessian, shows promising performance on the Pre-Residual architecture for CIFAR-100 without requiring multiple Hessian evaluations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.