Abstract: The choice of batch-size in a stochastic optimization algorithm plays a substantial role for both optimization and generalization. Increasing the batch-size used typically improves optimization but degrades generalization. To address the problem of improving generalization while maintaining optimal convergence in large-batch training, we propose to add covariance noise to the gradients. We demonstrate that the learning performance of our method is more accurately captured by the structure of the covariance matrix of the noise rather than by the variance of gradients. Moreover, over the convex-quadratic, we prove in theory that it can be characterized by the Frobenius norm of the noise matrix. Our empirical studies with standard deep learning model-architectures and datasets shows that our method not only improves generalization performance in large-batch training, but furthermore, does so in a way where the optimization performance remains desirable and the training duration is not elongated.
The Generalization Gap in Large-Batch Training
In deep learning, the choice of batch size dictates a fundamental tradeoff between optimization and generalization. Small-batch Stochastic Gradient Descent (SGD) introduces a high degree of intrinsic gradient noise, which acts as an implicit regularizer. This noise helps the model settle into wide, flat minima that generalize well to unseen data.
However, to utilize modern parallel hardware and speed up training, practitioners prefer large batch sizes. The problem is that large batches yield highly accurate gradient estimates, stripping away that beneficial intrinsic noise. Consequently, large-batch training suffers from a "generalization gap"—the model optimizes the training data quickly but performs worse on test data. The challenge is to engineer a synthetic noise to inject into large-batch SGD that recovers small-batch generalization without destroying the fast convergence speed of large batches.
Methodology: Diagonal Fisher Noise
The naive solution to the generalization gap is to simply add artificial noise to large-batch updates. However, adding isotropic Gaussian noise is often ineffective, and adding noise modeled after the Full Empirical Fisher matrix (which mimics small-batch noise) ruins convergence speed, making large-batch training as slow as small-batch training.
To find the optimal balance, this research proposes adding Diagonal Fisher noise. By injecting a Gaussian noise vector into the large-batch gradient update where the covariance matrix is proportional to the diagonal of the Empirical Fisher Information Matrix, the noise retains the structural properties needed to regularize the model while significantly reducing the overall magnitude of the perturbation.
Key Insights: Structure and the Frobenius Norm
A central finding of this work is that the structure of gradient noise is far more important than its raw variance. While it is commonly assumed that the amount of variance dictates optimization speed, the authors found that Large-Batch with Diagonal Fisher has roughly the same high gradient variance as Small-Batch training, yet it converges much faster.
Through mathematical analysis of a convex quadratic toy model, the authors proved that the convergence rate of noisy SGD is bounded by the Frobenius norm of the noise covariance matrix. Because the Diagonal Fisher matrix drops the off-diagonal terms, its Frobenius norm is vastly smaller than that of the Full Fisher matrix, explaining its superior convergence properties.
Empirical Results
The authors evaluated their method on standard image classification benchmarks including MNIST, Fashion-MNIST, CIFAR-10, and CIFAR-100. Key results include:
- Optimization Speed: Large-Batch (LB) with Diagonal Fisher converges almost as fast as standard LB training, and drastically faster than Small-Batch (SB) or LB with Full Fisher noise.
- Generalization Recovery: The method successfully recovers a significant portion of the generalization gap. On CIFAR-10 (ResNet44), standard LB accuracy dropped to 91.93% (from SB's 93.42%), but LB + Diagonal Fisher recovered performance to 92.88%.
- Flatter Minima: By measuring the maximum eigenvalue of the Hessian matrix, the authors confirmed that Diagonal Fisher noise finds flatter minima, closely resembling those found by Small-Batch SGD.
Conclusion
Injecting structured covariance noise—specifically Diagonal Fisher noise—into large-batch updates offers a practical way to close the generalization gap. By focusing on the structure of the noise and minimizing the Frobenius norm of the covariance matrix, researchers can maintain the efficiency of large-batch training while enjoying the regularization benefits typically reserved for small-batch optimization.
Summary updated