cs.LGApr 6, 2026

On the Invariants of Softmax Attention

Authors: Wonsuk Lee

Organizations: Seoul National University & SK Hynix America

Abstract

Softmax attention maps every query--key interaction into a probability distribution, but the underlying structure remains largely unexplored. We define the energy field, the row-centered attention logit, and show that it exhibits invariant properties across models, architectures, and inputs. Two classes of invariants emerge. Mechanism-level invariants follow from the algebraic structure of softmax attention. They include a per-row zero-sum constraint, a rank bound determined by the head dimension, and spectral signatures that follow from them. Model-level regularities are not required by the mechanism, yet hold in every autoregressive language model we test, spanning several architecture families. The energy field distributes its variance over key positions without concentrating at a few. This delocalization traces to a property of the key matrix we call key incoherence. These invariants have practical consequences. The rank bound confines the energy field to a low-dimensional subspace. Key incoherence yields a per-head training monitor. All results are verified at multiple context lengths and input texts.

Figures & tables

Explore similar work

Apr 6, 2026

Compressible Softmax-Attended Language under Incompressible Attention

Softmax attention defines an interaction through dhd_h head dimensions, but not all dimensions carry equal weight once real text passes through. We decompose the attention logit field into a learned component and a generated component and measure their spectra separately. For all 5,888 KV heads in five transformer language models (124M--7B parameters, four architecture families), the logit energy field E~\tilde{E} reaches 90% of its variance in 2--11 singular components. The learned interaction matrix WQTWKW_Q^\mathrm{T} W_K needs 38--75 components for the same threshold out of dh∈64,128d_h \in {64, 128}. The spectral gap is 5--25×\times in effective rank. The compressibility of softmax-attended language is a property of the data, not the frame that analyzes it.
Aug 28, 2026

Intrinsic Interaction Geometry Controls the Low-Rank Complexity of Softmax Attention

How much matrix rank is required to preserve every bounded value output of normalized softmax attention? We study the unrestricted maximum-row-ℓ1\ell_1 approximation rank rε(A)r_\varepsilon(A), exactly the least rank achieving uniform error over all bounded vector-valued values. Row softmax exposes the intrinsic interaction C=Pm(log⁡A)PNC=P_m(\log A)P_N, whereas invertible Q/KQ/K gauges leave AA fixed while changing the Euclidean geometry of a chosen query/key factorization. We replace that coordinate-dependent description by a projective residual q(C−T)q(C-T) and an attained factor-radius size κ(T)κ(T). For every rank-rr retained interaction with τ(T)<ετ(T)<\varepsilon, we prove rε(A)≤min⁡{N,  Cr(1+κ(T)(ε−τ(T))2)r/2},r_\varepsilon(A)\le \min\left\{ N,\; C_r\left( 1+\frac{κ(T)} {(\varepsilon-τ(T))^2} \right)^{r/2} \right\}, with the same unknown dimension constant as the underlying weighted Gibbs-row cover. The profile is gauge invariant, termwise no worse than native retained-subspace bounds at the same declared dimension, and has a worst-case sharp r/2r/2 size exponent at fixed rr and ε\varepsilon. We then measure rε(A)r_\varepsilon(A) directly on learned attention using 9,978 certified brackets across BERT, GPT-2, Qwen2.5, and two ViT checkpoints; where certificates do not close, the optimum remains interval-valued. A pre-specified 2,302-cell held-out study further shows that the historical native-coordinate geometry block contains coarse, mostly head-level information but no detectable incremental information beyond a strong calibrated baseline. The new intrinsic descriptor is not evaluated in that study. Together, the theory and measurements distinguish an operator-intrinsic complexity control from a stronger empirical explanation that the learned-head evidence does not support.
May 12, 2026

A Unified Framework for Critical Scaling of Inverse Temperature in Self-Attention

Length-dependent logit rescaling is widely used to stabilize long-context self-attention, but existing analyses and methods suggest conflicting inverse-temperature laws for the context length nn, ranging from (log⁡n)1/2(\log n)^{1/2} to log⁡n\log n and (log⁡n)2(\log n)^2. We provide a general theory showing that the desirable scale is determined by the gap-counting function NnN_n of each attention row. Counting how many competitors lie within each gap from the maximum, we define an upper-tail accumulation scale and prove that it gives the critical inverse-temperature scale for softmax concentration: below this scale, the top competitors remain unseparated, whereas above it, the attention entropy collapses. This framework unifies prior scaling laws as different NnN_n and yields a direct diagnostic for attention-score families, from idealized theoretical models to more practical transformers.