Attention Is Memory: O(1) Persistent State Matrices
Year: 2026
Type: dissertation
Abstract: This paper presents the Attention-Memory Unification (AMU) framework, demon-strating that transformer self-attention and persistent state matrix retrieval are mathemat-ically equivalent operations under a change of representation. Standard attention computesA = softmax(QK⊤/√d) · V with O(n2) memory complexity. We show this can be ex-actly replaced by a fixed-size memory matrix M ∈ RD×D that accumulates key-value outerproducts through sigmoid-gated updates: Mt = g · λ · Mt−1 + (1 − g) · kt ⊗ vt, withretrieval via A = M · q in O(D2) constant memory regardless of sequence length. We in-troduce five innovations beyond prior linear attention work: (1) Sigmoid-Gated Decayproviding selective forgetting, (2) Dual-Track Memory maintaining position-encoded andposition-invariant representations, (3) a Reinforcement Consolidation Gate using sieve-filtered self-generated data for adaptive memory persistence, (4) Low-Rank FactorizationM = UV⊤ where U, V ∈ RD×r, reducing per-token compute from O(D2) to O(Dr) — a214× reduction for D=4096, r=256, and (5) a Symbiotic Compartment Gate that load-balances across attention heads with dynamic blend ratio α and step size ∆t. We formalizethe Freudian cognitive interpretation (Id = M accumulation, Ego = M · q retrieval, Su-perego = quality sieve filtering) and prove convergence bounds for the gated accumulationscheme. Verified benchmarks show 103.12 tok/s on NVIDIA CUDA and 99.6% VRAMsavings at 1M token context length.
Source: Figshare
Author: Goke Alade
Language: English
Topic: Topic Modeling
Subfield: Artificial Intelligence
Field: Computer Science
Domain: Physical Sciences
Keywords: linear attention, low-rank factorization
Open Access status: green
OpenAlex ID: W7201835794
