Transformer architectures and model research

Artificial intelligence · AI models

The frontiers of Transformers: memory, depth and compute in new models

From quadratic attention to editable memory: a mathematical reading of eight publications, including 2026 research, with verifiable examples and limits on what we can expect from upcoming models.

Paper review · Advanced · 9 min read

Published
Updated

Our analysis

The starting point: what attention actually costs

This is a selective reading of literature available on 7 November 2026, not an exhaustive review. We start with the 2017 foundations and 2022 FlashAttention, then examine 2026 proposals. The common thread is how to allocate memory, communication and computation. The outlook is our inference, not an announcement about proprietary model architectures.

For one self-attention head, Q and K are n×dkn \times d_k matrices and V is n×dvn \times d_v: n counts tokens; dkd_k and dvd_v are representation dimensions. The operator is Y=softmax⁡ ⁣(QK⊤dk+M)V.Y = \operatorname{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}} + M\right)V. Softmax acts row by row; in the causal mask M, future positions have value −∞-\infty and allowed positions zero.

At fixed dimensions, query–key products and value aggregation require work quadratic in n. A naive implementation materialises n2n^2 scores per head. FlashAttention instead computes the same dense attention in tiles, reducing memory transfers: it avoids that materialisation without making dense attention arithmetically linear. Mathematical equivalence does not imply bitwise identity in floating-point arithmetic.

An essential distinction follows: reducing intermediate memory, reducing operations and changing the information retained are different goals. Attention cost also differs from total model cost: projections, feed-forward networks, communication and weight accesses remain.

Sources: Vaswani et al. [1]Dao et al. [2]

From the sources

Recurrent states: the delta rule with forgetting

Gated DeltaNet, in its ICLR 2025 camera-ready version, combines adaptive decay with targeted updates to a matrix memory. The authors also study hybrids with other mechanisms, including windowed attention. This does not demonstrate that attention can always be removed.

The rule, rewritten equivalently, is St=αtSt−1+βt(vt−αtSt−1kt)kt⊤.S_t = \alpha_t S_{t-1} + \beta_t\left(v_t - \alpha_t S_{t-1}k_t\right)k_t^\top. Here S has dimension dv×dkd_v \times d_k; k and v are column vectors; α\alpha controls decay and β\beta update strength. A query q is read as yt=Stqty_t = S_t q_t.

The subtraction corrects what the state already predicts for the current key. At fixed dimensions, recurrent state size does not grow with the sequence; however, it compresses associations. In hybrid models, attention components retain their own costs. Compact state does not guarantee exact recall of arbitrarily many facts.

Original teaching example: S0=0S_0 = 0, k1=(1,0)⊤k_1 = (1,0)^\top, v1=(2,3)⊤v_1 = (2,3)^\top and β1=1\beta_1 = 1. After writing, S1S_1 has first column (2,3)⊤(2,3)^\top and a zero second column. In the limiting case α2=β2=1\alpha_2 = \beta_2 = 1, with the same key and v2=(5,7)⊤v_2 = (5,7)^\top, the first column becomes (5,7)⊤(5,7)^\top, not (7,10)⊤(7,10)^\top: the update corrects the association instead of adding indiscriminately.

Sources: Yang, Kautz & Hatamizadeh [3]

From the sources

Engram: separating pattern lookup from computation

Engram proposes conditional memory made of embeddings indexed by n-grams, with hashing and context-dependent integration. We consulted the July 2026 arXiv revision. The module complements the backbone rather than replacing the whole Transformer.

A teaching schematic, not the complete implementation, is et=E ⁣[hash⁡(xt−n+1,…,xt)]e_t = E\!\left[\operatorname{hash}(x_{t-n+1},\ldots,x_t)\right] and ht′=ht+gtWet.h_t^{\prime} = h_t + g_t W e_t. E is a learned table; W projects the memory; g is a context-dependent gate. The paper includes additional components beyond this simplification.

The stated O(1)O(1) lookup concerns indexed access under a fixed configuration: it does not make the whole model or physical memory cost constant. A larger table needs capacity and bandwidth. Collisions and contextual ambiguity still require handling.

The operational distinction is between conversation state, learned memory and documents retrieved from an external system. These are different objects. For a document application, retaining an association does not itself provide a verifiable source, validity date or deletion procedure.

Sources: Cheng et al. [4]

From the sources

EngramEdit: updating knowledge without rewriting everything

The 7 October 2026 EngramEdit preprint studies knowledge updates through conditional memory while keeping the backbone fixed. Different expressions can share embeddings: modifying an entry can affect unrelated facts. This is an experimental proposal, not a general guarantee of safe editing.

For sum aggregation, update allocation is U⋆=argmin⁡U{∥AU−B∥F2+∑jλj∥uj∥22}.U^\star = \underset{U}{\operatorname{argmin}}\left\{\lVert AU-B\rVert_F^2 + \sum_j \lambda_j\lVert u_j\rVert_2^2\right\}. A describes which embeddings participate in the expressions; B the desired shifts; rows uju_j of U are updates. The symbol ∥⋅∥F\lVert\cdot\rVert_F denotes the Frobenius norm, the square root of the sum of squared entries.

With Λ=diag⁡(λj)\Lambda = \operatorname{diag}(\lambda_j), the normal equations are (A⊤A+Λ)U=A⊤B.(A^\top A + \Lambda)U = A^\top B. Positive regularisation makes the system invertible; operationally, solve the system without requiring an explicit inverse. The paper distinguishes sum aggregation from gated aggregation: this formula does not automatically describe every variant.

Dimension check: with p expressions, q embeddings and dimension d, A is p×qp \times q, U is q×dq \times d and B is p×dp \times d. For every nonzero vector z, z⊤(A⊤A+Λ)z=∥Az∥22+∑jλjzj2>0z^\top(A^\top A + \Lambda)z = \lVert Az\rVert_2^2 + \sum_j \lambda_j z_j^2 > 0 when all λj\lambda_j are positive. This establishes uniqueness and invertibility, not the semantic correctness of the targets.

Original algebraic example: with A=[1]A = [1], B=[2]B = [2] and λ=1\lambda = 1, the solution is u⋆=1u^\star = 1 rather than 2. The penalty reduces update magnitude but does not prove that other facts remain correct. Evaluation needs paraphrases, unedited facts and reasoning that uses the revised knowledge.

Sources: Cai et al. [5]

From the sources

Depth is changing: mHC and Attention Residuals

A standard residual connection is xl+1=xl+Fl(xl).x_{l+1} = x_l + F_l(x_l). In its January 2026 revision, mHC expands residual streams and constrains their mixing through doubly stochastic matrices. Attention Residuals, a March 2026 technical report, instead studies attention-based selection among earlier layer contributions. These modify connections in different ways; they are not new names for token attention.

For mHC’s residual matrix P, the ideal constraint is Pij≥0,P1=1,P⊤1=1.P_{ij} \ge 0,\qquad P\mathbf{1} = \mathbf{1},\qquad P^\top\mathbf{1} = \mathbf{1}. The vector 1 has all entries equal to one. The method uses Sinkhorn-Knopp normalisation; finite iterations satisfy the constraint only approximately in numerical computation.

Teaching derivation of the constraint: a doubly stochastic matrix is a convex combination of permutations, P=∑rθrΠr,P = \sum_r \theta_r\Pi_r, with θr≥0\theta_r \ge 0 and ∑rθr=1\sum_r \theta_r = 1. Since ∥Πr∥2=1\lVert\Pi_r\rVert_2 = 1, the triangle inequality gives ∥P∥2≤1\lVert P\rVert_2 \le 1. For fixed P, this limits amplification in linear mixing. If P depends on the input, the total Jacobian also includes that dependence: this calculation does not establish stability of the entire network or its gradients under every condition.

For Full Attention Residuals, a layer input can be written hl=∑i=0l−1ai→lvi,h_l = \sum_{i=0}^{l-1} a_{i\to l}v_i, with ai→l=softmax⁡i ⁣(wl⊤RMSNorm⁡(vi)).a_{i\to l} = \operatorname{softmax}_i\!\left(w_l^\top\operatorname{RMSNorm}(v_i)\right). Here v0v_0 is the embedding and the remaining viv_i are earlier outputs; wlw_l is a learned per-layer query. Softmax acts across depth, separately at each position.

The Block AttnRes variant groups contributions to reduce memory and communication overhead. The interesting direction is selective reuse of representations. This differs from increasing layer count or the context available to the model.

Sources: Xie et al. [6]Kimi Team [7]

Our analysis

More reasoning also means allocating compute better

Snell and coauthors study how to allocate inference-time computation across search, verification and response revision strategies. Effectiveness depends on problem difficulty. This does not imply that generating more tokens always improves an answer, or that spending more inference compute requires an architectural change.

An original probability example separates producing a solution from selecting it. If each attempt has probability p of being correct and attempts are independent, the probability that at least one of m attempts succeeds is 1−(1−p)m.1 - (1-p)^m. With p=0.2p = 0.2 and m=4m = 4, this is 0.5904, or 59.04%.

This is the probability of having a correct solution in the group, not the accuracy of the selected answer. Matching it would require a perfect selector; correlated errors and fallible verifiers change the practical result. Verification costs also belong in the budget.

For a problem with a checkable solution, such as a program assessed by relevant tests, extra computation can have an observable stopping criterion. For an open factual answer, the quality of checking remains part of the problem. This is an operational consequence of the probability model, not a product promise.

Sources: Snell et al. [8]

Our analysis

A concrete calculation: attention, cache and state are different memories

These are independent examples, not measurements of a specific model. Materialising a score matrix for one head with n=32,768n = 32{,}768 tokens and two bytes per entry requires n2×2=2,147,483,648n^2 \times 2 = 2{,}147{,}483{,}648 bytes, or 2 GiB. At 65,536 tokens it reaches 8 GiB. Squaring doubles the factor twice; a tiled algorithm can avoid retaining the full matrix.

The KV cache instead reuses previously computed keys and values during autoregressive generation. For a standard uncompressed cache with equal key and value dimensions, a byte estimate is MKV=2 B L n hKV dh b.M_{\mathrm{KV}} = 2\,B\,L\,n\,h_{\mathrm{KV}}\,d_h\,b. Here B is batch size; L layer count; hKVh_{\mathrm{KV}} key/value heads; dhd_h dimension per head; and b bytes per entry. The first factor 2 counts keys and values.

With B=1B = 1, L=32L = 32, n=32,768n = 32{,}768, hKV=8h_{\mathrm{KV}} = 8, dh=128d_h = 128 and b=2b = 2, this gives 4 GiB for the KV cache alone. Doubling n gives 8 GiB, not 16. Weights, buffers and other states are excluded; compressed, windowed or otherwise different caches require a different calculation.

Timing also needs separation. Prefill processes the prompt; during cached decoding, a new query consults retained keys. For dense attention at fixed dimensions, that single query’s work grows linearly with the current context. Charging every generated token the full quadratic cost of processing the prompt again is incorrect.

Sources: Vaswani et al. [1]Dao et al. [2]Yang, Kautz & Hatamizadeh [3]

Our analysis

What to expect, and what the papers do not establish

Our inference is that models will keep differentiating across several axes: information selection, memory, inter-layer connections and inference budgets. These eight papers do not establish a universally superior Transformer replacement. Hybrid combinations are plausible, not a certain prediction about the next commercial release.

For technical evaluation, I would ask for quality at matched budgets, prefill latency separated from decoding latency, total memory and results on context that is actually useful. Comparisons using different data, hardware and protocols do not support a reliable ranking. Fewer FLOPs alone do not establish lower elapsed time or cost.

For editable memory, examine preservation of unedited facts; for compressed states, information recall; for reasoning, verifier quality and total cost. Longer context does not guarantee correct use of documents. A new residual connection does not guarantee factual correctness.

Evidence status: Gated DeltaNet is labelled ICLR 2025 camera-ready. For Engram, EngramEdit, mHC and Attention Residuals we used the listed manuscript or report versions; we do not assume an unverified peer-review outcome. Conference publication also does not replace independent reproduction or evaluation on a particular use case. Source dates refer to the consulted version, not necessarily the initial proposal.

Sources: Yang, Kautz & Hatamizadeh [3]Cheng et al. [4]Cai et al. [5]Xie et al. [6]Kimi Team [7]Snell et al. [8]

Explore the foundations