← All writing

technical

Notes on Linear Attention: From Linear Attention to KDA

A derivation-first path from softmax attention to fixed-size associative memory, DeltaNet, Gated DeltaNet, and Kimi Delta Attention.

This note follows one central question:

Can we reformulate attention so that, instead of looking back at every previous token for each query, past tokens continually update a fixed-size associative memory that the current query simply reads from?

Linear Attention provides the most basic version of this fixed-size memory. DeltaNet allows the memory to correct and overwrite old associations. Gated DeltaNet adds global forgetting, and Kimi Delta Attention (KDA) refines that mechanism further by controlling retention independently along each key-feature dimension.

Throughout the note, I consider a single causal attention head and treat every vector as a column vector:

  • qt,ktRdkq_t,k_t\in\mathbb R^{d_k} and vt,ytRdvv_t,y_t\in\mathbb R^{d_v};
  • the memory matrix is StRdv×dkS_t\in\mathbb R^{d_v\times d_k}, with readout StqtS_tq_t;
  • the multi-head case applies the same derivation independently to each head;
  • output projection, RMSNorm, short convolution, and the output gate are omitted so that we can focus on the core structure.

Some papers represent tokens as row vectors and therefore transpose every equation below. The two conventions are equivalent as long as the state orientation and multiplication order remain consistent.


1. Starting from softmax attention

For the tt-th token, causal softmax attention is

yt=i=1texp(qtki/dk)j=1texp(qtkj/dk)vi.y_t = \sum_{i=1}^{t} \frac{\exp(q_t^\top k_i/\sqrt{d_k})} {\sum_{j=1}^{t}\exp(q_t^\top k_j/\sqrt{d_k})} v_i.

It performs two operations:

  1. compare qtq_t with every previous kik_i to decide where to attend;
  2. use those scores to compute a weighted sum of the corresponding viv_i.

Its main advantage is that every query can directly access every historical key–value pair. The cost is that

  • a naively materialized training-time attention matrix contains O(L2)O(L^2) entries;
  • autoregressive decoding requires a KV cache that grows with sequence length;
  • at step tt, the query must be compared with all tt previous keys.

FlashAttention substantially improves IO efficiency and avoids materializing large intermediate tensors, but it does not change the underlying mathematical structure: every query still interacts with all historical keys.


2. Why separate Q from K, but combine K and V?

This is the most important step in understanding Linear Attention.

The temporal roles of Q, K, and V are asymmetric. A pair (ki,vi)(k_i,v_i) must remain available to the current query and every future query, whereas qtq_t is used only to produce the output at the current position.

2.1 Softmax fixes the order of computation

Ignoring normalization for a moment, attention can be written in matrix form as

Y=(QK)V.Y=(QK^\top)V.

The usual evaluation order first computes

A=QKRL×L,A=QK^\top\in\mathbb R^{L\times L},

and then computes AVAV. This corresponds to comparing every query with every key. The sequence dimension LL appears twice, which leads to quadratic complexity.

If the similarity function is an ordinary inner product, however, matrix multiplication is associative:

(QK)V=Q(KV).(QK^\top)V=Q(K^\top V).

Under the column-vector convention used here, the state on the right-hand side is equivalently

St=itviki,yt=Stqt.S_t=\sum_{i\le t}v_i k_i^\top, \qquad y_t=S_tq_t.

This is what it means to separate Q from K while combining K and V.

2.2 Intuition: a query is a one-time request; key–value pairs form memory

A historical key and value together describe an association:

kivi.k_i\longmapsto v_i.

The outer product vikiv_i k_i^\top can be interpreted as writing this association into a linear map. Summing all historical associations gives StS_t. The current query does not need to participate in storing history; it only serves as an address at read time:

qtStqt.q_t\longmapsto S_tq_t.

Therefore:

  • K and V are combined because both belong to the history and together form an address–content pair that should persist;
  • Q is separated from K because Q belongs to the current read operation, so there is no need to create and store an intermediate result between it and every historical key;
  • more fundamentally, associativity lets us replace a token-by-token similarity matrix with a feature-to-feature memory state.

2.3 Why can we not simply reorder softmax attention?

Because

softmax(QK)V\operatorname{softmax}(QK^\top)V Q(softmax(K)V)Q\bigl(\operatorname{softmax}(K^\top)V\bigr)

Softmax is a nonlinear operation applied, for each query, across all key scores. That nonlinearity destroys the associativity required by the reordering. Linear Attention does not magically rearrange softmax; it replaces the softmax kernel with one that can be factorized.


3. Kernelization and the derivation of Linear Attention

Write the softmax similarity as a kernel:

κ(q,k)=exp(qk/dk).\kappa(q,k)=\exp(q^\top k/\sqrt{d_k}).

Suppose we choose a feature map ϕ:RdkRdϕ\phi:\mathbb R^{d_k}\to\mathbb R^{d_\phi} such that

κ(q,k)ϕ(q)ϕ(k).\kappa(q,k)\approx \phi(q)^\top\phi(k).

Then

yt=it(ϕ(qt)ϕ(ki))viitϕ(qt)ϕ(ki).y_t = \frac{ \sum_{i\le t}\bigl(\phi(q_t)^\top\phi(k_i)\bigr)v_i }{ \sum_{i\le t}\phi(q_t)^\top\phi(k_i) }.

We can now group together the terms that depend only on the past:

St=itviϕ(ki),zt=itϕ(ki),S_t=\sum_{i\le t}v_i\phi(k_i)^\top, \qquad z_t=\sum_{i\le t}\phi(k_i),

which gives

yt=Stϕ(qt)ztϕ(qt).y_t = \frac{S_t\phi(q_t)}{z_t^\top\phi(q_t)}.

The recurrent form is

St=St1+vtϕ(kt),zt=zt1+ϕ(kt),yt=Stϕ(qt)ztϕ(qt)+ε.\begin{aligned} S_t &= S_{t-1}+v_t\phi(k_t)^\top,\\ z_t &= z_{t-1}+\phi(k_t),\\ y_t &= \frac{S_t\phi(q_t)}{z_t^\top\phi(q_t)+\varepsilon}. \end{aligned}

This reveals the RNN, or fast-weight-memory, interpretation of Linear Attention: StS_t and ztz_t are fixed-size recurrent states.

Later DeltaNet-style models commonly use normalized queries and keys and omit the explicit denominator state ztz_t. When moving into DeltaNet below, I therefore write ktk_t and qtq_t directly instead of ϕ(kt)\phi(k_t) and ϕ(qt)\phi(q_t). This does not mean that every form of Linear Attention lacks a denominator; it reflects a different parameterization.

3.1 In what sense is the complexity linear?

Assuming dkd_k and dvd_v are fixed:

  • updating StS_t costs O(dvdk)O(d_vd_k) per token;
  • reading StqtS_tq_t costs O(dvdk)O(d_vd_k) per token;
  • a sequence of length LL costs O(Ldvdk)O(Ld_vd_k) in total;
  • the decoding state occupies O(dvdk)O(d_vd_k) memory and does not grow with context length.

“Linear” refers to sequence length LL, not to the head dimensions. A fixed-size state is not free either: when the state is large, decoding can become limited by the bandwidth required to read and write it.

3.2 What do we lose?

Softmax attention preserves every key and value, allowing a future query to decide exactly which token to retrieve. Linear Attention compresses an arbitrarily long history into a fixed-size matrix, creating an unavoidable information bottleneck:

  • writes interfere when keys are not orthogonal;
  • a finite-dimensional state cannot losslessly preserve infinitely many associations;
  • the simplest additive update only accumulates information and cannot actively revise an old association.

The final limitation leads directly to DeltaNet.


4. The problem with additive memory: it can write, but not revise

Consider the simplest state update:

St=St1+vtkt.S_t=S_{t-1}+v_tk_t^\top.

It is important to distinguish two different operations.

  • Normal attention readout uses the current query:

    yt=Stqt.y_t=S_tq_t.

    If we keep the feature-map notation from Section 3, this becomes yt=Stϕ(qt)y_t=S_t\phi(q_t), optionally with denominator normalization.

  • Inspecting or updating a particular key–value association asks the state, “What is currently stored at address kk?” and therefore uses

    v^(k)=Sk.\hat v(k)=Sk.

    With an explicit feature map, the more precise expression is v^(k)=Sϕ(k)\hat v(k)=S\phi(k). DeltaNet instead feeds an L2-normalized kk directly into the state, so I will use the shorter notation SkSk from here on.

Thus, evaluating SkSk below does not mean that we replace the query with the key during normal attention. It is a read-before-write check: to update an association, we first need to know what the old memory already predicts at that address.

Suppose the same key kk is first bound to v1v_1 and later should be rebound to v2v_2. After two additive writes,

Sk=(v1k+v2k)k=(v1+v2)k2Sk = (v_1k^\top+v_2k^\top)k = (v_1+v_2)\lVert k\rVert^2

if we temporarily ignore interference from other keys. The memory returns the sum of the old and new values rather than replacing the old value.

A better update should not blindly add vtv_t. It should first ask:

What does the current memory already predict at ktk_t, and how far is that prediction from the new target vtv_t?

Writing only this error gives us the delta rule.


5. DeltaNet: treating the state as an online linear model

5.1 Derivation from an online regression objective

Interpret SS as an online linear model that receives a key and predicts a value:

v^t=St1kt.\hat v_t=S_{t-1}k_t.

For the current sample, define the squared error

Lt(S)=12Sktvt22.\mathcal L_t(S) = \frac12\lVert Sk_t-v_t\rVert_2^2.

Its gradient with respect to SS is

SLt=(Sktvt)kt.\nabla_S\mathcal L_t =(Sk_t-v_t)k_t^\top.

Taking one gradient-descent step with learning rate βt[0,1]\beta_t\in[0,1] gives

St=St1+βt(vtSt1kt)kt\boxed{ S_t = S_{t-1}+\beta_t(v_t-S_{t-1}k_t)k_t^\top }

while the normal readout remains

yt=Stqt.y_t=S_tq_t.

This is the core DeltaNet update. The model usually generates βt\beta_t dynamically from the current input; it acts as a write gate that controls how strongly or confidently the current association should be updated.

5.2 The erase-and-write view

Expanding the update gives

St=St1βt(St1kt)kterase the old prediction along kt+βtvtktwrite the new target=St1(Iβtktkt)+βtvtkt.\begin{aligned} S_t &=S_{t-1} -\underbrace{\beta_t(S_{t-1}k_t)k_t^\top}_{\text{erase the old prediction along }k_t} +\underbrace{\beta_tv_tk_t^\top}_{\text{write the new target}}\\ &=S_{t-1}(I-\beta_tk_tk_t^\top)+\beta_tv_tk_t^\top. \end{aligned}

DeltaNet therefore does not indiscriminately clear the whole memory. It only corrects the map along the current key direction.

5.3 Why L2-normalize the key?

Let kt2=1\lVert k_t\rVert_2=1. Reading immediately after the update with the same key gives

Stkt=St1kt+βt(vtSt1kt)(ktkt)=(1βt)St1kt+βtvt.\begin{aligned} S_tk_t &=S_{t-1}k_t +\beta_t(v_t-S_{t-1}k_t)(k_t^\top k_t)\\ &=(1-\beta_t)S_{t-1}k_t+\beta_tv_t. \end{aligned}

Therefore:

  • if βt=1\beta_t=1, then Stkt=vtS_tk_t=v_t: the association is exactly overwritten along that direction;
  • if 0<βt<10<\beta_t<1, the result interpolates between the old prediction and the new target;
  • without normalization, the effective step size is also multiplied by kt2\lVert k_t\rVert^2, making write strength harder to control.

The update can still affect other keys that are similar to ktk_t. This is cross-talk in a finite-dimensional associative memory, not something the delta rule can eliminate completely.

5.4 Why the state transition is harder to parallelize

Define

Ht=Iβtktkt.H_t=I-\beta_tk_tk_t^\top.

Then

St=St1Ht+βtvtkt.S_t=S_{t-1}H_t+\beta_tv_tk_t^\top.

HtH_t is an identity-minus-rank-one, generalized Householder-style transformation. Across multiple steps, we obtain an ordered product

H1H2Ht.H_1H_2\cdots H_t.

This is harder to parallelize across the sequence than the prefix sum used by additive Linear Attention. An important contribution of the 2024 DeltaNet work was to construct a hardware-friendly chunkwise algorithm using compact WY and Householder representations. Training can then proceed in parallel within chunks, while decoding still uses the simple recurrent update.

Two ideas should remain separate:

  • the model rule: the delta update improves overwrite behavior and associative recall;
  • the implementation: the chunkwise parallel form makes that rule practical to train on GPUs.

6. Why add a gate? DeltaNet does not forget proactively

The delta rule corrects the current key direction. But if an old piece of information is never followed by a similar key, it may remain in the state indefinitely. For language modeling, we often want the model to decide how long the memory as a whole should persist.

Gated DeltaNet (GDN) introduces a scalar retention gate αt(0,1]\alpha_t\in(0,1]. A clear way to write the update is to decay the old state first:

Sˉt1=αtSt1,\bar S_{t-1}=\alpha_tS_{t-1},

and then apply the delta rule to the decayed memory:

St=Sˉt1+βt(vtSˉt1kt)kt\boxed{ S_t = \bar S_{t-1} +\beta_t(v_t-\bar S_{t-1}k_t)k_t^\top }

or equivalently,

St=αtSt1(Iβtktkt)+βtvtkt.S_t = \alpha_tS_{t-1}(I-\beta_tk_tk_t^\top) +\beta_tv_tk_t^\top.

The two gates have different roles:

  • αt\alpha_t is the retention, or forget, gate: it controls how much of the old state survives;
  • βt\beta_t is the update, or write, gate: it controls how strongly the current association is corrected.

But αt\alpha_t is a scalar. Whenever the model forgets, every key-feature direction decays by the same amount. Different features in a finite state may represent different kinds of information or operate on different time scales, so this all-or-nothing decay limits expressivity.


7. Kimi Delta Attention: from scalar to fine-grained retention

KDA makes one focused change: it replaces GDN’s scalar retention αt\alpha_t with a vector

αt(0,1]dk,Dt=Diag(αt).\boldsymbol\alpha_t\in(0,1]^{d_k}, \qquad D_t=\operatorname{Diag}(\boldsymbol\alpha_t).

The gate acts along the key-feature axis of the state. First define the decayed memory

Sˉt1=St1Dt,\bar S_{t-1}=S_{t-1}D_t,

then apply the familiar delta correction:

St=Sˉt1+βt(vtSˉt1kt)kt\boxed{ S_t = \bar S_{t-1} +\beta_t(v_t-\bar S_{t-1}k_t)k_t^\top }

Expanding this gives KDA’s recurrent form under our dv×dkd_v\times d_k state convention:

St=St1Dt(Iβtktkt)+βtvtkt,yt=Stqt.\boxed{ S_t = S_{t-1}D_t(I-\beta_tk_tk_t^\top) +\beta_tv_tk_t^\top, \qquad y_t=S_tq_t. }

7.1 Why is fine-grained retention more expressive?

GDN gives the entire key-feature space a single retention time scale:

St1αtSt1.S_{t-1}\mapsto \alpha_tS_{t-1}.

KDA lets different directions retain information for different lengths of time:

St1St1Diag(αt).S_{t-1}\mapsto S_{t-1}\operatorname{Diag}(\boldsymbol\alpha_t).

Some dimensions can decay rapidly to track local syntax, while others stay close to one and preserve long-range semantics. Because the gate is generated dynamically from the input, the time scale of a given feature can also change from token to token.

This mechanism also provides an implicit relative positional signal. Temporarily ignore the rank-one delta correction and consider only diagonal decay. A write introduced at position ii is multiplied, by the time it reaches position tt, by

j=i+1tDj.\prod_{j=i+1}^{t}D_j.

The resulting memory depends both on distance and on which intervening tokens were encountered, and each feature can follow a different decay trajectory. In Kimi Linear, this allows the interleaved MLA layers to use NoPE while recurrent KDA supplies positional awareness. That is a property of the complete hybrid architecture, however; it should not be generalized into the claim that KDA never needs positional encoding in every possible setting.

7.2 KDA still follows the delta rule

Let

Sˉt1=St1Dt.\bar S_{t-1}=S_{t-1}D_t.

The KDA update remains

St=Sˉt1+βt(vtSˉt1kt)kt.S_t=\bar S_{t-1}+\beta_t(v_t-\bar S_{t-1}k_t)k_t^\top.

Every step still performs the same sequence:

  1. obtain the decayed memory used at the current step;
  2. read its old prediction at ktk_t;
  3. compute the residual between the target vtv_t and that prediction;
  4. write only the residual back along the ktk_t direction.

If kt=1\lVert k_t\rVert=1 and βt=1\beta_t=1, then Stkt=vtS_tk_t=v_t still holds. Fine-grained forgetting does not break the overwrite property of the delta rule.


8. Why is KDA a special DPLR recurrence?

KDA’s state-transition matrix is

Pt=Dt(Iβtktkt).P_t=D_t(I-\beta_tk_tk_t^\top).

Expanding it gives

Pt=Dtβt(Dtkt)kt.P_t =D_t-\beta_t(D_tk_t)k_t^\top.

This is a Diagonal Plus Low Rank matrix—more specifically, diagonal minus rank one:

Pt=Dtbtat,bt=βtDtkt,at=kt.P_t=D_t-b_ta_t^\top, \qquad b_t=\beta_tD_tk_t, \quad a_t=k_t.

The recurrence can therefore be written as

St=St1Pt+βtvtkt.S_t=S_{t-1}P_t+\beta_tv_tk_t^\top.

A general DPLR recurrence may obtain its two low-rank vectors from independent projections. That is highly expressive, but its chunkwise expansion requires more pairwise matrix products, additional numerical-stability machinery, and more computation. KDA ties both sides of the low-rank correction to the same normalized key, with one side modulated by the diagonal gate. This constrained structure preserves a clear delta-rule interpretation and enables a more efficient specialized chunkwise kernel.

A common-looking alternative formula defines the state as a dk×dvd_k\times d_v matrix:

St=(Iβtktkt)DtSt1+βtktvt.S_t=(I-\beta_tk_tk_t^\top)D_tS_{t-1}+\beta_tk_tv_t^\top.

This is simply the transpose of the convention used in this note, not a different algorithm. When comparing a paper with an implementation, first check the state orientation and only then compare multiplication order.


9. Intuition for chunkwise computation

The recurrent form is ideal for autoregressive decoding: each incoming token updates a fixed-size state once. Training, however, should process many tokens in parallel rather than loop through the sequence in Python.

Split the sequence into chunks of size CC. Within a chunk, repeatedly substitute

St=St1Pt+ut,ut=βtvtkt,S_t=S_{t-1}P_t+u_t, \qquad u_t=\beta_tv_tk_t^\top,

which yields

St=S0(j=1tPj)+i=1tui(j=i+1tPj).S_t = S_0\left(\prod_{j=1}^{t}P_j\right) +\sum_{i=1}^{t}u_i\left(\prod_{j=i+1}^{t}P_j\right).

This separates the work inside a chunk into three pieces:

  • propagating the state at the start of the chunk through a sequence of transitions;
  • propagating each within-chunk write to later positions;
  • retaining only a much shorter recurrence across chunk boundaries.

DeltaNet exploits the compact representation of rank-one Householder-style transitions. KDA exploits its special diagonal-minus-rank-one DPLR structure. Both aim to turn token-by-token recurrence into the large matrix multiplications GPUs handle well, without explicitly constructing every dk×dkd_k\times d_k transition product.

The exact kernel derivation involves WY representations, triangular systems within each chunk, and numerical-stability techniques. These are implementation-level optimizations. To understand the model itself, it is usually clearer to internalize the recurrent form before working backward from kernel code.


10. Three generations in one equation

Write all of the methods as

St=St1At+Bt,yt=Stqt.S_t=S_{t-1}A_t+B_t, \qquad y_t=S_tq_t.
MethodAtA_tBtB_tCore capability
Additive Linear AttentionIIvtktv_tk_t^\topFixed-size additive associative memory
DeltaNetIβtktktI-\beta_tk_tk_t^\topβtvtkt\beta_tv_tk_t^\topErases and rewrites the prediction along the current key direction
Gated DeltaNetαt(Iβtktkt)\alpha_t(I-\beta_tk_tk_t^\top)βtvtkt\beta_tv_tk_t^\topAdds global forgetting to the delta update
KDADt(Iβtktkt)D_t(I-\beta_tk_tk_t^\top)βtvtkt\beta_tv_tk_t^\topAdds fine-grained retention along key features

Here, Dt=Diag(αt)D_t=\operatorname{Diag}(\boldsymbol\alpha_t). The progression worth remembering is

Iaccumulate onlyIβkkcorrectα(Iβkk)forget globallyD(Iβkk)forget selectively.\underbrace{I}_{\text{accumulate only}} \quad\longrightarrow\quad \underbrace{I-\beta kk^\top}_{\text{correct}} \quad\longrightarrow\quad \underbrace{\alpha(I-\beta kk^\top)}_{\text{forget globally}} \quad\longrightarrow\quad \underbrace{D(I-\beta kk^\top)}_{\text{forget selectively}}.

11. A two-dimensional example

Let dk=2d_k=2 and choose two orthogonal keys:

ka=[10],kb=[01].k_a=\begin{bmatrix}1\\0\end{bmatrix}, \qquad k_b=\begin{bmatrix}0\\1\end{bmatrix}.

The two columns of the state contain the values associated with kak_a and kbk_b.

Additive update

If we first write v1v_1 at kak_a and then write v2v_2 at the same address, the first column becomes v1+v2v_1+v_2. There is no replacement semantics.

Delta update

If the second write uses β=1\beta=1, the update first subtracts the current contents of the first column and then writes v2v_2. The first column becomes exactly v2v_2, while the second column is unaffected.

GDN and KDA

If GDN uses α=0.9\alpha=0.9, both columns are multiplied by 0.90.9. KDA can instead choose

D=Diag(0.2,0.99),D=\operatorname{Diag}(0.2,0.99),

so that memory associated with kak_a is forgotten quickly while memory associated with kbk_b is almost completely retained. This is the simplest illustration of the difference between a scalar and a diagonal gate.

Keys in a real model are not orthogonal, so “one column equals one independent concept” is only a teaching intuition. Part of training is learning a key-feature space that supports useful reads and writes while minimizing conflicts.


12. Kimi Linear is not pure KDA

KDA is an attention module; Kimi Linear is a complete hybrid architecture that uses it. The representative architecture in the paper interleaves KDA and MLA layers at a roughly 3:13{:}1 ratio. The goal is to combine

  • KDA’s linear sequence complexity, fixed recurrent state, and fast long-context decoding;
  • full attention or MLA’s direct access to individual historical tokens, which alleviates the information bottleneck of a fixed-size state.

The paper’s claim of reducing KV-cache usage by up to 75% follows from this hybrid ratio together with MLA’s cache design. It does not mean that an individual KDA layer stores 25% of the historical KV pairs. Likewise, the reported long-context throughput gains come from the complete system: architecture, kernels, and model layout together.


13. Common misconceptions and a checklist

Misconception 1: Linear Attention is a lossless reordering of softmax attention

It is not. Only a factorable kernel permits the associative reordering. Replacing the kernel changes the model’s inductive bias and usually introduces a fixed-capacity bottleneck.

Misconception 2: Combining K and V means computing KVK^\top V once

That description works for a non-causal, full-sequence expression. A causal model must maintain a prefix state StS_t so that the query at position tt cannot access future tokens.

Misconception 3: DeltaNet increases state capacity

It does not change the dimensions of StS_t. It improves how the finite capacity is used, especially by overwriting stale associations instead of accumulating them indefinitely.

Misconception 4: α\alpha and β\beta are the same kind of gate

They are not. α\alpha controls retention of the old state; β\beta controls the strength of the current delta correction.

Misconception 5: KDA is merely per-channel GDN

That is a useful high-level intuition, but the gate acts on the key-feature axis and its order relative to (Iβkk)(I-\beta kk^\top) matters. Matrix multiplication is not commutative:

D(Iβkk)D(I-\beta kk^\top) (Iβkk)D(I-\beta kk^\top)D

in general. Always align row- versus column-vector conventions before comparing equations or code.

Misconception 6: Linear complexity always means faster execution

Actual speed also depends on sequence length, head size, chunk kernels, hardware utilization, state-memory bandwidth, and whether the architecture mixes in full attention. At short sequence lengths, a highly optimized FlashAttention implementation can remain very competitive.


14. The shortest summary

  1. Softmax attention retains every historical key and value, allowing each query to select the past independently. It is expressive, but expensive in sequence length.

  2. Linear Attention uses a factorable kernel and associativity to compress historical (ki,vi)(k_i,v_i) pairs into St=ivikiS_t=\sum_i v_ik_i^\top, which is then read by qtq_t. This is the meaning of separating Q from K and combining K with V.

  3. A purely additive state cannot naturally overwrite an old mapping.

  4. DeltaNet treats the state as an online linear model and writes its prediction error:

    St=St1+βt(vtSt1kt)kt.S_t=S_{t-1}+\beta_t(v_t-S_{t-1}k_t)k_t^\top.
  5. Gated DeltaNet uses a scalar αt\alpha_t to control retention of the whole memory.

  6. KDA uses a diagonal matrix DtD_t to control retention independently across key features:

    St=St1Dt(Iβtktkt)+βtvtkt.S_t=S_{t-1}D_t(I-\beta_tk_tk_t^\top)+\beta_tv_tk_t^\top.
  7. KDA’s diagonal-minus-rank-one transition is more expressive than a scalar gate, preserves the delta-rule structure, and supports an efficient specialized DPLR chunkwise algorithm.


References

  1. Katharopoulos et al., Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention, ICML 2020.
  2. Schlag, Irie, and Schmidhuber, Linear Transformers Are Secretly Fast Weight Programmers, ICML 2021. The fast-weight interpretation of Linear Attention and the delta rule.
  3. Yang et al., Parallelizing Linear Transformers with the Delta Rule over Sequence Length, NeurIPS 2024. Recurrent and chunkwise DeltaNet formulations and hardware-efficient training.
  4. Yang et al., Gated Delta Networks: Improving Mamba2 with Delta Rule, ICLR 2025. Data-dependent decay for DeltaNet.
  5. Kimi Team, Kimi Linear: An Expressive, Efficient Attention Architecture, 2025. KDA, its specialized DPLR chunkwise algorithm, and the hybrid Kimi Linear architecture.
#linear-attention#transformers#llm