Abstract
It has been intensively investigated that the local shape, especially flatness, of the loss landscape near a minimum plays an important role for generalization of deep models. We developed a training algorithm called PoF: Post-Training of Feature Extractor that updates the feature extractor part of an already-trained deep model to search a flatter minimum. The characteristics are two-fold: 1) Feature extractor is trained under parameter perturbations in the higher-layer parameter space, based on observations that suggest flattening higher-layer parameter space, and 2) the perturbation range is determined in a data-driven manner aiming to reduce a part of test loss caused by the positive loss curvature. We provide a theoretical analysis that shows the proposed algorithm implicitly reduces the target Hessian components as well as the loss. Experimental results show that PoF improved model performance against baseline methods on both CIFAR-10 and CIFAR-100 datasets for only 10-epoch post-training, and on SVHN dataset for 50-epoch post-training.
Introduction
In deep learning, the geometry of the loss landscape is a critical determinant of a model's ability to generalize to unseen data. It is widely accepted that "flat minima"—regions where the loss function remains relatively stable despite small perturbations in model parameters—generalize significantly better than "sharp minima." In a sharp minimum, a minor shift between the training and test data distributions can lead to a dramatic increase in loss, resulting in poor performance.
While existing techniques like Sharpness-Aware Minimization (SAM) attempt to locate these flat regions during the primary training phase, they are often computationally intensive and may not always converge to the widest possible basin. This research introduces PoF (Post-Training of Feature Extractor), a targeted refinement algorithm designed to "stretch" the local landscape of a pre-trained model to achieve greater flatness and improved generalization.
Methodology
PoF is a post-training algorithm that specifically optimizes the relationship between a network's feature extractor (the lower and middle layers) and its classifier (the final layers). The algorithm operates on the premise that the loss landscape is significantly sharper in higher layers. By focusing perturbations on the classifier space, PoF achieves efficiency gains over methods that perturb the entire network.
The PoF algorithm follows a three-step execution:
- Identification of Sharp Directions: Calculating the full Hessian matrix to find sharp directions is computationally prohibitive. Instead, PoF utilizes mini-batch gradients as a proxy. The authors demonstrate that these gradients naturally align with the directions of highest curvature within the classifier's parameter space.
- Data-Driven Perturbation Range: The algorithm performs a 1D linear search to determine the distance the classifier parameters can be pushed before reaching a local minimum for a specific mini-batch. This range is then expanded by a factor (typically $\gamma \approx 2$) to account for the expected discrepancy between training and test distributions.
- Feature Extractor Update: While the perturbed classifier remains fixed, the feature extractor is updated to minimize the loss under these challenging conditions.
By intentionally "sabotaging" the classifier through perturbations, PoF forces the feature extractor to learn more robust and well-separated features. This process implicitly smooths the sharpest components of the loss landscape.
Experimental Results
The researchers evaluated PoF using the WideResNet-28-10 architecture across several standard image classification benchmarks, including CIFAR-10, CIFAR-100, and SVHN.
Performance and Efficiency
PoF consistently improved the performance of models that had already been optimized using SAM. On the CIFAR-10 dataset, PoF reduced the test error from 2.53% to 2.41%. On the SVHN dataset, the error rate improved from 1.63% to 1.55%. Notably, these improvements were achieved with minimal additional training—requiring only 10 to 50 epochs of post-training, compared to the 200+ epochs typically required for initial training.
Landscape Flattening
Theoretical analysis and 1D loss landscape visualizations confirm that PoF effectively reduces the top eigenvalues of the Hessian matrix. This indicates a successful expansion of the "flat region" around the minimum compared to standard SGD or SAM-only approaches. This implicit Hessian regularization occurs without the need for direct second-order derivative calculations.
Discussion and Limitations
While PoF showed strong results on most benchmarks, it did not yield performance gains on the Fashion-MNIST dataset. The authors hypothesize that in certain datasets, loss deterioration is already severe in the lower layers of the network, meaning that refining the landscape via the classifier alone is insufficient.
Additionally, the expansion factor ($\gamma=2$) is currently a heuristic derived from toy experiments. Future research may explore dynamic methods for setting this value or investigate the effects of allowing the classifier to "drift" or be fine-tuned alongside the feature extractor during the post-training phase.
Conclusion
PoF offers a computationally efficient "finishing move" for deep learning models. By decoupling the co-adaptation between layers and forcing the feature extractor to compensate for a weakened classifier, PoF effectively pushes models into flatter regions of the loss landscape, resulting in measurably better generalization on unseen data.
Summary updated