cs.LGFeb 21, 2026

Rank-Aware Spectral Bounds on Attention Logits for Stable Low-Precision Training

Authors: Seyed Morteza Emadi

Organizations: UNC-Chapel Hill, Kenan-Flagler Business School, Chapel Hill, NC, USA

Abstract

Attention scores in transformers are bilinear forms Sij=xi⊤Mxj/dhS_{ij} = x_i^\top M x_j / \sqrt{d_h} whose maximum magnitude governs overflow risk in low-precision training. We derive a rank-aware concentration inequality: when the interaction matrix M=WQWK⊤M = W^Q W^{K\top} has rank r≪dr \ll d, tail probabilities for max⁡i,j∣Sij∣\max_{i,j}|S_{ij}| decay as exp⁡(−d2α2/(γr))\exp(-d^{2}α^{2}/(γr)) rather than exp⁡(−dα2)\exp(-dα^{2}), where γ>1γ> 1 is a typicality parameter. For transformer attention where r=dhr = d_h, this yields 88--28×28\times tighter concentration than rank-agnostic bounds in modern architectures. We apply this result to FP8 training, deriving geometry-aware scale factors that provide principled overflow guarantees without observing activations. The method computes per-layer scales from the spectral norm ∥WQWK⊤∥2\|W^Q W^{K\top}\|_2 via implicit power iteration, includes a grouped query attention formulation that avoids key expansion, and remains compatible with fused attention kernels. Across GPT-2 XL to Llama-2-70B, geometry-aware scaling eliminates overflows in transient scenarios where delayed scaling fails, while achieving comparable downstream MMLU accuracy.

Figures & tables

Appendix figures & tables9 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Jul 25, 2026

The Entropic Bound for Transformers: Why Static Rank Fails and Attention-Native Rank Recovers

Neural scaling laws describe how loss decreases as models, data, and compute grow, but they do not answer a prior question: for a fixed task, what is the minimum model capacity required to solve it? We study this through the Entropic Bound, a spectral notion of task-intrinsic capacity for Transformers. We first prove that, in a linear attention surrogate, the intrinsic rank r∗r^* of the token-mixing operator is a tight lower bound: any rank-deficient model incurs unavoidable excess risk, and the bound is achievable at r∗r^*. We further show that gradient descent recovers this rank under standard low-rank implicit-bias assumptions, confirm all three properties empirically, and show r∗r^* is recoverable from data before training. We then ask whether this transfers to real attention. A naive transfer fails, and a controlled interpolation ladder localizes the cause precisely: it is not softmax and not a rank constraint, but the input-conditioned nature of attention's mixing operator, which a static weight kernel cannot summarize. Motivated by this, we introduce an attention-native intrinsic rank -- the minimum query-key kernel rank realizing the task within the attention class -- and show that under this definition the full Entropic Bound structure (deficiency, achievability, recovery) is restored for both linear and softmax attention, with the energy effective rank as the estimator robust to softmax distortion. Finally, we map the boundary of data-only predictability: r∗r^* is exactly recoverable for linear QK attention, even without the value map at scale, while softmax attention admits only partial pre-training recovery due to nonlinear inversion and kernel-value identifiability effects. Our results reframe the Entropic Bound from a post-hoc descriptor into an attention-native capacity measure with a precisely characterized predictability frontier.
Aug 26, 2026

How Much Rank Does LoRA Need? Rank-Error Bounds for Transformer Attention

Choosing the rank of a low-rank adaptation (LoRA) update is usually an empirical task. In this paper, we provide a task-dependent theory of the approximation error achievable at each LoRA rank for Transformer attention. We fix a pretrained attention head, a target attention function, and a distribution over inputs from the downstream task, and bound the smallest expected Kullback--Leibler (KL) error achievable by a rank-rr query LoRA update. When target attention probabilities are bounded away from zero, we prove a lower bound of the error proportional to ψ(∥d∥2)ψ(\|d\|_2), where dd is the difference between candidate and target attention scores and ψ(t)=min⁡{t2,t}ψ(t)=\min\{t^2,t\}. We also prove an unconditional upper bound min⁡{∥d∥22/4,2∥d∥2}\min\{\|d\|_2^2/4,\sqrt2\|d\|_2\}. Under explicit realizability, geometry, and moment conditions, we then bound the best rank-rr error between an explicit multiple of ψ(Tr)ψ(\sqrt{T_r}) and min⁡{Tr/4,2Tr}\min\{T_r/4,\sqrt{2T_r}\}, where TrT_r is the downstream-weighted tail energy of the target update. We also provide target-Fisher bounds when candidate scores remain within a fixed range of the target scores, and an unrestricted lower bound when a subset of tokens carries most of the probability mass. These spectral bounds describe finite-score approximation. We then construct explicit families in which softmax saturation makes the rank required to match the attention function strictly smaller than the rank required to match the finite logits. Finally, we extend the analysis to fused multi-head LoRA and joint query/key updates, exposing the effects of rank sharing and query/key factorization constraints.
Mar 13, 2025

Numerical stability analysis of large language models

Transformers are the state-of-the-art architecture for large language models, and a key to their scalability is the strategic usage of low-precision arithmetic. We develop a mixed-precision analysis of transformer inference, deriving bounds for the condition numbers and forward error of the architecture's constituent parts. Notably, we compare the numerical stability of LayerNorm and RMSNorm in the massive-outlier regime, tighten the error bound of softmax in the presence of attention sinks, and quantify the impact of its shifted evaluation on the sensitivity to perturbations. Furthermore, we derive novel sequence-length-independent bounds on the local Lipschitz constant of self-attention. Our worst-case error bound for transformer inference suggests that its numerical stability is determined by the interplay between weight magnitude and the growth of the residual stream. Crucially, and as validated by experiments with GPT-2, our analysis establishes that the scaling of residual-projection weights preserves the propagation of the relative rounding error unless it forces a qualitative transition in the dynamics of the residual stream.