NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Improving Generalization of Deep Neural Networks by Optimum Shifting

Yuyan Zhou, Ye Li, Lei Feng, Sheng-Jun Huang

TL;DR

The authors introduce Optimum Shifting (OS), a novel, penalty-free method that improves deep neural network generalization by shifting parameters from a sharp minimum to a flatter one. By treating internal matrix multiplications as under-determined linear equations, the method finds flatter solutions that achieve the exact same training loss.

What Problem Does This Paper Address?

Modern deep neural networks (DNNs) are highly overparameterized, meaning their loss landscapes contain a vast number of "minima"—configurations of weights that achieve near-zero training error. However, not all minima are created equal. Minima located in flat regions of the loss landscape tend to generalize much better to unseen test data than those in sharp, narrow valleys.

Existing methods to find these desirable flat regions (like Sharpness-Aware Minimization, or SAM) typically rely on adding penalty terms to the loss function during training. This paper tackles a more fundamental, post-hoc question: Can we take an already-optimized network at a sharp minimum and directly move it to a flatter one without changing its training loss?

Methods

The core insight of Optimum Shifting (OS) lies in the final linear layer of a neural network, represented as a matrix multiplication: $$AV = Z$$ where $A$ is the input matrix (features from the penultimate layer), $V$ represents the network parameters, and $Z$ is the output.

Because deep networks are overparameterized, this system of equations is highly under-determined, meaning there are infinite choices of $V$ that produce the exact same output $Z$ (and thus the exact same training loss). The authors mathematically prove that minimizing the Frobenius norm of the weight matrix ($\|V\|^2$) minimizes both the upper and lower bounds of the Hessian trace, which directly corresponds to flattening the loss landscape.

To make this computationally practical, the authors propose Stochastic Optimum Shifting (SOS). Instead of optimizing over the entire dataset, they perform the shift on small mini-batches. They leverage the theory of Neural Collapse (NC)—the empirical phenomenon where last-layer features of the same class collapse to their class means late in training. Because of Neural Collapse, keeping the loss unchanged on a small, representative batch ensures that the loss remains probabilistically unchanged across the entire dataset.

The algorithm uses Gaussian elimination to ensure the input matrix rows are linearly independent, then solves a constrained least-squares problem to update the weights in a closed-form solution.

Figure 1: Schematic of the OS algorithm.2

Datasets

The authors evaluated their method across several standard computer vision benchmarks:

  • CIFAR-10 and CIFAR-100: Used for image classification across various architectures (VGG-16, ResNet-18, ResNet-50, DenseNet-201).
  • ImageNet: Used to validate scalability on large-scale image classification using pre-trained models (ResNet-50, ShuffleNet_V2, ResNext50).
  • PASCAL VOC: Used to test generalization on object detection tasks using YOLOv5s and YOLOv5x.

Key Insights and Ideas

  • Loss-Preserving Flatness: Flatness and low training error do not have to be traded against each other. Due to the geometry of overparameterized solution spaces, perfectly identical loss values can exist in both sharp and flat configurations.
  • Neural Collapse as a Practical Bridge: Neural Collapse bridges the gap between local batch adjustments and global dataset stability. It allows a localized, batch-level constraint to effectively preserve the global empirical loss.
  • Constraint-Objective Separation: Unlike penalty-based methods that mix loss minimization and flatness optimization into a single gradient, OS treats them as isolated objectives. This makes it highly versatile and modular.

Key Results

The authors tested SOS in two scenarios: applying it post-hoc to already-trained models, and integrating it directly into the training loop.

  • Post-Hoc Improvements: Applying SOS to standard pre-trained models consistently boosted test accuracy without any retraining. For example, VGG-16 on CIFAR-100 improved from 72.23% to 73.38%, and ResNet-50 on ImageNet improved its top-1 accuracy from 76.14% to 76.61%.
  • Integration with Training: When combined with standard SGD or advanced sharpness-minimizers like SAM, SOS consistently achieved the best overall performance. On CIFAR-100, ResNet-50 trained with SAM + SOS achieved 82.41% accuracy compared to 81.65% for SAM alone.
  • Hessian Analysis: Eigenvalue visualizations confirmed that SOS successfully minimized both the Hessian trace (average sharpness) and the top eigenvalue (worst-direction sharpness).

Limitations and Future Work

The primary limitation of Optimum Shifting is its heavy reliance on the Neural Collapse phenomenon. While Neural Collapse is a robust property of deep classifiers in computer vision, it is less thoroughly explored or verified in other domains. Consequently, the current formulation of SOS is limited to image-based tasks. The authors note that extending this technique to non-vision domains, such as Natural Language Processing (NLP), remains an open direction for future research.

Summary updated

BibTeX
@inproceedings{zhou2025improving,
  author = {Yuyan Zhou and Ye Li and Lei Feng and Sheng-Jun Huang},
  title = {{Improving Generalization of Deep Neural Networks by Optimum Shifting}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i10.33181},
}
Figure