Abstract
Ensuring deep neural networks generalize to unseen data remains a fundamental challenge. Sharpness-Aware Minimization (SAM) has emerged as a potent technique for improving generalization by steering models toward flatter minima. However, SAM's requirement for two sequential gradient computations doubles the training time. We introduce Random Weight Perturbation (RWP), an efficient alternative that utilizes filter-wise random noise to approximate the benefits of adversarial perturbations. RWP allows for parallel gradient computation, effectively halving SAM's training time while delivering superior accuracy and robustness across benchmarks like ImageNet and CIFAR-10-C.
Introduction
Deep Neural Networks (DNNs) often possess excessive capacity, leading them to converge into "sharp minima"—regions where small weight perturbations result in significant loss increases. Such regions are typically associated with poor generalization. While SAM addresses this by minimizing the maximum loss in a neighborhood, its sequential nature creates a computational bottleneck. This paper proposes Random Weight Perturbation (RWP) to decouple these steps, enabling efficient, parallelizable training that promotes flatness without the 2× overhead.
Methodology: Decoupling Sharpness Optimization
The core innovation of RWP lies in replacing the expensive adversarial search for the "worst-case" perturbation with structured random noise.
Filter-wise Random Noise
Unlike standard Gaussian noise, RWP employs filter-wise perturbations. The noise magnitude is scaled by the norm of each individual filter or neuron, ensuring the perturbation respects the model's internal weight distribution. This sensitivity prevents the noise from being too disruptive to small-norm filters while effectively challenging larger ones.
Parallel Gradient Computation
SAM requires a first gradient step to find the adversarial direction, followed by a second step at the perturbed location. RWP breaks this dependency. Since the random perturbation is independent of the current gradient, the gradients for the original loss and the perturbed loss can be computed simultaneously.
When hardware resources permit parallel execution, RWP matches the wall-clock training time of standard Stochastic Gradient Descent (SGD), providing a "free" generalization boost.
Experimental Results
The authors evaluated RWP across various architectures (ResNet, ViT) and datasets (CIFAR, ImageNet).
Performance and Efficiency
On ImageNet with a ResNet-50, RWP achieved a top-1 accuracy of 78.04%, outperforming SAM by 1.1% while being significantly faster. The training curves demonstrate that RWP not only reaches higher final accuracy but also exhibits faster convergence in terms of epochs compared to standard SGD and SAM.
Robustness to Corruptions
RWP shows remarkable resilience to data distribution shifts. On the CIFAR-10-C benchmark, which includes various image corruptions, RWP outperformed SAM by 3.0% at the highest severity level. This suggests that the "softer" but larger-radius perturbations allowed by RWP lead to even flatter and more robust minima than SAM's "hard" adversarial approach.
Discussion and Conclusion
RWP demonstrates that the benefits of flatness-aware optimization do not strictly require the sequential overhead of adversarial training. By utilizing filter-wise random noise, RWP acts as a dynamic regulator for filter growth, encouraging a more balanced and robust internal representation. While RWP requires additional memory or compute for parallelization, its ability to match SGD's speed while exceeding SAM's performance makes it a highly practical tool for large-scale deep learning.
Summary updated