Architecture Evolution • 557 words • 3 min read

Kimi KDA, DeepSeek MLA and V4 CSA/HCA: Long-Context Cache and GPU Memory

Understand KDA recurrent state, MLA latent caches, and DeepSeek-V4 CSA/HCA sequence compression, with explicit memory formulas and reproducible measurement rules.

NOTE

Executive Summary (TL;DR)

  • Novel Attention Breakdown: Thorough analysis of Kimi K3's hybrid 69-layer KDA (Kimi Dynamic Attention) + 24-layer Gated MLA design, dispelling the myth of universal constant-state caching.
  • Memory Scaling Profiles: Blending recurrent linear state updates with gated attention achieves effective long-context recall while flattening linear KV Cache memory trajectories.
  • System Alignment: Pairs directly with DeepSeek MLA Matrix Absorption and Test-Time Reasoning Architectures.

Distinguish cache representations from model-wide behavior

MLA compresses each historical token's representation. KDA replaces a full historical cache in a recurrent layer with fixed-size state. DeepSeek-V4's CSA / HCA also compress the sequence dimension. These mechanisms need separate capacity, compute, and quality analysis.

1. A defined MHA / GQA baseline

TEXT
KV_bytes = 2 × batch × sequence_length × layers × kv_heads × head_dim × bytes_per_element

For batch=1, a KV hidden dimension of 2048, 80 layers, and FP16, each token needs 655,360 bytes: about 2.62GB at 4,000 tokens and 655.36GB at one million. These are decimal GB; divide bytes by 2^30 for GiB. The example is not a universal estimate for every large model.

2. DeepSeek-V2 / V3 MLA

MLA caches a low-dimensional latent representation and separate positional keys. Matrix absorption can avoid fully reconstructing historical multi-head K/V at every decode step. See MLA matrix absorption.

Cache still grows linearly with context. Its ratio depends on dimensions, layers, and precision. MLA is a trained architecture, not a lossless runtime switch for an arbitrary GQA checkpoint.

3. KDA states and the Kimi K3 hybrid

KDA includes gating, decay, and delta updates. S_t = S_(t-1) + ΔS_t is only an illustration. At fixed model dimensions, one recurrent layer has sequence-independent state size; distinguish per-token updates from total sequence processing.

The Kimi K3 model card specifies 69 KDA layers and 24 Gated MLA layers. The complete model therefore retains a context-dependent cache component. State snapshots, prefix reuse, and concurrency affect serving memory too; see prefix caching.

4. DeepSeek-V4 CSA and HCA

The DeepSeek-V4 model card names Compressed Sparse Attention and Heavily Compressed Attention. Sequence compression and sparse access require different accounting from V3 MLA's per-token latent cache. Use the checkpoint and engine's actual layout.

5. Design comparable measurements

AreaRequired controls
ModelExact revision, weight / cache formats, layer composition
ParallelismTP / PP / DP, cache replication and state sharding
WorkloadInput / output lengths, concurrency, shared prefixes, warm-up
CapacityPer-rank weights, activations, cache, communication, graphs
Quality and speedTTFT, TPOT, throughput at SLA, retrieval and citation accuracy

Without this information, numbers such as 8.6GB at 100K, 42GB at 1M, or 110 tokens/s are not reproducible benchmarks. Architectural claims require controlled workloads and quality checks. See the deployment guide.

Frequently Asked Questions (FAQ)

Q1: Do MLA or KDA eliminate all KV cache?

No. MLA keeps compressed history; recurrent KDA layers have fixed state, but K3's Gated MLA layers retain caches.

Q2: Can these architectures use lower precision?

It depends on model and backend. Weight quantization, KV precision, and recurrent-state precision are separate controls; test them separately. See the quantization guide.

Q3: Is KDA necessarily more accurate at retrieval?

No quality ranking follows from the recurrence alone. Measure matching tasks, sequence lengths, and reasoning budgets.

Related Articles

Start with the same topic, then continue with the latest deep dives.

Inside DeepSeek's Trillion-Token Engine: DeepInfer and deepseek-recipe Architecture from Silicon to Protocol Layer

From physical silicon foundations and kernel matrices to 1:1 PD disaggregation topologies, DSpark dynamic speculative decoding, SWA bounded replay, deepseek-recipe protocol layers, and $38/GPU/h unit economics: a complete architectural dissection of DeepSeek's production inference stack.

Evolution of High-Concurrency Batching: From Continuous Batching to Chunked Prefill Eliminating Head-of-Line Blocking

High-throughput LLM serving: Orca iteration-level continuous batching, head-of-line blocking mitigation, and Chunked Prefill with decode piggybacking in vLLM.

Evolution of Attention Kernels: From FlashAttention-1/2/3 SRAM Tiling to FlashInfer Unified Heterogeneous Serving

Deep dive into GPU attention kernels: FlashAttention-1 online softmax, FA-2 parallelism, FA-3 Hopper TMA asynchronous pipelines, and FlashInfer variable-length batching.

← Prev Evolving Models at Runtime: From Basic Reflection to MCTS-based Test-Time Compute Next → Beyond Simple Prompts: How Environment Scaling Is Reshaping Autonomous Agents in 2026
← Back to Articles