Skip to content
Friendly disclaimer: flozi00 TechHub is a solo side-project next to a full-time job β€” personal learning notes, no official statements. Verify critical steps yourself.

Kimi K3.1 Pro: Sparse Reads, Not a Smaller History

Explain the released K3.1 Pro checkpoint's DSA indexer, NoPE paths and sparse MLA. Derive selection error and separate attention reads from retained KV capacity.

6 min readflozi00
aiarchitecturekimiattentionkv-cachemoeinference
Skip to the full article
Watch Β· explore Β· understand

K3.1: select reads, retain history

A separate NoPE indexer selects positions for global MLA. KDA summaries and retained global records are different states.

AI-assisted learning visualization Β· schematic article explanation

Step 1 / 4Separate the representations

The global cache retains MLA records and index keys. A new query can select old positions, so a fixed read budget is not a fixed history budget.

ArchitectureCurrent stepSelect a block to explain it
Current representation
Residual width 7,168; this overview groups repeated layer types, not parallel execution.
NoPE indexer
32 query heads Γ— 128; shared 128-wide index key per position. Index keys use LayerNorm.
Retained global history
Per-position MLA representation plus index keys. Not only the latest 2,048 tokens.
  1. Current representation NoPE indexer
    project selection query
  2. Retained global history NoPE indexer
    index keys
What to remember

Top-2048 bounds selected positions, not all selection work, retained cache or error.

Mechanism overview, not measured performance. Repeated layers are grouped; NoPE does not imply removal of every configured companion key coordinate.

Terms and the complete walkthrough
Indexer
A learned position selector separate from the main attention and MoE router.
Omitted mass
Hypothetical full-attention probability outside the selected set; not measured here.
  1. Separate the representations

    The global cache retains MLA records and index keys. A new query can select old positions, so a fixed read budget is not a fixed history budget.

  2. Select positions with the indexer

    Top-k returns at most 2,048 causal positions. NoPE index keys are separately normalized; every global layer computes its own selection.

  3. Normalize over the retained selection

    Main attention reads selected records using its own logits. Indexer ranking does not guarantee that little full-attention mass was omitted.

  4. Keep KDA and output gating distinct

    Recurrent layers provide bounded summaries; the global read has a sigmoid gate before output projection. Neither mechanism is expert routing.

All connections

  • Current representation β†’ NoPE indexer: project selection query
  • Retained global history β†’ NoPE indexer: index keys
  • NoPE indexer β†’ Top-2048 position IDs: score and rank
  • Top-2048 position IDs β†’ Sparse gated MLA read: position IDs
  • Retained global history β†’ Sparse gated MLA read: selected records
  • Current representation β†’ 69 recurrent KDA layers: recurrent layers
  • Sparse gated MLA read β†’ Continue decoder: gated read
  • 69 recurrent KDA layers β†’ Continue decoder: recurrent result
Set your own pace. Pause at any time or select a step directly.

A concrete change from K3

As of 5 November 2026, Moonshot's Kimi-K3.1-Pro repository contains downloadable weights in 96 safetensors shards. This guide pins the checkpoint to d9e99b0792a5e93b78ea9bea62a68167e36ddd9e and SGLang source to 93e6b42d8afa99702547eeeb340986884c9616a3. It is a released model, not an inference inferred from an announcement.12

The relevant change from our Kimi K3 architecture guide is precise: the 24 Gated MLA layers now use DeepSeek Sparse Attention (DSA). The 69 Kimi Delta Attention (KDA) layers remain recurrent. Sparse global reads complement recurrent summaries; they do not turn the global cache into a fixed-size summary.32 No model inference, quality or throughput benchmark was run for this article.

What changes, and what does not?

Residual width remains 7,168, with 93 layers. One-based global layers are 4, 8, …, 92, 93; the other 69 use KDA. The text configuration retains KV latent rank 512, query latent rank 1,536, 96 main attention heads, and 128-wide value heads. It also retains block Attention Residuals with block size 12 and LatentMoE width 3,584, 16 of 896 routed experts and two shared experts. These inherited mechanisms are explained in the K3 guide; DSA does not replace the MoE router.2

The new indexer has 32 query heads of width 128, one shared 128-wide index key per stored position, and a 2,048-position selection budget. This is a separate, cheaper representation for choosing positions, not the main attention's compressed K/V. The pinned SGLang configuration explicitly requires index_topk_freq = 1: every global layer runs its own indexer. Do not import cross-layer index reuse from another DSA model.45

Follow one query through the indexer

For TT query positions and SS eligible cached positions, the indexer projects the query latent into [T,32,128]. A different projection maps residual states to [S,128] keys, followed by LayerNorm; another maps each query's residual state into 32 head weights. Their scoring path produces position scores, then selects up to 2,048 causal candidates per query. The resulting position-ID array is logically [T,2048], with invalid/short-prefix entries handled by the backend.5

The adapter matters: K3.1 specifies index_rope_dim = 0, LayerNorm rather than RMSNorm for index keys, FP32 key normalization, no Hadamard transform, and a BF16 head-gate path. These are explicit implementation choices, not defaults to borrow from DeepSeek's indexer. The indexer and main attention are also distinct from expert routing: one chooses positions, the other FFNs.4

The main global attention remains a gated MLA implementation with skip_rope=True. NoPE here means no rotary transform in that path, not β€œall configured rotary-width coordinates disappear.” The constructor still passes a 64-wide companion key component alongside the 512-wide latent. The indexer's zero rotary width is a separate setting.6

After sparse attention, SGLang applies a learned coordinate-wise sigmoid output gate before the output projection. Neither the indexer score nor that gate is a probability that a retrieved fact is correct. The KDA, global attention, depth mixing and expert routing retain different roles and states.

The math of sparse attention and its missing mass

Let stjs_{tj} denote the learned indexer score for query tt and eligible position jj. Let ItI_t contain its highest-scoring up-to-2,048 positions. For one main attention head, define its different attention logit as atja_{tj}. The sparse read is a softmax restricted to ItI_t:

It=TopK⁑j≀t(stj,2048),y~t=βˆ‘j∈Iteatjvjβˆ‘j∈Iteatj.I_t=\operatorname{TopK}_{j\leq t}(s_{tj},2048),\qquad \widetilde y_t= \frac{\sum_{j\in I_t}e^{a_{tj}}v_j} {\sum_{j\in I_t}e^{a_{tj}}}.

This notation abstracts the absorbed MLA projections and floating-point kernels; it is not a claim that the runtime materializes all head-specific K/V. Selection scores ss are not main attention logits aa. High indexer rank therefore does not mathematically guarantee high main-attention mass.

An illustrative bound makes that limitation explicit. Hold logits and values fixed and compare with a hypothetical full read. If Ο΅\epsilon is the full softmax mass outside ItI_t, then:

yt=(1βˆ’Ο΅)y~t+Ο΅ydrop,βˆ₯ytβˆ’y~tβˆ₯=Ο΅βˆ₯ydropβˆ’y~tβˆ₯≀2MΟ΅,βˆ₯vjβˆ₯≀M.y_t=(1-\epsilon)\widetilde y_t+\epsilon y_{\mathrm{drop}}, \qquad \|y_t-\widetilde y_t\| =\epsilon\|y_{\mathrm{drop}}-\widetilde y_t\| \leq 2M\epsilon, \quad \|v_j\|\leq M.

The proof uses only that both retained and dropped reads are convex combinations of bounded values. It says small omitted mass can bound one head's local read error. It says nothing about whether this indexer actually keeps that mass. It also does not bound the final token distribution after output projection, residual mixing and later layers, or compare two independently trained checkpoints. No empirical value of Ο΅\epsilon was measured here.

Why top-2048 does not mean a 2048-token cache

At the configured 1,048,576-token context ceiling, 2,048 positions are 1/512, or 0.1953125%, of that length. This is an arithmetic comparison of the final selection width, not a 512Γ— end-to-end speedup. Index scoring and top-k still operate over eligible history, and their keys must remain available for a different future query. Prefix prefill, recurrent work, MoE traffic and kernel scheduling remain additional.25

A transparent reference budget illustrates the difference. Suppose one request retains, per global layer and position, a 512+64-element MLA representation and a 128-element index key, all in BF16. Then:

Cglobal(S)=24[(512+64)β‹…2+128β‹…2]S=33,792SΒ bytes.C_{\mathrm{global}}(S) =24\big[(512+64)\cdot2+128\cdot2\big]S =33{,}792S\ \mathrm{bytes}.

That hypothetical payload is 33 KiB/token, or 33 GiB at the full configured length. It is not a measured or universal runtime allocation: index/MLA quantization, scale metadata, padding, sharding, replication, offload and page allocation change physical memory. The essential point is the dependence on SS, not the particular dtype. KDA recurrent/convolution state, prefix checkpoints, weights and workspaces are additional. See the KV-cache budget guide.

Do not multiply the 512-wide shared latent by all 96 main heads as if these were ordinary independent head-specific KV vectors. Conversely, do not assume MXFP4 expert weights imply a four-bit cache. The checkpoint's quantization configuration has kv_cache_scheme = null; weight and cache precision are separate decisions.26

What a deployment must validate

The checkpoint excludes attention, shared experts, vision/projector and several other projections from its MXFP4 weight group. Active parameter count is not resident checkpoint size. Pin the engine and verify that its loader instantiates KimiK31ForConditionalGeneration, reads the nested DSA configuration and loads the indexer parameters. The pinned SGLang model has an explicit check for missing indexer weights; silently running a dense K3 path would not reproduce this architecture.26

The official vLLM recipe distinguishes baseline serving from optional DCP, cache precision and speculative-decoding configurations. Its synthetic-acceptance throughput mode skips real verification and is explicitly unsuitable for serving users or evaluating accuracy. That is a benchmarking shortcut, not a valid decoder setting. The recipe also says long-context accuracy was not measured for its NVFP4 MLA-cache option. Neither option should be presented as a quality-preserving default.7

No throughput figures are reproduced here. To evaluate a deployment, hold hardware, concurrency, precision, input/output lengths and quality criteria fixed. Measure indexer time separately from sparse attention, peak memory, prefill latency, decode latency and long-context retrieval/agent success. Store all state at the same prefix boundary when reusing KDA and global caches. A one-million-token limit is not a recall guarantee.

Practical consequence

K3.1 Pro is worth considering when long-lived agent sessions make reading a large global history expensive while recurrent layers supply compact context mixing. That is a mechanism-based hypothesis to test, not a recommendation based on a launch score. It does not make all expert weights or old cache records disappear.

Compared with Step-5's sparse GQA, the retained global representation here is MLA-compressed and paired with KDA. Compared with DeepSeek V4.1 Flash, do not assume the same compression or index-reuse policy. The useful lesson is to budget selection work, selected reads, retained history and approximation quality separately.

Primary sources

Footnotes

  1. Pinned Kimi K3.1 Pro artifacts. ↩

  2. Pinned checkpoint configuration. ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  3. Pinned official model card. ↩

  4. Pinned SGLang KimiLinearConfig, _init_dsa. ↩ ↩2

  5. Pinned SGLang DSA indexer. ↩ ↩2 ↩3

  6. Pinned SGLang Kimi K3/K3.1 model, MLA gate and weight checks. ↩ ↩2 ↩3

  7. Official vLLM K3.1 recipe, inspected 2026-11-05; backend-specific measurements and limitations, not results reproduced here. ↩