Introduction
The official rollout of DeepSeek V4.1 Flash has triggered widespread discussion within the large model community. Benchmark tests conducted by Artificial Analysis show that this new variant achieves scores surpassing DeepSeek V4 Pro, which carries 1.6 trillion parameters. The result has drawn significant attention: a model with only 552B main parameters can deliver stronger comprehensive performance than a much larger predecessor. DeepSeek itself has validated these findings and stated that V4.1 Flash will gradually replace V4 Pro for API traffic routing.
Artificial Analysis’s systematic evaluation also highlights notable improvements in intelligent agent capabilities and long-context reasoning. DeepSeek V4.1 Flash reaches 69% on the SWApAgentBench benchmark, outperforming GPT-6 Astra at 69% and Grok 4.6 at 67%. Its peak automation rate stands among the highest in the tested pool, with an Intelligence Index of 89K tokens. Despite the high token volume, the Intelligence Index cost is merely $0.27 per million tokens, thanks to its aggressive low-price positioning. Sebastian Raschka has commented that DeepSeek V4.1 Flash represents such meaningful innovation that it could reasonably be named DeepSeek V5.
This article unpacks the technical mechanisms behind DeepSeek V4.1 Flash. The core question is straightforward: how can a 552B-parameter “small model” outperform the 1.6T parameter V4 Pro? The analysis draws primarily from the official technical report titled *DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression*. The entire design revolves around a single central objective: maximize KV cache compression.
Core KV Cache Compression: The Foundation of V4.1-Flash
The first set of quantitative data demonstrates the compression scale achieved in this release. The global KV cache that permanently resides in HBM is compressed to roughly 890 tokens per GB, approximately one quarter of the footprint seen on V4.1 Flash. When compared with DeepSeek-V1’s 389,120 token per GB baseline, the gap expands to 437 times. Persistent KV cache, stored on SSD or host memory for prefix reuse, is reduced to around one eighth of the size required by V4-Flash.
The model architecture itself combines a 552B main parameter body plus a 196B parameter multilingual MoE block. It natively supports a 1 million token context window. It was pre-trained on 45T tokens of multimodal data. In the prefill stage, each token activates only 8B parameters, and the decode stage activates 16B parameters. These numbers form the true secret of the 552B model’s ability to compete against 1.6T scale models. For the same agent workload, the key metric is not total parameter count, but how many parameters are activated per token and how much data must be fetched from SSD during inference.
Sparse Attention: Storage and Data Movement Become New Bottlenecks
To understand DeepSeek’s focus on KV cache optimization, it is critical to recognize shifting bottlenecks in long-sequence workloads. From V3’s DSA to V4’s CSA, sparse attention has already optimized computation for long sequences. Prefill costs no longer rise linearly with context length. The real bottleneck has shifted to memory bandwidth and data transfer. For hours-long coding agent sessions, each tool call generates new tokens, and computation is no longer the limiting factor. Instead, memory capacity and data movement dominate latency and cost.
DeepSeek breaks this new bottleneck into three interacting constraints. HBM capacity caps how many KV cache pages can be loaded into GPU memory concurrently. SSA and SSD bandwidth define throughput limits for agent workloads. These three constraints together determine the maximum throughput and marginal cost of agent services. V4 already combined CSA and HCA for sequence and dimension compression. V4.1 Flash introduces CED, CSA2 and Bounded Replay, applying compression at all transformer layers simultaneously.
CED: Cutting Prefill Computation by Half
CED, or Causal Encoder-Decoder, selects and discards nearly half of the prefill computation.
DeepSeek V4.1-Flash retains a 40-layer language prefill pipeline but splits it evenly. The first 20 layers act as a Causal Encoder, and the latter 20 layers function as a Decoder. This asymmetric design explains the official specification: 8B activated parameters for input prefill, and 16B activated parameters during token generation.
The key to the 20-layer causal encoder lies in how KV cache is generated inside Transformer blocks. Within each layer, keys K and values V are computed from hidden states of the encoder. The KV cache produced by the first half of layers is sufficient for all subsequent decoder layers. For prefill processing, only the first 20 layers are required. The full global KV cache can be obtained at drastically reduced computational cost. When sequence length exceeds the window size, there is no requirement to recompute the full KV cache from scratch.
This idea builds upon the YOCO (You Only Cache Once) mechanism. CED enhances YOCO structurally. YOCO allows upper and lower layers to share one identical KV cache. CED instead allocates independent projection weights for each configuration. It preserves the “single-pass cache” property while expanding the effective context volume and depth.
There are tradeoffs. During sliding window inference, the model must still process n_win × L/2 tokens for SWA. For long-tail hidden states, DeepSeek adopts an approximate approach. Research shows the effective receptive field of SWA extends far beyond the theoretical n_win × L/2. The implementation only retains the last n_win tokens from the prompt for decoder layers. This optimization is named SWA Bounded Replay.
CSA2: Three Compression Dimensions Fully Bounded
CSA2, Compressed Sparse Attention 2, manages the storage footprint of KV cache. The report categorizes KV cache compression space into three multiplied dimensions: entry size, sequence dimension and layer dimension. Entry size compression is achieved by GQA to reduce KV heads and MLA to merge multiple latent entries. Sequence dimension compression stacks each token into one row, the method adopted by V4 CSA and HCA. Layer dimension compression shares KV cache across different layers.
Prior work including IndexCache, YOLO and HySparse only covers partial dimensions. IndexCache optimizes index computation rather than cache storage. YOLO enables global shared routing but keeps full KV cache. HySparse reuses sparse layer KV cache but retains complete attention. CSA2 is the first solution to bound all three dimensions at once.
CSA2 assigns each layer one of three static operating modes. In Full mode, the layer computes its own main KV and Top-K index, and uses the index to generate new Top-K selections. Reindex mode reuses previous layer KV and index, and recomputes Top-K selection for the current layer. Reuse mode directly inherits main KV and Top-K from prior layers and performs sparse attention without recalculating indexes.
Across all three modes, every layer preserves its own global Query and SWA KV cache. The expressive capacity between layers is not degraded. The detailed configuration is documented within the original technical paper.
FP4 and Bounded Replay: Precision and Deployment Optimization
Two further optimizations boost performance beyond architectural changes. The first upgrade is FP4 quantization applied to the main KV cache. Earlier V4 versions applied FP4 quantization only for index Q and K. V4.1 Flash extends FP4 compression to the main KV storage. The format is derived from E2M1, matching 16-bit E4M3 block scaling. It removes the two-stage hierarchical compression seen in NF4, and the report provides formal proof of stability.
The second optimization is Zero SWA Bounded Replay. SWA dependencies accumulate layer by layer. To reconstruct the L-th layer’s SWA KV cache, the system must replay L × n_win tokens. DeepSeek uses an approximation: only replay the most recent n_win tokens, where n_win is set to 128. The SWA cache is truncated at this boundary.
This approximation yields large deployment benefits. In V4, SWA KV cache was kept in persistent memory. The access pattern matched long-term caching. In V4.1-Flash, all SWA KV is evicted out of persistent storage and placed inside distributed DRAM assembled from local machine RAM. The TTL is just several minutes, relying on high throughput to serve most concurrent requests. Global KV remains stored on SSD, maintaining a minimum lifecycle of 72 hours. When global KV cache hits while SWA KV has expired, bounded replay regenerates the last n_win tokens. This turns catastrophic cache misses into cheap graceful degradation, and persistent KV memory consumption falls to roughly one eighth of V4-Flash.
The combined outcome of all these optimizations is substantial. Context length expands from 4K to 1M tokens, a 256x increase. Meanwhile, total token decode FLOPs rise by merely 25%.
Single-Pass mHC, Engram and DSpark
Readers familiar with DeepSeek’s prior technical releases will recognize Single-Pass mHC. This mechanism addresses training instability caused by large-scale MLP mixing. V4.1 Flash upgrades mHC into Single-Pass mode.
The original mHC implementation enforced hidden dimension constraints before mixed coefficients could be retrieved. This forced serial computation for coefficient prediction, kernel mixing and activation loading, doubling memory access overhead. The new version splits mixed coefficients per block. Each block consumes one block-sized mixed coefficient. Dependencies are eliminated, allowing three computation steps to run inside a single Mega kernel. Activation access reduces from (4n+4)d to (2n+2)d, cutting bandwidth in half. This kernel-level optimization delivers clear latency gains.
Engram is a conditional memory module jointly developed by DeepSeek and Peking University. It leverages N-gram hashing to implement static knowledge retrieval with O(1) complexity. It moves “memory” from expensive GPU HBM into affordable DRAM, freeing MoE layers to focus on pattern matching. V4.1 Flash introduces the official replica of Engram. Its 196B parameters are split into two modules on layer 1 and layer 14. Using 2,3,4 N-gram and eight hash heads, each index supports 2048 entries, with more than 16 million entries per hash head, storing variable-length prime numbers. During prefill and inference, retrieval fetches embeddings from host DRAM. The first prefetch directly overlaps with Transformer block computation, removing redundant causal constraints from the original Engram design.
DSpark is a speculative decoding block. It generates 128 token windows in parallel and outputs 50 candidate base logits. A lightweight Markov model predicts transitions between tokens. Another component estimates acceptance rates for token positions. A scheduler combines these signals to decide request length dynamically. Unlike V3, DSpark is trained separately during pre-training and only joins the main model during post-training without gradient backpropagation. It continuously refreshes the vocabulary and simultaneously accelerates both serving and RL rollout.
Two optimizer adjustments are also included. Q and K weights use head-wise Muon to handle heterogeneity between attention heads. Engram embedding tables, token embeddings and prediction heads adopt momentum-free Sinkhorn balancing instead of Adam. It requires only one momentum buffer and reduces optimizer state memory significantly.
These optimizations produce tangible runtime improvements. For most Reuse-mode layers, prefill only requires 15 kernels, and decode requires only 11 kernels.
Post-Training: No Revolutionary Algorithm Changes
DeepSeek explicitly states in the post-training chapter that this release introduces no novel post-training algorithms. The workflow remains standard SFT plus RL plus policy distillation, without breaking established practices. All modifications are applied to data pipelines.
One notable design change targets user workload classification. During training, the system maps effort values ranging from 1 to 100. When multiple samples compose one sub-task, the team uses direct visible rewards. The reasoning scaling coefficient is multiplied by 1/e. This lets identical weight parameters slide along the cost-quality curve. DeepSeek API exposes three tiers: max, high and low, corresponding to b=100,75,50. This explains the “longest model” observation from Artificial Analysis. The max tier sits at the far end of this scaling curve.
The report provides benchmark results: as effort increases from 25 to 100, average Pass@1 for eight reasoning-intensive benchmarks rises from 67.1% to 76.3%. DeepSeek SWE V1.1 improves from 66.0% to 74.2%. Terminal-2.1 gains from 82.4% to 90.6%, delivering roughly 2.5x the output tokens.
The return curve shows diminishing returns. The range 21–60 can deliver close to full accuracy with half the token budget. Raising effort from 80 to 100 extends agent trajectories by 1.6 to 1.8 times for only marginal accuracy improvement. The official recommendation reserves the max tier exclusively for the hardest tasks.
Conclusion
The most striking feature of V4.1 Flash is that three layers of optimizations align toward the same objective. At the architectural layer, CED eliminates half of prefill computation. CSA2 enables full three-dimensional KV cache reuse. At the precision layer, main KV is quantized down to FP4. At deployment layer, bounded replay moves SWA KV out of persistent memory. Any single optimization yields modest gains, but stacking them creates compound performance improvements.
DeepSeek has also open-sourced new code repositories for easier local deployment of V4.1 Flash and future sequence models. The released assets include deepseek-recipe, DeepSeek C++ inference engine, DeepSeek kernel library and DeepSeek tokenizer implementation. The kernel library delivers roughly 20x acceleration for TopK operations compared with prior implementations.
For teams building multi-model inference services, routing traffic between different large model variants adds operational complexity. 4sapi, an API gateway, can streamline unified authentication and load balancing when switching between DeepSeek model versions.
DeepSeek has also begun testing speech-to-text capabilities as an additional multimodal extension. The model’s compression framework demonstrates a new direction for large model engineering: rather than blindly scaling parameter count, optimizing memory access and cache compression can create smaller models that beat larger predecessors on agent and long-context tasks.
International access: https://4sapi.com
Domestic access: https://4sapi.cn




