Research indexThesis
Attention=Memory
Alade
Figshare7 Aug 2026Open access
NobleIDark:/48914/w1/20261105/7AB96BAADOI10.6084/m9.figshare.33185001
Attention=Memory
Alade · Figshare · 2026
NobleIDark:/48914/w1/20261105/7AB96BAADOI10.6084/m9.figshare.33185001
Free to read at the publisher
You can read the abstract here, or the full text at the publisher.
Abstract
This paper present the Attention-Memory Unification (AMU) framework, demonstratingthat transformer self-attention and persistent state matrix retrieval are mathematicallyequivalent operations under a change of representation. Standard attention computesA = softmax(QK⊤/√d) °§ V with O(n2) memory complexity scaling quadratically in sequencelength n. We show this can be exactly replaced by a fixed-size memory matrixM ∈ RD°øD that accumulates key-value outer products through sigmoid-gated updates:Mt = g °§λ°§Mt−1+(1−g) °§kt⊗vt, with retrieval via A = M°§q in O(D2) constant memoryregardless of sequence length. We introduce three innovations beyond prior linear attentionwork: (1) Sigmoid-Gated Decay providing selective forgetting of irrelevant memories,(2) Dual-Track Memory maintaining both position-encoded and position-invariant representations,and (3) a Reinforcement Consolidation Gate that uses sieve-filtered selfgenerateddata to adaptively modulate which memories persist. We formalize the Freudiancognitive interpretation (Id = M accumulation, Ego = M°§ q retrieval, Superego = qualitysieve filtering) and prove convergence bounds for the gated accumulation scheme. Empiricalresults demonstrate 99.6% VRAM savings at 1M token context length while maintainingcomparable perplexity to standard attention. We benchmark AMU against softmaxattention, linear attention, Mamba, RetNet, RWKV, and Kimi Delta Attention, showingadvantages in memory efficiency, selective forgetting, and inference-time adaptivity.