Lune

ICML2023顶会

Stabilizing Transformer Training by Preventing Attention Entropy Collapse

Shuangfei Zhai, Tatiana Likhomanenko, Etai Littwin, Dan Busbridge, Jason Ramapuram, Yizhe Zhang, Jiatao Gu, Joshua M. Susskind

摘要

Training stability is of great importance to Transformers. In this work, we investigate the training dynamics of Transformers by examining the evolution of the attention layers. In particular, we track the attention entropy for each attention head during the course of training, which is a proxy for model sharpness. We identify a common pattern across different architectures and tasks, where low attention entropy is accompanied by high training instability, which can take the form of oscillating loss or divergence. We denote the pathologically low attention entropy, corresponding to highly concentrated attention scores, as entropy collapse\textit{entropy collapse}. As a remedy, we propose σ\sigmaReparam, a simple and efficient solution where we reparametrize all linear layers with spectral normalization and an additional learned scalar. We demonstrate that σ\sigmaReparam successfully prevents entropy collapse in the attention layers, promoting more stable training. Additionally, we prove a tight lower bound of the attention entropy, which decreases exponentially fast with the spectral norm of the attention logits, providing additional motivation for our approach. We conduct experiments with σ\sigmaReparam on image classification, image self-supervised learning, machine translation, speech recognition, and language modeling tasks. We show that σ\sigmaReparam provides stability and robustness with respect to the choice of hyperparameters, going so far as enabling training (a) a Vision Transformer to competitive performance without warmup, weight decay, layer normalization or adaptive optimizers; (b) deep architectures in machine translation and (c) speech recognition to competitive performance without warmup and adaptive optimizers. Code is available at https://github.com/apple/ml-sigma-reparam.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 78 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Emerging Properties in Self-Supervised Vision Transformers 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • Emerging Properties in Self-Supervised Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Emerging Properties in Self-Supervised Vision Transformers 引用了 Training data-efficient image transformers & distillation through attention
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • Stable and low-precision training for large-scale vision-language models 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Stable and low-precision training for large-scale vision-language models 引用了 An Empirical Study of Training Self-Supervised Vision Transformers
  • An Empirical Study of Training Self-Supervised Vision Transformers 引用了 Emerging Properties in Self-Supervised Vision Transformers
  • An Empirical Study of Training Self-Supervised Vision Transformers 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • An Empirical Study of Training Self-Supervised Vision Transformers 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • An Empirical Study of Training Self-Supervised Vision Transformers 引用了 Training data-efficient image transformers & distillation through attention
  • Training data-efficient image transformers & distillation through attention 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Small-scale proxies for large-scale Transformer training instabilities 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Small-scale proxies for large-scale Transformer training instabilities 引用了 Stable and low-precision training for large-scale vision-language models
  • Small-scale proxies for large-scale Transformer training instabilities 引用了 An Empirical Study of Training Self-Supervised Vision Transformers
  • Why Transformers Need Adam: A Hessian Perspective 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Why Transformers Need Adam: A Hessian Perspective 引用了 Small-scale proxies for large-scale Transformer training instabilities
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper78

  1. The Power of Noise: Redefining Retrieval for RAG SystemsFlorin Cuconasu, Giovanni Trappolini, Federico Siciliano, Simone Filice 等SIGIR 2024 · 212 次引用
  2. Small-scale proxies for large-scale Transformer training instabilitiesMitchell Wortsman, Peter J. Liu, Lechao Xiao, Katie E. Everett 等ICLR 2024 · 162 次引用
  3. Why Transformers Need Adam: A Hessian PerspectiveYushun Zhang, Congliang Chen, Tian Ding, Ziniu Li 等NeurIPS 2024 · 149 次引用
  4. Transformers need glasses! Information over-squashing in language tasksFederico Barbero, Andrea Banino, Steven Kapturowski, Dharshan Kumaran 等NeurIPS 2024 · 105 次引用
  5. Stable and low-precision training for large-scale vision-language modelsMitchell Wortsman, Tim Dettmers, Luke Zettlemoyer, Ari Morcos 等NeurIPS 2023 · 101 次引用

它引用的 Paper18

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
  3. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa 等ICML 2021 · 8,974 次引用
  4. Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou 等ICCV 2021 · 8,921 次引用
  5. An Empirical Study of Training Self-Supervised Vision TransformersXinlei Chen, Saining Xie, Kaiming HeICCV 2021 · 2,340 次引用

相关 Paper

  1. Variance Sensitivity Induces Attention Entropy Collapse and Instability in TransformersJonghyun Hong, Sungyoon LeeEMNLP 2025
  2. Taming Transformer Without Using Learning Rate WarmupXianbiao Qi, Yelin He, Jiaquan Ye, Chun-Guang Li 等ICLR 2025
  3. Initialization of Large Language Models via Reparameterization to Mitigate Loss SpikesKosuke Nishida, Kyosuke Nishida, Kuniko SaitoEMNLP 2024 · 2 次引用
  4. Self-attention Networks Localize When QK-eigenspectrum ConcentratesHan Bao, Ryuichiro Hataya, Ryo KarakidaICML 2024 · 16 次引用
  5. LipsFormer: Introducing Lipschitz Continuity to Vision TransformersXianbiao Qi, Jianan Wang, Yihao Chen, Yukai Shi 等ICLR 2023 · 4 次引用
黄昏的海面,两侧是细线勾勒的悬崖