You Could Have Come Up with Kimi Delta Attention
Demystifying Kimi Delta Attention
Author: Jamie Dborin, Founder & Member of Technical Staff at Doubleword
Date: July 27, 2026
Topic: Inference API / Linear Attention

📐 A Note on Mathematical Notation
To make the geometric shapes of this derivation intuitive, this article utilizes bra-ket notation (inspired by quantum mechanics).
Notation Reference Table
| Notation | Representation | Mathematical Type |
|---|---|---|
| Query | Column Vector | |
| Key | Row Vector | |
| Inner Product | Scalar (Number) | |
| Outer Product | Matrix |
Key Convention: By default, vectors point right, but keys are written pointing left when they are integrated into the linear-attention state.
Assumptions for this derivation:
- We are analyzing a single causal attention head.
- All vectors are real-valued.
- DeltaNet keys are normalized.
- The state acts as a map from the key space to the value space.
The Complexity of Modern Linear Attention
At first glance, contemporary linear attention variants seem impenetrable. Their equations are dense, and the underlying intent is often obscured. To illustrate this, consider the state update logic for Kimi Delta Attention (KDA):
This complexity is a result of "feature creep" within the DeltaNet family. Over several years, these models have evolved, and each iteration has added layers of sophistication, making the latest versions feel inaccessible to outsiders.
However, these equations aren't magic; they are the result of making simple assertions about how a hidden state should behave. We can derive KDA by following this evolutionary path:
Our Roadmap
- Start with Quadratic Attention
- Strip away the Softmax
- Transition to DeltaNet
- Implement Gating
- Arrive at KDA
- Explore Triton implementations (Recurrent & Chunkwise)
1. Starting with Quadratic Attention
In standard causal softmax attention, for a query at time , the output is calculated as:
How it works: It computes the similarity between a specific key and query, then uses the softmax function to normalize these scores into a probability distribution.
The Bottleneck:
- For a sequence of length , you must compute key-query pairs.
- While we can cache keys and values during autoregressive inference, the cache grows linearly.
- Every new query must still scan the entire history because the denominator is dependent on both the current query and all previous keys.
1.1 Removing the Softmax
To simplify, let's absorb the scaling factor into the query and remove the softmax. This gives us a "bare-bones" version of attention:
Because the inner product is just a scalar, we can shift it to the right side of the value vector:
Now, we can encapsulate everything from the past into a single matrix of fixed size :
Attention is now transformed into a recurrent write followed by a read:
The Core Trick:
The identity (|v><k>)|q> = <k|q>|v> allows us to store summed outer products in a fixed-size state . This reduces the complexity from quadratic to linear relative to sequence length. We only scan the tokens once, updating the state at each step.
The trade-off? We lose the selectivity and normalization provided by the softmax. While advanced linear attention uses feature maps to fix this, this basic form highlights the memory issue that DeltaNet aims to solve.
1.2 Addition is not Assignment
Consider what happens if we write a pair and then immediately query the state using that same key: