Incorporating Residual and Normalization Layers into Analysis of Masked Language Models
Goro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro Inui
Abstract
Transformer architecture has become ubiquitous in the natural language processing field. To interpret the Transformer-based models, their attention patterns have been extensively analyzed. However, the Transformer architecture is not only composed of the multihead attention; other components can also contribute to Transformers' progressive performance. In this study, we extended the scope of the analysis of Transformers from solely the attention patterns to the whole attention block, i.e., multi-head attention, residual connection, and layer normalization. Our analysis of Transformer-based masked language models shows that the token-to-token interaction performed via attention has less impact on the intermediate representations than previously assumed. These results provide new intuitive explanations of existing reports; for example, discarding the learned attention patterns tends not to adversely affect the performance. The codes of our experiments are publicly available. 1
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
21 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Attention is not all you need: pure attention loses rank doubly exponentially with depth cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- ByGPT5: End-to-End Style-conditioned Poetry Generation with Token-free Language Models cites Measuring the Mixing of Contextual Information in the Transformer
- Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the Transformer cites On Identifiability in Transformers
- Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the Transformer cites Measuring the Mixing of Contextual Information in the Transformer
- Analyzing Feed-Forward Blocks in Transformers through the Lens of Attention Maps cites On Identifiability in Transformers
- Analyzing Feed-Forward Blocks in Transformers through the Lens of Attention Maps cites Entropy- and Distance-Based Predictors From GPT-2 Attention Patterns Predict Reading Times Over and Above GPT-2 Surprisal
- Analyzing Feed-Forward Blocks in Transformers through the Lens of Attention Maps cites Measuring the Mixing of Contextual Information in the Transformer
- Measuring the Mixing of Contextual Information in the Transformer cites On Identifiability in Transformers
Cited by top-tier papers21
- Analyzing Feed-Forward Blocks in Transformers through the Lens of Attention MapsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiICLR 2024 · 35 citations
- Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the TransformerJavier Ferrando, Gerard I. Gállego, Belen Alastruey, Carlos Escolano et al.EMNLP 2022 · 18 citations
- Measuring the Mixing of Contextual Information in the TransformerJavier Ferrando, Gerard I. Gállego, Marta R. Costa-jussàEMNLP 2022 · 18 citations
- Entropy- and Distance-Based Predictors From GPT-2 Attention Patterns Predict Reading Times Over and Above GPT-2 SurprisalByung-Doh Oh, William SchulerEMNLP 2022 · 13 citations
- ByGPT5: End-to-End Style-conditioned Poetry Generation with Token-free Language ModelsJonas Belouadi, Steffen EgerACL 2023 · 12 citations
Builds on8
- ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
- On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng et al.ICML 2020 · 1,388 citations
- Attention is not all you need: pure attention loses rank doubly exponentially with depthYihe Dong, Jean-Baptiste Cordonnier, Andreas LoukasICML 2021 · 522 citations
- Stabilizing Transformers for Reinforcement LearningEmilio Parisotto, H. Francis Song, Jack W. Rae, Razvan Pascanu et al.ICML 2020 · 464 citations
- On Identifiability in TransformersGino Brunner, Yang Liu, Damian Pascual, Oliver Richter et al.ICLR 2020 · 210 citations
Related papers
- On the Expressivity Role of LayerNorm in Transformers' AttentionShaked Brody, Uri Alon, Eran YahavACL Findings 2023 · 18 citations
- Attention is Not Only a Weight: Analyzing Transformers with Vector NormsGoro Kobayashi, Tatsuki Kuribayashi, Sho Yokoi, Kentaro InuiEMNLP 2020 · 138 citations
- Influence Patterns for Explaining Information Flow in BERTKaiji Lu, Zifan Wang, Piotr Mardziel, Anupam DattaNeurIPS 2021 · 22 citations
- Context Analysis for Pre-trained Masked Language ModelsYi-An Lai, Garima Lalwani, Yi ZhangEMNLP Findings 2020 · 11 citations
- Attention-Only Transformers via Unrolled Subspace DenoisingPeng Wang, Yifu Lu, Yaodong Yu, Druv Pai et al.ICML 2025
