Two Layers of Attention Stability: A Koopman-Operator Analysis of Linear and Softmax Attention
Abstract
We develop a Koopman-operator analysis of self-attention that resolves a long-standing puzzle: why does linear attention diverge on long sequences while softmax attention remains stable, even though both share the same next-step prediction objective? We show that attention stability is intrinsically a *two-layer* problem. The *architectural layer* concerns the spectrum of the token-mixing matrix and is data-independent; the *dynamical layer* concerns the spectrum of the dual operator induced by training and should be data-determined. We prove three concrete results within this framework: (i) under a shared encoder, the dual operator of linear attention coincides with the EDMD Koopman estimator at the global optimum, and its spectral radius is unconstrained; (ii) causal softmax attention enjoys an architectural guarantee via row-stochasticity, while its value projection leaves the dynamical layer entirely unconstrained; (iii) LayerNorm makes the empirical Gram matrix rank-deficient with kernel , producing a -parameter family of loss-equivalent but spectrally distinct EDMD solutions, while RMSNorm preserves invertibility. The framework yields an immediate design principle—constrain the architectural layer, free the dynamical layer—which we instantiate as two stabilized linear-attention variants (SN-LA, RN-LA). Numerical experiments reveal a *hierarchy* of architectural stability: vanilla linear attention has neither bound and diverges immediately under autoregressive rollout; our stabilized variants enforce only the single-pass spectral bound and delay divergence; softmax attains the strictly stronger pointwise contraction via row-stochasticity and remains bounded. On real time-series benchmarks (ETT, Weather), our methods close of the vanilla-to-softmax gap and surpass softmax on datasets at long horizons, while preserving the dynamical-layer freedom that constraints on the dual operator forfeit.
Related papers
See more related submissions when the market opens.