Lune

ACL Findings2023

On the Expressivity Role of LayerNorm in Transformers' Attention

Shaked Brody, Uri Alon, Eran Yahav

摘要

Layer Normalization (LayerNorm) is an inherent component in all Transformer-based models. In this paper, we show that LayerNorm is crucial to the expressivity of the multi-head attention layer that follows it. This is in contrast to the common belief that LayerNorm's only role is to normalize the activations during the forward pass, and their gradients during the backward pass.

We consider a geometric interpretation of LayerNorm and show that it consists of two components: (a) projection of the input vectors to a d -1 space that is orthogonal to the [1, 1, ..., 1] vector, and (b) scaling of all vectors to the same norm of √ d. We show that each of these components is important for the attention layer that follows it in Transformers: (a) projection allows the attention mechanism to create an attention query that attends to all keys equally, offloading the need to learn this operation by the attention; and (b) scaling allows each key to potentially receive the highest attention, and prevents keys from being "un-select-able". We show empirically that Transformers do indeed benefit from these properties of LayeNorm in general language modeling and even in computing simple functions such as "majority". Our code is available at https://github.com/tech-srl/ layer_norm_expressivity_role.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Impact of Layer Norm on Memorization and Generalization in Transformers 引用了 On the Role of Attention Masks and LayerNorm in Transformers
  • Impact of Layer Norm on Memorization and Generalization in Transformers 引用了 On Layer Normalization in the Transformer Architecture
  • On the Role of Attention Masks and LayerNorm in Transformers 引用了 On Layer Normalization in the Transformer Architecture
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper10

  1. On the Role of Attention Masks and LayerNorm in TransformersXinyi Wu, Amir Ajorlou, Yifei Wang, Stefanie Jegelka 等NeurIPS 2024 · 54 次引用
  2. Prompting a Pretrained Transformer Can Be a Universal ApproximatorAleksandar Petrov, Philip Torr, Adel BibiICML 2024 · 19 次引用
  3. Rethinking Decoders for Transformer-based Semantic Segmentation: A Compression PerspectiveQishuai Wen, Chun-Guang LiNeurIPS 2024 · 8 次引用
  4. Impact of Layer Norm on Memorization and Generalization in TransformersRishi Singhal, Jung-Eun KimNeurIPS 2025 · 4 次引用
  5. Stealth edits to large language modelsOliver J. Sutton, Qinghua Zhou, Wei Wang, Desmond J. Higham 等NeurIPS 2024 · 4 次引用

它引用的 Paper2

  1. On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng 等ICML 2020 · 1,388 次引用
  2. Low-Rank Softmax Can Have Unargmaxable Classes in Theory but Rarely in PracticeAndreas Grivas, Nikolay Bogoychev, Adam LopezACL 2022

相关 Paper

  1. Incorporating Residual and Normalization Layers into Analysis of Masked Language ModelsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2021 · 28 次引用
  2. XAI for Transformers: Better Explanations through Conservative PropagationAmeen Ali, Thomas Schnake, Oliver Eberle, Grégoire Montavon 等ICML 2022 · 144 次引用
  3. VISIT: Visualizing and Interpreting the Semantic Information Flow of TransformersShahar Katz, Yonatan BelinkovEMNLP Findings 2023 · 12 次引用
  4. Small Transformers Don’t Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and Implications for Mechanistic InterpretabilityLuca Baroni, Galvin Khara, Joachim Schaeffer, Marat Subkhankulov 等ICLR 2026 · 8 次引用
  5. Attention is Not Only a Weight: Analyzing Transformers with Vector NormsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2020 · 138 次引用
黄昏的海面,两侧是细线勾勒的悬崖