Limitations of Normalization in Attention Mechanism
Timur Mudarisov, Mikhail Burtsev, Tatiana Petrova, Radu State
TL;DR
This work analyzes limitations of normalization in attention mechanisms, with a focus on softmax. It introduces a general normalization framework and proves a distance bound (Theorem 1), a geometric separability bound under uniform spherical embeddings (Theorem 2), and a gradient bound (Lemma) that yields a $\| abla_l \boldsymbol{\alpha}\|_2 \le \min\{\tfrac{1}{4T}, \sqrt{2}\}$ for softmax, clarifying the trade-off between sharpness and gradient stability. Empirical validation on GPT-2 demonstrates distance collapse as the top-$N$ grows with sequence length, saturation of geometric separability around 70–85%, and $1/T$-scaled gradient sensitivity at low temperatures. The results motivate robust normalization or sparsity-guided alternatives (e.g., Sparsemax, Scalable-Softmax, Self-Adjusted Softmax) and provide practical guidelines for designing long-context Transformers with reliable selective capabilities.
Abstract
This paper investigates the limitations of the normalization in attention mechanisms. We begin with a theoretical framework that enables the identification of the model's selective ability and the geometric separation involved in token selection. Our analysis includes explicit bounds on distances and separation criteria for token vectors under softmax scaling. Through experiments with pre-trained GPT-2 model, we empirically validate our theoretical results and analyze key behaviors of the attention mechanism. Notably, we demonstrate that as the number of selected tokens increases, the model's ability to distinguish informative tokens declines, often converging toward a uniform selection pattern. We also show that gradient sensitivity under softmax normalization presents challenges during training, especially at low temperature settings. These findings advance current understanding of softmax-based attention mechanism and motivate the need for more robust normalization and selection strategies in future attention architectures.
