[论文解读] Towards Understanding Sharpness-Aware Minimization
本文对Sharpness-Aware Minimization(SAM)进行了理论与实证分析,表明SAM的隐式偏差倾向于选择更平坦的极小值,从而实现比标准SGD更好的泛化性能,尤其是在使用m-sharpness时。本文证明了非凸目标下的收敛性,并表明SAM显著提升了泛化性能,尤其在中等宽度模型和标签噪声条件下表现突出。
Sharpness-Aware Minimization (SAM) is a recent training method that relies on worst-case weight perturbations which significantly improves generalization in various settings. We argue that the existing justifications for the success of SAM which are based on a PAC-Bayes generalization bound and the idea of convergence to flat minima are incomplete. Moreover, there are no explanations for the success of using $m$-sharpness in SAM which has been shown as essential for generalization. To better understand this aspect of SAM, we theoretically analyze its implicit bias for diagonal linear networks. We prove that SAM always chooses a solution that enjoys better generalization properties than standard gradient descent for a certain class of problems, and this effect is amplified by using $m$-sharpness. We further study the properties of the implicit bias on non-linear networks empirically, where we show that fine-tuning a standard model with SAM can lead to significant generalization improvements. Finally, we provide convergence results of SAM for non-convex objectives when used with stochastic gradients. We illustrate these results empirically for deep networks and discuss their relation to the generalization behavior of SAM. The code of our experiments is available at https://github.com/tml-epfl/understanding-sam.
研究动机与目标
- 为解决现有对SAM成功原因的解释在PAC-Bayes界和平坦极小值收敛性方面的不完整性。
- 探究为何SAM中的m-sharpness在最坏情况权重扰动背景下对泛化至关重要。
- 在对角线线性网络中对SAM的隐式偏差进行理论分析,并在非线性网络中通过实证方法加以验证。
- 在非凸优化中为SAM在随机梯度下的收敛性提供保证。
- 通过在深度网络上的实证评估,建立SAM收敛行为与其泛化性能之间的关联。
提出的方法
- 使用m-sharpness作为关键组件,对对角线线性网络中SAM的隐式偏差进行理论分析。
- 通过使用SAM微调标准模型,对非线性网络中SAM的隐式偏差进行实证研究。
- 推导并证明SAM在随机非凸优化设置下的收敛性。
- 使用不同m值(最坏情况扰动中使用的样本数)的m-SAM,评估其对泛化的影响。
- 在CIFAR-10和CIFAR-100上使用ResNet-18和ResNet-34进行实证评估,考察不同小批量大小、模型宽度和扰动半径的影响。
- 比较SAM在有无梯度归一化以及随时间减小扰动半径ρ的情况下的表现。
实验结果
研究问题
- RQ1为何m-sharpness对SAM的泛化性能至关重要,它与平均情况鲁棒性有何不同?
- RQ2SAM的隐式偏差是否在所有线性与非线性设置中都一致地倾向于选择更平坦、泛化性能更好的极小值,相较于标准SGD?
- RQ3SAM在非凸深度学习目标下的收敛行为如何与其实证泛化性能相关联?
- RQ4改变m值(最坏情况扰动中使用的样本数)对泛化和训练稳定性有何影响?
- RQ5在标签噪声条件下SAM表现如何,梯度归一化或减小扰动半径ρ是否会影响其性能?
主要发现
- 在对角线线性网络中,SAM始终选择比标准SGD泛化性能更优的解,且使用m-sharpness可进一步增强该效果。
- 实证结果表明,使用SAM微调标准模型可带来显著的泛化性能提升,尤其在中等宽度模型中(例如,宽度因子16的模型表现出最大增益)。
- 当m等于小批量大小时,SAM相较于标准SGD仅带来微小改进,但无法完全弥合大批次与小批次SGD之间的泛化差距。
- 随时间减小扰动半径ρ会损害泛化性能,表明恒定的ρ更有利于收敛与性能表现。
- 在60%标签噪声条件下,SAM在有无梯度归一化下均达到几乎相同的测试误差,表明在噪声环境下其对梯度归一化具有鲁棒性。
- SAM的训练目标呈现出一致的下降趋势,证实训练误差上升并非优化失败所致,而是目标函数景观的固有特性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。