hn.today

DeepSeek-v4.1 Flash: Pushing the Limits of KV Cache Compression

zartbot.github.io94 points7 comments
Screenshot of DeepSeek-v4.1 Flash: Pushing the Limits of KV Cache Compression

DeepSeek-V4.1 Flash is a 552B-parameter multimodal mixture-of-experts model engineered to aggressively compress key-value (KV) caches so long-horizon agent workflows can scale. It adopts a Causal Encoder-Decoder (CED) design where the decoder’s global KV derives from encoder final states, enabling only the first 20 of 40 layers to be active during prefill (8B activated parameters per token) and 16B during decoding. Compression comes from three orthogonal techniques: channel sharing via a 512-d latent KV, sequence-level merging in the encoder (two positions → one cache entry), and cross-layer KV reuse so the network holds only a few global KV copies (three encoder, one decoder). Combined with FP4 quantization and an optimized sparse-attention indexer (CSA2: sliding-window local attention + global sparse retrieval + cross-layer reuse), runtime KV storage falls to ~1/4 and persistent storage to ~1/8 of prior versions, with main KV + index growth around 890 bytes/token.

Architectural specifics include 40 layers (20 encoder/20 decoder), 64 heads at 512 head-dim, SWA window 128, RoPE/NoPE hybrid, MoE with 384 experts (top-6), and features like single-pass mHC, Engram conditional memory, DSpark speculative decoding, and a hierarchical sparse indexer. CSA2 uses full/reindex/reuse modes with indexed top-K candidate blocks; encoder/decoder compression ratios and index source layers are explicitly tuned for maximal KV reduction while preserving task quality and throughput.

Read on zartbot.github.io7 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in AI

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.