Frontier releases · 6
Kimi K3.1 Pro
Remember, then look up
Official release: .byhand release:
Kimi K3.1 Pro is Kimi K3 with one line changed, and a block copied from DeepSeek.
Moonshot's model card puts the change in a sentence: "we replace the full-attention Gated MLA layers with Gated DeepSeek Sparse Attention (Gated DSA) layers for more efficient long-context modeling."
Only 24 of its 93 layers have anything to make sparse. The other 69 are Kimi Delta Attention, from Moonshot's Kimi Linear (October 2025): they never look back at the context at all, but carry a memory of fixed size, one 128 × 128 matrix per head, and write into it only what it failed to recall. Their cost is the same at the first token and the millionth. The 24 that remain, one layer in four, keep full attention, because a fixed memory compresses, and some things must be found exactly: a name from page three, a line of code. At a million tokens they are where the cost still grows.
Kimi K3, K3.1 Pro and DeepSeek V3.2-Exp are all written in .byhand, every operation from scratch, so a change from one to another is a diff you can read.
The indexer sits inside every fourth layer: open a stage, then a Gated DSA box, to find it.
- 1
The one line
Kimi K3's attention layer, as K3.1 Pro changes it:
query, key
| matmul c
| scale factor=1/sqrt(query.c192)
- | mask t > s value=-inf
+ | mask t > s or not picked value=-inf
| softmax tThe mask hid only the future. Now it also hides every key the indexer did not pick. Nothing else in the layer moves, but for the call that gives picked: the indexer, run on the layer's input and the query's low rank, which the layer already computes.
The copied block
The indexer is DeepSeek's, from DeepSeek V3.2-Exp (September 2025), already in the library. It is copied with two edits. Half the heads, 32 for DeepSeek's 64. And no positions: DeepSeek turns half of each query's and key's channels by position, but K3 has no positions anywhere, so its indexer has none either (index_rope_dim 0). What stays is attention made small: 32 heads of 128 against one shared key a token, a ReLU so a head that sees nothing worth reading adds nothing, the token weighting its heads, the 2048 best keys kept.
The indexer still sees every key, but it is cheap; the attention itself, 96 heads of 192, reads 2048 keys however long the context.
Moonshot has not published K3.1 Pro's code, only its configuration. We wrote the indexer as DeepSeek's, checked it against Moonshot's K3 code with DeepSeek's indexer added, in PyTorch, JAX and MLX, and left out two settings whose meaning the config does not say (index_skip_topk_offset, index_topk_freq). Treat it as our reading of the change, verified against itself, not against Moonshot's model.