BN-invariant Sharpness Regularizes the Training Model to Better Generalization

Mingyang Yi, Huishuai Zhang, Wei Chen, Zhi-Ming Ma, Tie-Yan Liu

Introduction

In deep learning, the geometry of the loss landscape is closely linked to generalization. "Flatter" minima, where the loss is relatively stable under small parameter perturbations, are generally preferred over "sharp" minima. However, the introduction of Batch Normalization (BN) complicates this relationship. BN induces scale-invariance: multiplying a layer's weights by a constant does not change the network's output, yet it significantly alters the perceived sharpness when measured by a fixed-radius ball. This scale ambiguity renders standard sharpness metrics unreliable for modern architectures.

BN-Sharpness: A Scale-Invariant Metric

To address this, we introduce BN-Sharpness, a novel metric designed to remain invariant under the scaling transformations of BN layers. Unlike traditional measures that use a fixed-radius neighborhood, BN-Sharpness employs a neighborhood that scales proportionally with the parameter norms.

Mathematically, BN-Sharpness is defined as a one-dimensional integral of the loss difference along the steepest direction within this relative neighborhood. This formulation ensures that the metric respects the underlying symmetries of the model, providing a consistent proxy for generalization regardless of parameter scaling. This approach is further supported by theoretical links to PAC-Bayesian generalization bounds.

Regularized Optimization with SGDS

We propose a training routine that explicitly optimizes for flatness by incorporating BN-Sharpness into the loss function: $$\min_{\theta} L(\theta) + \lambda (\text{BN-Sharpness})$$

To maintain computational efficiency, the authors utilize optimization on Oblique manifolds to identify the sharpest direction. Furthermore, Taylor expansion approximations are employed to reduce the overhead of calculating high-dimensional integrals, making the resulting algorithm, SGDS, practical for large-scale training.

Experimental Evaluation

The effectiveness of BN-Sharpness regularization was evaluated on CIFAR-10 and CIFAR-100 datasets using architectures such as LeNet and VGG11 (modified with BN).

CIFAR-10 Performance

On CIFAR-10, SGDS demonstrates superior performance compared to vanilla SGD and other flatness-seeking methods like Entropy-SGD. This is particularly evident in large-batch training scenarios, which typically suffer from a generalization gap due to convergence to sharp minima.

Accuracy comparison on CIFAR-10 between SGD, SGDS, and Entropy SGD.

CIFAR-100 and VGG11 Results

Experiments on CIFAR-100 with VGG11 further validate the approach. SGDS consistently achieves higher test accuracy, effectively closing the generalization gap by forcing the optimizer into flatter regions of the parameter space.

Accuracy comparison on CIFAR-100 showing SGDS outperforming vanilla SGD and Entropy SGD.

Conclusion

BN-Sharpness provides a theoretically grounded and scale-invariant framework for understanding and improving generalization in networks with Batch Normalization. By aligning the sharpness metric with architectural symmetries, SGDS enables more robust training and better performance on unseen data. Future work includes extending this framework to other normalization techniques like Layer Norm and simplifying the manifold optimization process for broader adoption.

Summary updated

BibTeX
@inproceedings{yi2019bn,
  author = {Mingyang Yi and Huishuai Zhang and Wei Chen and Zhi-Ming Ma and Tie-Yan Liu},
  title = {{BN-invariant Sharpness Regularizes the Training Model to Better Generalization}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.24963/ijcai.2019/578},
}
Figure