Geometric Interpretation of Layer Normalization and a Comparative Analysis with RMSNorm
Akshat Gupta, Atahan Ozdemir, Gopala Anumanchipalli
TL;DR
This work introduces a geometric interpretation of LayerNorm by showing standardization removes the projection along the uniform vector and then scales the orthogonal component to a fixed norm, revealing the process’ irreversibility. It provides empirical evidence from decoder‑only LLMs that hidden representations are already orthogonal to the uniform vector at inference, making the mean subtraction in LayerNorm redundant and suggesting RMSNorm as a more efficient alternative. Across models, norm stabilization and rotation effects are quantified, demonstrating that RMSNorm can achieve similar orientation and stability without the extra mean subtraction. The findings advocate adopting RMSNorm for efficiency in large language models while preserving performance, and they offer a principled basis for rethinking normalization in Transformers.
Abstract
This paper presents a novel geometric interpretation of LayerNorm and explores how LayerNorm influences the norm and orientation of hidden vectors in the representation space. With these geometric insights, we prepare the foundation for comparing LayerNorm with RMSNorm. We show that the definition of LayerNorm is innately linked to the uniform vector, defined as $\boldsymbol{1} = [1, 1, 1, 1, \cdots, 1]^T \in \mathbb{R}^d$. We then show that the standardization step in LayerNorm can be understood in three simple steps: (i) remove the component of a vector along the uniform vector, (ii) normalize the remaining vector, and (iii) scale the resultant vector by $\sqrt{d}$, where $d$ is the dimensionality of the representation space. We also provide additional insights into how LayerNorm operates at inference time. Finally, we compare the hidden representations of LayerNorm-based LLMs with models trained using RMSNorm and show that all LLMs naturally operate orthogonal to the uniform vector at inference time, that is, on average they do not have a component along the uniform vector during inference. This presents the first mechanistic evidence that removing the component along the uniform vector in LayerNorm is a redundant step. These results advocate for using RMSNorm over LayerNorm which is also more computationally efficient.
