Kimi Linear,
decoded.
The slide’s dense formula describes a small, editable memory. At every token, KDA ages the old state, erases its wrong prediction, writes a correction, and reads with a query. This is why most Kimi Linear layers do not need a growing token-by-token KV cache.
ERASE the wrong answer
WRITE key → value correction
READ: oₜ = Sₜᵀqₜ
Attention becomes
memory maintenance.
Ordinary softmax attention asks: “Which earlier tokens should this token look at?” KDA asks a different question: “What compact mapping has the sequence taught me so far, and how should I edit it now?”
In a conventional attention layer, every past token contributes a key and value. During autoregressive generation those tensors are retained in a KV cache. A new query scores the historical keys and mixes their values. The archive grows with context length, and each decode step must interact with an increasingly large history.
Kimi Delta Attention (KDA) is recurrent linear attention. It compresses the past into a matrix S. The matrix behaves like “fast weights”: a transient associative map created from the current sequence, not a permanent learned model parameter. Give it a query-like direction and it returns a value-like vector.
That compression changes the scaling term. A KDA layer advances a fixed-size state instead of appending another cache record. But compression is not lossless. Kimi Linear therefore alternates three KDA layers with one global Multi-Head Latent Attention (MLA) layer, retaining a periodic exact token-addressable path.
One line contains
four operations.
Sₜ = (I − βₜkₜkₜᵀ) Diag(αₜ) Sₜ₋₁ + βₜkₜvₜᵀoₜ = SₜᵀqₜState shape: Sₜ ∈ ℝdₖ × dᵥ. Output shape: oₜ ∈ ℝdᵥ. The paper L2-normalizes queries and keys; β is sigmoid-bounded, while the diagonal decay α is data-dependent and channel-wise.
SₜThe memory
A fixed matrix per head. Rows live in key-feature space; columns live in value-feature space. It stores compressed associations accumulated through the sequence.
αₜThe lifetimes
A vector of dₖ retention factors. Diag(αₜ) scales key channels independently, letting different directions forget at different rates.
βₜThe edit strength
A scalar for this token and head. Near zero means barely edit; near one means strongly replace the state’s answer along the current key direction.
q,k,vAddress and content
k selects where memory is corrected, v supplies the desired content, and q reads a mixture from the updated state to produce o.
Age. Predict. Correct.
Then retrieve.
Age the old memory
S̄ = Diag(αₜ)Sₜ₋₁Each row/key channel gets its own retention. A low α rapidly clears that direction; an α near one preserves it. The meanings of channels are learned—not hand-labelled “syntax” or “facts.”
Ask what k already returns
r = S̄ᵀkₜThe decayed state makes a value prediction r at the current key. If the association is already correct, little needs to change.
Write only the error
Sₜ = S̄ + βₜkₜ(vₜ − r)ᵀThe target minus prediction is the delta. The outer product writes that correction along k while minimizing collateral change in orthogonal directions.
Query the new state
oₜ = SₜᵀqₜA query aligned with stored key directions retrieves their associated value features. Similar queries can generalize; collisions can interfere.
(I − βkkᵀ) S̄ + βkvᵀErase what the old state predicts at k; then add the desired value at k.
S̄ + βk(v − S̄ᵀk)ᵀKeep the state, then write the reconstruction error. The two expressions are algebraically identical.
β controls how far
memory moves toward truth.
Assume a normalized key k = [1, 0]. After α-decay, the state currently returns r = [0.20, 0.80], but the new target value is v = [1.00, −0.20]. Only the first row is corrected because k points exactly along the first key axis.
new read = r + β(error)
= (1 − β)r + βv
At β = 1: new read = v exactly.
At β = 0: memory is unchanged.
Edit-strength simulator
One head can learn
many memory clocks.
Gated DeltaNet multiplies the whole head state by one scalar α. KDA replaces that single clock with dₖ channel-wise decay values.
With scalar decay, every direction within one head shares the same half-life. The head can remember broadly or forget broadly, but it cannot independently preserve one key-feature subspace while rapidly refreshing another. KDA’s diagonal gate changes that: Diag(α) scales the state’s rows independently.
This is finer-grained without becoming an arbitrary dense transition. The erase term remains rank one and tied to k. The resulting transition can be written as Diag(α) − βk(k ⊙ α)ᵀ: diagonal plus rank one (DPLR). It is more expressive than scalar weight decay, but constrained enough for a specialized chunkwise algorithm.
The authors also connect channel-wise decay to positional behavior. Different decay rates create different recency scales, analogous in spirit—not in mechanism—to RoPE assigning different rotation frequencies across dimensions. Kimi Linear consequently uses NoPE in its periodic global MLA layers and lets KDA carry the learned positional/recency bias.
Gated DeltaNet
Sₜ = αₜ(I − βkkᵀ)Sₜ₋₁ + βkvᵀ
one α per token/headAll key channels in the head age together. Simple and efficient, but coarse.
Kimi Delta Attention
Sₜ = (I − βkkᵀ)Diag(α⃗)Sₜ₋₁ + βkvᵀ
dₖ α values per token/headDifferent learned directions can retain information over different horizons.
Three compressed layers.
One addressable layer.
Why retain full attention?
Pure fixed-state models can struggle with exact copying and fine-grained selection because many token associations collide in one finite matrix. Global MLA can directly compare a query with historical token positions.
Why whole layers?
The team chose layerwise rather than headwise mixing for infrastructure simplicity and training stability. A regular repeating cache layout is also easier for serving systems to manage.
Why specifically 3:1?
It was empirical, not a mathematical constant. In the paper’s matched ablation, 3:1 had validation perplexity 5.65, versus 5.66 at 1:1, 5.70 at 7:1, 5.82 at 15:1 and 5.77 for 0:1 full MLA.
| Mechanism | Decode-time history | Memory update | Forgetting | Exact old-token lookup |
|---|---|---|---|---|
| Softmax / MLA | Growing per-token cache | Append K/V | Choose at read time | Yes, through attention scores |
| Plain linear attention | Fixed matrix | Add kvᵀ | None | No; history is compressed |
| DeltaNet | Fixed matrix | Write prediction error | Targeted erase/write | No; history is compressed |
| Gated DeltaNet | Fixed matrix | Delta rule | One α per head/token | No; history is compressed |
| KDA | Fixed matrix | Delta rule | Channel-wise α plus β | No; hybrid MLA supplies it |
The slide is directionally right.
The setup still matters.
Tokens used for fair Kimi Linear vs MLA and GDN-H architecture runs.
Reduction attributed to the repeating 3:1 KDA/MLA hybrid.
1.84 ms versus 11.48 ms for MLA in the report’s throughput setting.
Versus 52.2 for matched MLA across the paper’s long-context suite.
With the same 1.4T-token pretraining recipe, Kimi Linear led the MLA baseline on most reported short-context tasks, including MMLU-Pro (51.0 vs 47.2). At 128K it scored 84.3 on RULER and 68.5 on RepoQA, versus MLA’s 81.3 and 63.0.
The hybrid did not win everything. MLA was higher on LongBench V2 and Frames; GDN-H or MLA led some SFT benchmarks such as MATH500, EvalPlus and LiveBench. “Outperforms full attention” is a summary of the aggregate tested recipe, not a universal theorem.
The report ran math RL with the same algorithm and hyperparameters. Kimi Linear’s training and evaluation curves were above MLA’s in that experiment. This supports compatibility with RL scaling; it does not isolate which KDA subcomponent caused the gain.
The 1.4T runs are controlled architecture comparisons. The public 48B-total/3B-active Base and Instruct checkpoints listed by Moonshot were trained on 5.7T tokens and support up to a 1M-token context. Those later checkpoint scores should not be presented as the 1.4T ablation.
KDA removes the length-growing scan from KDA layers, not from the entire model. At short context, projections, experts and launches can dominate. At long context, avoiding cache reads becomes increasingly valuable; realized speed still depends on batching, HBM, kernels and the global MLA layers.
Recurrent for decode.
Chunked for prefill.
The one-token recurrence is ideal when generating the next token, but naively repeating it across a long prompt would serialize training and prefill.
Kimi’s algorithm expands the recurrence inside chunks. Many token interactions are reorganized into dense matrix multiplications, while a compact state transition links one chunk to the next. The transition’s specialized DPLR structure matters: KDA sets the low-rank erase directions from k instead of learning general independent vectors, reducing intermediate work and I/O.
The technical report says its constrained formulation removes two secondary chunking operations and roughly three matrix multiplications relative to a general DPLR algorithm, approaching 2× DPLR kernel speed in its benchmark. During autoregressive decode, the runtime returns to the simple recurrent update: read and edit a fixed dₖ × dᵥ state.
Moonshot has open-sourced KDA implementations in Flash Linear Attention and a CUTLASS-based FlashKDA project. FlashKDA’s API exposes q, k, v, channel gate g, scalar β, and optional initial/final states; its current kernel documentation lists dₖ = dᵥ = 128. This code makes the slide’s “hardware efficiency” claim inspectable, though kernel microbenchmarks are not whole-model serving benchmarks.
Finite memory is efficient.
It is also finite.
“S contains every token.”
No. S contains a superposition of learned associations. It can generalize across similar keys, but it cannot expose an arbitrary old token as a discrete cache entry.
“α assigns semantic categories.”
No. α gates learned feature directions. We may describe “fast” and “slow” channels for intuition, but the network discovers distributed representations rather than named memory slots.
“β only writes.”
In the classical delta rule, the same β controls erasing the old prediction and writing the target. It is the learning rate of one corrective state update.
“75% means total memory.”
The figure refers to KV-cache savings in the hybrid. Model weights and other runtime state remain, and one in four token-mixing layers still maintains MLA cache.
“6.3× always.”
That is a reported 1M-context TPOT comparison under a particular setup. Batch size, hardware, precision, cache pressure and implementation move the crossover.
“The equation replaces attention quality.”
The hybrid architecture is evidence of the opposite: KDA handles efficient compression, while periodic global attention covers exact retrieval failure modes.
KDA is online learning
inside inference.
At each token, the model briefly behaves like a learner: its temporary matrix predicts a value from a key, measures the error, and takes one gated gradient step.
That single perspective unifies the formula. α regularizes memory with feature-specific decay. kkᵀ targets the erase. v − Sᵀk is the correction. β is the online learning rate. q asks the revised memory for the representation needed downstream.
The systems payoff follows directly: because the learned state has a fixed shape, most Kimi Linear layers do not accumulate a KV record for every token. The quality strategy is equally important: periodic global MLA layers retain token-addressable history where compression is weakest. Kimi Linear is therefore not “linear attention beats attention.” It is a carefully engineered division of labor between compressed associative memory and exact global retrieval.
That is what the two slides mean—and why the equation matters. It is simultaneously a memory algorithm, a learned forgetting policy, a long-context scaling choice, and a GPU-kernel design constraint.
Primary paper, model and code.
Mathematical interpretations are algebraic restatements of the published recurrence. Quantitative statements retain their experimental context; systems consequences not directly benchmarked are identified as such. Accessed 18 July 2026.
- 01Kimi Linear technical report — equation, architecture and results↗
- 02MoonshotAI Kimi Linear repository — release and deployment↗
- 03Official Kimi Linear A3B model collection↗
- 04Official model configuration — layer schedule and dimensions↗
- 05FlashKDA — CUTLASS kernels and state API↗
- 06Flash Linear Attention KDA implementation↗
- 07Gated Delta Networks — scalar decay plus delta rule↗
- 08Linear Transformers Are Secretly Fast Weight Programmers↗
- 09Gated Linear Attention — hardware-efficient gated recurrence↗
- 10DeepSeek-V2 — Multi-Head Latent Attention↗