μP$^2$: Effective Sharpness Aware Minimization Requires Layerwise Perturbation Scaling

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Haas, Moritz, Xu, Jin, Cevher, Volkan, Vankadara, Leena Chennuru
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913685753036800
author Haas, Moritz
Xu, Jin
Cevher, Volkan
Vankadara, Leena Chennuru
author_facet Haas, Moritz
Xu, Jin
Cevher, Volkan
Vankadara, Leena Chennuru
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2411_00075
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle μP$^2$: Effective Sharpness Aware Minimization Requires Layerwise Perturbation Scaling
Haas, Moritz
Xu, Jin
Cevher, Volkan
Vankadara, Leena Chennuru
Machine Learning
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.
title μP$^2$: Effective Sharpness Aware Minimization Requires Layerwise Perturbation Scaling
topic Machine Learning
url https://arxiv.org/abs/2411.00075