Table of Contents
Fetching ...

Gaussian Equivalence for Self-Attention: Asymptotic Spectral Analysis of Attention Matrix

Tomohiro Hayase, Benoît Collins, Ryo Karakida

TL;DR

This work provides a rigorous analysis of the singular value spectrum of the attention matrix and establishes the first Gaussian equivalence result for attention, showing that the singular value distribution of the attention matrix is asymptotically characterized by a tractable linear model.

Abstract

Self-attention layers have become fundamental building blocks of modern deep neural networks, yet their theoretical understanding remains limited, particularly from the perspective of random matrix theory. In this work, we provide a rigorous analysis of the singular value spectrum of the attention matrix and establish the first Gaussian equivalence result for attention. In a natural regime where the inverse temperature remains of constant order, we show that the singular value distribution of the attention matrix is asymptotically characterized by a tractable linear model. We further demonstrate that the distribution of squared singular values deviates from the Marchenko-Pastur law, which has been believed in previous work. Our proof relies on two key ingredients: precise control of fluctuations in the normalization term and a refined linearization that leverages favorable Taylor expansions of the exponential. This analysis also identifies a threshold for linearization and elucidates why attention, despite not being an entrywise operation, admits a rigorous Gaussian equivalence in this regime.

Gaussian Equivalence for Self-Attention: Asymptotic Spectral Analysis of Attention Matrix

TL;DR

This work provides a rigorous analysis of the singular value spectrum of the attention matrix and establishes the first Gaussian equivalence result for attention, showing that the singular value distribution of the attention matrix is asymptotically characterized by a tractable linear model.

Abstract

Self-attention layers have become fundamental building blocks of modern deep neural networks, yet their theoretical understanding remains limited, particularly from the perspective of random matrix theory. In this work, we provide a rigorous analysis of the singular value spectrum of the attention matrix and establish the first Gaussian equivalence result for attention. In a natural regime where the inverse temperature remains of constant order, we show that the singular value distribution of the attention matrix is asymptotically characterized by a tractable linear model. We further demonstrate that the distribution of squared singular values deviates from the Marchenko-Pastur law, which has been believed in previous work. Our proof relies on two key ingredients: precise control of fluctuations in the normalization term and a refined linearization that leverages favorable Taylor expansions of the exponential. This analysis also identifies a threshold for linearization and elucidates why attention, despite not being an entrywise operation, admits a rigorous Gaussian equivalence in this regime.

Paper Structure

This paper contains 36 sections, 23 theorems, 110 equations, 4 figures, 1 table.

Key Result

Theorem 3.2

Let $A\in\mathbb{R}^{\ell\times \ell}$ be the attention matrix from align:def-A. Then almost surely it holds that where with $u_{\ell}=(1,\dots, 1)^\top/\sqrt{\ell}$, and, as $d, \ell, d_\mathrm{qk} \to \infty$ with align:limit-ratio.

Figures (4)

  • Figure 1: Stepwise approximation of attention leading to the Gaussian Equivalence $Y^f_{\mathrm{lin}}$. Top: histograms of empirical squared singular values; bottom: sorted $s_k^2$. Each panel compares the scaled attention matrix $\sqrt{d}A$ with a model introduced in the proof, shown left to right in the order $\sqrt{d}A^\perp, Y , Y^{f}, Y^Q, Y_\mathrm{lin}^Q,Y^f_\mathrm{lin}$. The bulk spectra (top three singular values removed; see fig:topk) are nearly indistinguishable, showing that the $\sqrt{d}A$ is accurately approximated throughout and culminates in $Y^{f}_{\mathrm{lin}}$. Settings: $d=d_{qk}=1000$, $\beta=1$, 10 draws.
  • Figure 2: Plots of $s_1^2, s_2^2, s_3^2$.
  • Figure 3: (Left): Growth of coefficients around $\beta=1$. (Right): Growth of $s_1(A)^2$ and $s_2(A)^2$ with $d=1000$ including $\beta \gg 1$.
  • Figure 4: $\nu_A$ vs. Poisson$(1)$. Left: histogram ($d=1000$, $\beta=50$, $n_s=10$, bin width $0.1$); right: sorted value and quantile plot using $F^{-1}(1-k/d)$ for Poisson$(1)$. Histogram heights differ because Poisson is discrete, but the quantiles match well.

Theorems & Definitions (55)

  • Remark 2.1
  • Remark 2.2
  • Definition 2.3
  • Remark 2.4
  • Remark 3.1
  • Theorem 3.2
  • Remark 3.3: Reductions
  • Lemma 4.1: Concentration
  • proof
  • Proposition 4.2
  • ...and 45 more