提出μP²方法,让大模型训练时各层都能均衡受扰动。
μP$^2$: Effective Sharpness Aware Minimization Requires Layerwise Perturbation Scaling
- 设计分层扰动缩放机制,使所有层在大模型中均被有效扰动
- 实验验证μP²可跨模型规模迁移最优学习率与扰动半径
- 适用于SAM及其变体,提升训练稳定性与泛化性能
尖锐感知最小化(SAM)在多种神经网络架构和数据集上均有性能提升。随着模型规模持续扩大,深入理解SAM的缩放行为至关重要。本文利用张量程序框架研究了无限宽神经网络下使用SAM训练的动态特性。结果表明,在宽网络中,标准SAM的有效动态等价于仅在最后一层应用SAM,即使使用最优超参数也是如此。相比之下,我们提出一种稳定参数化方式——最大更新与扰动参数化(μP²),通过分层扰动缩放,确保所有层在极限情况下同时实现特征学习和有效扰动。在MLP、ResNets和视觉变换器上的实验表明,μP²可在不同模型规模间实现学习率与扰动半径联合最优值的超参数迁移。此外,我们还给出了推导μP²的直观条件,可推广至自适应SAM和SAM-ON等其他扰动规则,确保各层扰动效果均衡。
原文摘要 · Abstract (English)
Sharpness Aware Minimization (SAM) enhances performance across various neural architectures and datasets. As models are continually scaled up to improve performance, a rigorous understanding of SAM's scaling behaviour is paramount. To this end, we study the infinite-width limit of neural networks trained with SAM, using the Tensor Programs framework. Our findings reveal that the dynamics of standard SAM effectively reduce to applying SAM solely in the last layer in wide neural networks, even with optimal hyperparameters. In contrast, we identify a stable parameterization with layerwise perturbation scaling, which we call $\textit{Maximal Update and Perturbation Parameterization}$ ($μ$P$^2$), that ensures all layers are both feature learning and effectively perturbed in the limit. Through experiments with MLPs, ResNets and Vision Transformers, we empirically demonstrate that $μ$P$^2$ achieves hyperparameter transfer of the joint optimum of learning rate and perturbation radius across model scales. Moreover, we provide an intuitive condition to derive $μ$P$^2$ for other perturbation rules like Adaptive SAM and SAM-ON, also ensuring balanced perturbation effects across all layers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。