Inside the Causal Encoder-Decoder: how DeepSeek engineered away the KV cache tax
DeepSeek's real innovation here isn't a parameter-count flex, it's a structural rewrite of how a transformer spends compute on a long input versus a short output. V4.1-Flash organizes its 40 transformer layers into a 20-layer causal encoder followed by a 20-layer decoder; critically, the decoder's global KV cache is projected directly from the encoder's final hidden states rather than recomputed layer-by-layer inside the decoder itself [1]. That single choice, the Causal Encoder-Decoder (CED) architecture, is why the activation numbers look so lopsided: of a 552B-parameter backbone, only about 8B parameters activate during prefill (reading the prompt), rising to roughly 16B during decode (generating tokens), inside a 1M-token context window [2]. For a coding agent that spends most of its cycles re-reading a growing file tree, test output, and terminal logs rather than writing new code, that asymmetry maps almost exactly onto real workloads. DeepSeek layers on SWA Bounded Replay, which reconstructs sliding-window-attention KV states by replaying only the most recent tokens instead of persisting them to disk, plus a CSA2 attention-mode-sharing scheme; together they cut the persistent KV cache footprint to roughly one-eighth of DeepSeek-V4-Flash's and total serving memory to about one-quarter the HBM of the prior generation [3]. It reads like an infrastructure optimization dressed up as a model release, the payoff shows up in DeepSeek's own hosting margins as much as in any benchmark chart. Reception among AI researchers on X leaned admiring of the engineering itself: independent walkthroughs and side-by-side visualizations of the CED design circulated quickly, and Hugging Face co-founder Thomas Wolf called the release a return to the top of the open-weight leaderboard, praising how much efficiency DeepSeek had extracted without sacrificing capability.



