Linear Log-Normal Attention with Unbiased Concentration
Yury Nahshan, Joseph Kampeas, Emir Haleva
TL;DR
Addressing the quadratic $O(N^2)$ cost of self-attention, the paper analyzes the distribution and concentration of the SA matrix and introduces Linear Log-Normal Attention (LLN), a linear-time mechanism built from exponential feature maps to mimic SA's log-normal distribution. LLN employs moment matching to align its variance with SA and uses a temperature parameter to control concentration, supported by entropy and spectral-gap analyses that distinguish unbiased from biased concentration. Empirically, LLN matches SA performance on NLP benchmarks while offering substantial scalability, and a block-diagonal augmentation further strengthens short-range interactions. Overall, the work provides a rigorous framework for scalable attention by coupling distributional mimicry with concentration metrics, and it releases code to enable broader use.
Abstract
Transformer models have achieved remarkable results in a wide range of applications. However, their scalability is hampered by the quadratic time and memory complexity of the self-attention mechanism concerning the sequence length. This limitation poses a substantial obstacle when dealing with long documents or high-resolution images. In this work, we study the self-attention mechanism by analyzing the distribution of the attention matrix and its concentration ability. Furthermore, we propose instruments to measure these quantities and introduce a novel self-attention mechanism, Linear Log-Normal Attention, designed to emulate the distribution and concentration behavior of the original self-attention. Our experimental results on popular natural language benchmarks reveal that our proposed Linear Log-Normal Attention outperforms other linearized attention alternatives, offering a promising avenue for enhancing the scalability of transformer models.
