Manuscript Offprint

arXiv:2609.07008

RedKnot-MLA: Multi-Head Offline-Online Reuse for DeepSeek-V4 Long-Context Serving

Yang Liu, Zhaokai Luo, Huayi Jin, Ruozhou He, Chenchen Hong, Mingxiao Ma, Biao Zhang, Zhiyong Wang, Boyu Wang, Guanjie Chen, Yifei Liu, Tao Xie, Junhao Hu

Yang Liu*† Zhaokai Luo*† Huayi Jin† Ruozhou He† Chenchen Hong† Mingxiao Ma† Biao Zhang† Zhiyong Wang† Boyu Wang¶ Guanjie Chen¶ Yifei Liu♣ Tao Xie§‡ Junhao Hu§‡ †Xiaohongshu Inc., China ‡Peking University ¶Huawei Cloud ♣Shanghai Jiao Tong University §Beijing Tongming Lake Information Technology Application Innovation Center

*Corresponding to: Yang Liu xiaoyi52@xiaohongshu.com or Zhaokai Luo luozhaokai@xiaohongshu.com github:https://github.com/rednote-machine-learning/RedKnot

Abstract

Multi-head latent attention (MLA) exposes many logical query heads through one packed latent KV stream. This representation is memory efficient, but it removes the physical per-head cache boundary assumed by conventional head-wise reuse. We present REDKNOT-MLA, a DeepSeek-V4 realization of RedKnot's head-aware reuse principle. Each immutable document is processed offline at canonical position zero; certified Local-head contributions are retained as MLA-Off. At serving time, query-side RoPE relocation restores the document's request position, a small Global-head set and protected Local token rows are recomputed as MLA-Online, and the two paths are merged before a single shared output projection. The packed MLA latent is never split. DeepSeek-V4-Flash uses 37 reusable layers and a 56/8 Local/Global partition, giving a 75.29% analytic logical head-row ceiling; the Pro-0813 profile uses 55 layers and 112/16 heads, giving 78.89%. Frozen Flash operating points show hot-artifact TTFT speedups of 2.02–3.84×. At 256K, the archived three-dataset study reports an aggregate F1 change of +3.24 percentage points, an EM change of +4.16 points, and a 78.7–79.5% analytic major-operator arithmetic saving, while one dataset decreases by 2.81 F1 points. A separate author-reported 256K hot-artifact QPS measurement is approximately 2.0×; because its raw concurrency trace is not included in this bundle, we mark it as preliminary rather than archived evidence. We describe the factorization, position repair, token-row closure, sparse-MoE support, TP8 integration, and the measurement boundaries needed to interpret these results.

1 Introduction

Non-prefix KV reuse can avoid repeatedly encoding retrieved documents in RAG and agentic workloads. CacheBlend [Yao et al., 2025], CacheSlide [Liu et al., 2026a], EPIC [Hu et al., 2025], and HYPIC [Liu et al., 2026c] repair or link cached segments after their context changes. RedKnot instead decomposes reuse at attention-head granularity: document-stable heads can be reused while request-sensitive heads remain online [Liu et al., 2026b]. Applying that idea to DeepSeek-V4 is not a mechanical port. MLA has many logical query heads but only one physical packed latent KV stream [DeepSeek-AI, 2024a,b, 2026]; manufacturing a physical cache per logical head would duplicate the latent state and defeat the native representation.

REDKNOT-MLA preserves the packed latent and fac-

torizes the logical-head output contribution. Local heads are evaluated per document at canonical position zero and stored as a projected offline artifact. The online request rotates queries into each document's canonical frame, evaluates one Global head per native output group, repairs selected Local token rows, and combines document segments with a stable segmented merge. A group-aligned sliced projection makes the Local and Global contributions additive before the shared second output projection. Indexer-guided token-row closure and a conservative adaptive MoE policy reduce the token-wide work that would otherwise remain after head reuse; they support, rather than replace, the defining multi-head decomposition.

Figure 1 gives the evidence-aware headline. It deliberately keeps four quantities separate. TTFT is an archived hot-artifact diagnostic; the 256K QPS bar is the author's approximately 2× result but its raw concurrency trace is not bundled; the compute bars are analytic ledgers rather than board-level achieved FLOPs; and the quality bars come from the paired three-dataset v6 study. These values therefore describe an attainable operating envelope, not one homogeneous scaling experiment.

The report makes four contributions:

  • an exact logical-head factorization that leaves MLA's physical packed latent KV representation unchanged;

  • canonical-position offline artifacts with online RoPE relocation, Global-head recomputation, and protected-row correction;

  • concrete Flash and Pro profiles plus fused prefetch, validation, and merge integration for an eight-GPU tensor-parallel runtime; and

  • a protocol-qualified evaluation that distinguishes measured latency and quality, preliminary QPS, and analytic compute accounting.