TL;DR
This paper reframes Sharpness-Aware Minimization (SAM) as a form of Mean-Field Variational Inference (MFVI). By establishing this connection, the authors propose new algorithms that blend SAM and MFVI, showing that SAM's core mechanism can be viewed as a deterministic worst-case perturbation, analogous to MFVI's random perturbations. Their experiments suggest that while SAM remains a strong performer, simpler randomized approaches can offer competitive generalization.
What Problem Does This Paper Address?
Deep neural networks often suffer from poor generalization, meaning they perform well on training data but poorly on unseen data. A prominent theory suggests that models trained to find "flat" minima in the loss landscape tend to generalize better. Sharpness-Aware Minimization (SAM) is a popular technique designed to explicitly encourage finding these flat minima by penalizing sharp regions. However, the theoretical underpinnings of SAM and its relationship to other optimization and inference methods, particularly Bayesian approaches, have not been fully explored. This paper aims to bridge this gap by connecting SAM to Mean-Field Variational Inference (MFVI) and exploring the implications of this connection for new algorithms and understanding generalization.
Methods
The core contribution is establishing a theoretical link between SAM and MFVI. The authors show that both methods, when using the reparameterization trick, involve computing gradients at a perturbed version of the current parameter. SAM deterministically chooses the worst-case perturbation within a defined region, while MFVI uses a random Gaussian perturbation. This perspective leads to the proposal of:
- VariationalSAM (VSAM): An algorithm that combines aspects of SAM and MFVI by learning both the mean parameter and the covariance matrix of the perturbation distribution through gradient descent.
- RandomSAM (RSAM): A simplified version of MFVI where the covariance matrix is fixed, effectively acting as a randomized counterpart to SAM.
The paper also analyzes the implicit regularization properties of these methods, characterizing them in terms of higher-order derivatives of the loss function.
Datasets
The paper evaluates the proposed algorithms on the following standard image classification datasets:
- CIFAR-10
- CIFAR-100
They use WideResNet architectures for these experiments.
Key Insights and Ideas
- SAM as a Deterministic MFVI: The most significant insight is reframing SAM's worst-case perturbation as a deterministic analog to MFVI's random perturbations. This provides a unified view of methods seeking flat minima.
- Flatness as a Shared Goal: Both SAM and MFVI are shown to optimize for notions of flatness, albeit through different mechanisms (worst-case vs. average over a distribution).
- SAM's Update as a Drop-in Replacement: The paper suggests that SAM-like updates could potentially replace the reparameterization trick in variational methods, offering a new avenue for optimization.
- VSAM's Potential: While not outperforming SAM in their experiments, VSAM's ability to learn the perturbation covariance offers a more flexible approach to flatness seeking.
- Randomization's Effectiveness: The competitive performance of RandomSAM on CIFAR-10 raises questions about whether the specific worst-case perturbation of SAM is always necessary for achieving good generalization, or if simpler randomized approaches can be sufficient.
Key Results
- SAM's Strong Performance: SAM consistently outperforms other methods, including SGD, RandomSAM, and VariationalSAM, on both CIFAR-10 and CIFAR-100 across different WideResNet architectures.
- RandomSAM's Competitiveness: On CIFAR-10, RandomSAM achieves performance very close to SAM, despite being a simpler method with only one backpropagation step per iteration.
- VariationalSAM's Performance: VSAM did not show superior performance compared to SAM in the conducted experiments. The authors speculate this might be due to the covariance matrix growing too large during training.
- Theoretical Connections: The paper provides theoretical justifications for SAM and MFVI, showing how they implicitly regularize for flatter minima and relating their objectives to concepts like minimum description length.
Limitations and Future Work
- Computational Constraints: The authors acknowledge that limited computational power prevented extensive grid searches for hyperparameters, suggesting that further calibration could improve reported test accuracies.
- VSAM Performance: The underperformance of VariationalSAM warrants further investigation. The authors suggest exploring different ways to constrain or regularize the covariance matrix.
- Randomness vs. Determinism: The competitive results of RandomSAM raise an open question: could randomness improve SAM-like algorithms, or could SAM's deterministic approach be adapted to other variational methods?
- Exploring Other Variational Methods: The paper suggests applying SAM-like updates to other variational methods, such as Variational Autoencoders, as a future direction.
- Interpolating Algorithms: The authors propose investigating algorithms that interpolate between RandomSAM and SAM, using the amount of each as a hyperparameter.
Summary updated