Small Transformers Don’t Need LayerNorm at Inference Time: Scaling LayerNorm Removal to GPT-2 XL and Implications for Mechanistic Interpretability
Luca Baroni, Galvin Khara, Joachim Schaeffer, Marat Subkhankulov, Stefan Heimersheim
摘要
Layer-wise normalization (LN) is an essential component of virtually all transformer-based large language models. While its effects on training stability are well documented, its role at inference time is poorly understood. Additionally, LN layers hinder mechanistic interpretability by introducing additional nonlinearities and increasing the interconnectedness of individual model components. Here, we show that all LN layers can be removed via fine-tuning from every GPT-2 model with only a small increase in validation loss (e.g. +0.03 cross-entropy loss for GPT-2 XL). Thus, LN is not essential at inference to maintain comparable performance in these models. We find that the amount of fine-tuning data needed for LN removal grows sublinearly with model parameters, suggesting scaling to larger models is feasible. We release a suite of LN-free GPT-2 models on Hugging Face. Furthermore, we test interpretability techniques on LN-free models. Direct logit attribution now gives the exact direct effect of individual components, while the accuracy of attribution patching does not significantly improve. We also confirm that GPT-2's "confidence neurons" are inactive in the LN-free models. Our work clarifies the role of LN layers in language modeling, showing that GPT-2-class models can function without LN layers. We hope that our LN-free analogs of the GPT-2 family of models will enable more precise interpretability research and improve our understanding of language models.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- Towards Best Practices of Activation Patching in Language Models: Metrics and Methods 引用了 Locating and Editing Factual Associations in GPT
- Towards Best Practices of Activation Patching in Language Models: Metrics and Methods 引用了 Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small
- Confidence Regulation Neurons in Language Models 引用了 Efficient Streaming Language Models with Attention Sinks
- Confidence Regulation Neurons in Language Models 引用了 Locating and Editing Factual Associations in GPT
- Confidence Regulation Neurons in Language Models 引用了 Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small
- Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small 引用了 Locating and Editing Factual Associations in GPT
它引用的 Paper10
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 次引用
- Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
- Towards Best Practices of Activation Patching in Language Models: Metrics and MethodsFred Zhang, Neel NandaICLR 2024 · 233 次引用
- Confidence Regulation Neurons in Language ModelsAlessandro Stolfo, Ben Wu, Wes Gurnee, Yonatan Belinkov 等NeurIPS 2024 · 68 次引用
- Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 SmallKevin Ro Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris 等ICLR 2023 · 50 次引用
相关 Paper
- Explorations of Self-Repair in Language ModelsCody Rushing, Neel NandaICML 2024 · 22 次引用
- XAI for Transformers: Better Explanations through Conservative PropagationAmeen Ali, Thomas Schnake, Oliver Eberle, Grégoire Montavon 等ICML 2022 · 144 次引用
- Remarkable Robustness of LLMs: Stages of Inference?Vedang Lad, Jin Hwa Lee, Wes Gurnee, Max TegmarkNeurIPS 2025 · 5 次引用
- Anchored Answers: Unravelling Positional Bias in GPT-2's Multiple-Choice QuestionsRuizhe Li, Yanjun GaoACL Findings 2025 · 4 次引用
- AttriBoT: A Bag of Tricks for Efficiently Approximating Leave-One-Out Context AttributionFengyuan Liu, Nikhil Kandpal, Colin RaffelICLR 2025
