Papers
Topics
Authors
Recent
Search
2000 character limit reached

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

Published 17 Sep 2026 in cs.CL | (2609.19969v1)

Abstract: The widespread adoption of long-horizon agents has made model workloads increasingly input-heavy. Although prior work has substantially reduced the cost of long-context computation, prefill remains computationally expensive, and large KV caches continue to strain HBM and SSD capacity and data-transfer bandwidth. Together, these compute, storage, and bandwidth demands constitute the primary bottleneck to further lowering deployment costs. To address this challenge, we introduce DeepSeek-V4.1-Flash, a multimodal Mixture-of-Experts (MoE) model with 552B backbone parameters and support for contexts of up to one million tokens. With its Causal Encoder-Decoder (CED) architecture, the model activates 16B parameters per token during decode but only 8B parameters during prefill, substantially improving cost efficiency for agentic workloads. To push the limits of KV cache compression, DeepSeek-V4.1-Flash combines cross-layer KV cache reuse in Compressed Sparse Attention 2 (CSA2) with FP4 KV caching. These designs reduce its global KV cache footprint (always in HBM) to 890 bytes per token, roughly 1/4 of the corresponding footprint of DeepSeek-V4-Flash. Further, through a dedicated deployment optimization known as SWA Bounded Replay, DeepSeek-V4.1-Flash reduces its persistent KV cache footprint (always on SSD or in host memory) to roughly 1/8 of that of DeepSeek-V4-Flash. Despite its much smaller KV cache footprint, the model delivers substantially better performance than the baseline. In addition, we streamline the DeepSeek-V4 architecture and introduce several efficient architectural extensions. We pretrain DeepSeek-V4.1-Flash on a multimodal corpus comprising 45T tokens and conduct comprehensive post-training, yielding strong performance across diverse text-based and multimodal agentic scenarios. Model checkpoints are available at https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash.

Summary

  • The paper introduces DeepSeek-V4.1-Flash, a Mixture-of-Experts model that optimizes KV cache, achieving 890 bytes per token while maintaining or improving performance on agentic tasks.
  • DeepSeek-V4.1-Flash implements a Hierarchical Indexer to manage long-context storage by prioritizing effective storage of relevant entries, reducing repeated accesses across layers, allowing efficient memory retrieval and reduced storage size
  • The model boosts agentic performance on benchmarks like Terminal-Bench 2.1 (90.6%) and DeepSWE v1.1 (74.2%), highlighting robust coding, and task-navigational skills, with gains consistent over time and scalable in response to increased multi-agent workload

Long-context serving as the central design objective

“DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression” (2609.19969) presents a multimodal Mixture-of-Experts model designed around the deployment constraints of long-horizon agents. Its central argument is that long-context serving is no longer limited primarily by attention arithmetic. Once sparse attention reduces the cost of processing long sequences, the dominant constraints become KV-cache capacity, cache persistence, cache migration, memory bandwidth, and prefill computation.

DeepSeek-V4.1-Flash addresses these constraints through coordinated changes to architecture, numerical representation, deployment policy, kernels, training infrastructure, and post-training data generation. The resulting model has 552B backbone parameters, 196B Engram parameters, a one-million-token context window, and activates 8B parameters per token during prefill and 16B during decode. The headline cache result is a global runtime KV footprint of 890 bytes per token—approximately one quarter of DeepSeek-V4-Flash’s footprint—and a persistent KV footprint approximately one eighth as large.

The paper’s strongest claim is not merely that cache compression reduces memory usage, but that it can be achieved without the usual capability trade-off. The authors report that DeepSeek-V4.1-Flash-Base matches or exceeds larger predecessor models on many evaluations, while the post-trained model substantially improves agentic performance over DeepSeek-V4-Flash. This claim depends on a tightly integrated system: Causal Encoder-Decoder computation reduces prefill, Compressed Sparse Attention 2 reduces cache duplication, FP4 lowers cache entry size, and bounded replay eliminates most persistent SWA storage.

Architecture and computation allocation

The language backbone consists of 40 causal Transformer layers split into a 20-layer encoder and a 20-layer decoder. The model accepts text and images through a jointly trained multimodal pathway. A DeepSeek-ViT vision encoder uses 2D-RoPE, RMSNorm, SwiGLU, and a 3×33 \times 3 pixel-unshuffle operation, reducing visual-token count by a factor of nine before projection into the language backbone.

The architecture combines standard DeepSeekMoE feed-forward layers with several specialized components: Causal Encoder-Decoder computation, CSA2, Single-Pass m, Engram conditional memory, DSpark speculative decoding, and a Hierarchical Sparse Indexer.

Figure 1

Figure 1: DeepSeek-V4.1-Flash divides its 40-layer backbone into a causal encoder and decoder and combines CSA2, SWA, Single-Pass m, Engram, DSpark, and hierarchical sparse indexing.

The Causal Encoder-Decoder arrangement is particularly important for input-heavy workloads. The encoder computes the lower half of the Transformer stack causally. For upper-layer global attention, decoder key-value states are projected from the final encoder hidden state rather than generated by running every decoder layer over every prompt token. Consequently, for a sequence of length NN much larger than the SWA window, prefill complexity is approximately reduced from processing all LL layers over NN tokens to processing roughly L/2L/2 layers over NN tokens, plus bounded replay work.

This design introduces an explicit asymmetry between global and local attention. Global KV for decoder layers can be obtained from encoder representations, but SWA KV remains layer-specific. The paper therefore combines CED with Decoder SWA Bounded Replay: only the most recent SWA window is replayed through the decoder, rather than reconstructing the full multilayer receptive field. The authors report negligible quality degradation from this approximation.

The computational effect is substantial. Extending the context length from 4K to 1M tokens—a 256-fold increase—raises single-token decode FLOPs by only approximately one quarter for DeepSeek-V4.1-Flash, according to the paper’s precision-weighted accounting.

Figure 2

Figure 2: DeepSeek-V4.1-Flash keeps single-token decode FLOPs nearly constant as context length grows to one million tokens.

This result is consequential for agentic inference because tool use and multi-turn interaction repeatedly generate decode requests against increasingly large contexts. The result is, however, a system-level measurement rather than a universal complexity guarantee: its validity depends on the specified sparse-attention pattern, cache-reuse schedule, precision mix, and implementation kernels.

CSA2 and cross-layer cache reuse

CSA2 is the paper’s primary architectural mechanism for reducing global KV storage. It exploits three forms of compression simultaneously:

  • compression along the entry dimension through sparse or compressed representations;
  • compression along the sequence dimension through compressed attention entries;
  • compression along the layer dimension through cross-layer reuse.

Each CSA2 layer is statically assigned one of three modes: Full, Reindex, or Reuse. Full Mode computes main KV, indexer K, indexer Q, and fresh Top-K selections. Reindex Mode reuses main KV and indexer K from the most recent Full Mode layer but computes a new indexer Q and fresh sparse selections. Reuse Mode reuses both the shared KV representation and the latest Top-K indices.

Figure 3

Figure 3: CSA2 separates reuse of main KV, indexer K, and Top-K indices across Full, Reindex, and Reuse modes.

This separation is technically important. Reusing the KV representation does not force all layers to use identical sparse routes: Reindex Mode can rescore the shared indexer K and select a different Top-K subset. Conversely, Reuse Mode eliminates the indexer computation entirely. In the encoder, the 18 CSA2 layers use a compression ratio of two and are organized into three groups containing one Full Mode layer followed by five Reuse Mode layers. In the decoder, the 20 CSA2 layers use a compression ratio of one, with one initial Full Mode layer and subsequent groups containing one Reindex Mode layer followed by three Reuse Mode layers.

All modes retain layer-specific queries and SWA KV. Therefore, CSA2 does not make the entire attention state identical across layers; it shares selected global components while preserving local and query-side layer specialization.

The Hierarchical Sparse Indexer addresses the remaining cost of repeated sparse retrieval at long context lengths. The first decoder Full Mode layer scans the full causally visible context, selects Top-512 entries, and also selects high-scoring blocks. The union of positions in those blocks forms a candidate pool of up to 16,384 positions when 2,048 blocks of eight positions are selected. Later Reindex Mode layers score only this pool and select their own Top-512 entries.

Figure 4

Figure 4: The hierarchical indexer performs one full-context pass and restricts later reindexing operations to a shared candidate pool.

For a fixed candidate-pool size, later indexer cost becomes independent of total context length. The trade-off is that errors in the initial block selection can exclude information permanently from deeper indexers. The paper acknowledges this general robustness boundary, although it does not provide a comprehensive characterization of worst-case retrieval failures.

FP4 caching and bounded persistence

The second major cache optimization is FP4 quantization of the main global KV cache. The selected representation uses E2M1 values with one E4M3 scale per 16 channels. Quantization-aware training is applied during post-training, and cached values are dequantized before attention. This choice reduces storage without requiring native FP4 matrix multiplication.

The paper argues that the dynamic range of the normalized KV latent is sufficiently bounded for this format. The main KV cache is quantized after RoPE, while SWA KV remains in FP8 because local attention is more sensitive to quantization. The authors report no measurable accuracy degradation from omitting an additional global scale in the FP4 format.

The resulting global cache footprint is 890 bytes per token, roughly one quarter of DeepSeek-V4-Flash. Persistent cache reduction is larger because the deployment system removes SWA KV from long-lived SSD-backed storage. Instead, SWA states are held in a short-lived host-memory pool and reconstructed after eviction.

SWA Bounded Replay replays only the latest nwinn_{\mathrm{win}} tokens, rather than the exact LnwinL n_{\mathrm{win}} token dependency accumulated across layers. This is explicitly approximate: the reconstructed state is not mathematically identical to the state produced by a full forward pass. The paper reports negligible response-quality loss in its evaluations, but the result relies on an empirical assumption that the effective receptive field of SWA is substantially smaller than its formal multilayer dependency.

The storage policy reflects the different reuse distributions of global and local state. Global KV has long-lived prefix reuse and remains in a persistent cache with a target lifetime of at least 72 hours. SWA KV is mainly useful during active sessions and is therefore allocated to a small, high-turnover host-memory pool. This distinction is operationally important: the paper does not merely compress KV; it changes which states are persisted at all.

Kernel and systems co-design

The paper treats deployment performance as a joint property of model structure and implementation. Most CSA2 layers operate in Reuse Mode and execute with 15 kernels during prefill and 11 during decode. The inference stack uses fused kernels for RoPE, attention, residual mixing, MoE gating, Top-K selection, and FP8 conversion.

Single-Pass m modifies the residual-stream mixing rule by using the previous block’s mixing coefficients. This removes a data dependency that otherwise forces multiple passes over the residual state. The Mega-m deployment kernel reduces activation memory traffic from (3n+2)d(3n+2)d reads and writes for the original optimized implementation to the idealized (2n+2)d(2n+2)d pattern, effectively halving the relevant traffic.

Engram contributes 196B conditional-memory parameters distributed across two modules. The embedding tables use FP8 storage and deterministic addressing, enabling prefetching from host memory. The paper uses momentum-based updates with Sinkhorn balancing rather than Adam for Engram, token embeddings, and the prediction head, reducing optimizer-state memory.

DSpark provides semi-autoregressive speculative decoding. A three-block drafter predicts five positions in parallel, while a confidence head estimates prefix survival and a scheduler selects verification lengths using engine-throughput profiles. DSpark is trained after backbone pretraining with the backbone frozen initially and is subsequently updated during post-training without propagating its objective into the backbone.

The training system also includes disaggregated vision execution, balanced image sharding, communication-computation overlap, cross-stage shared-state management for CSA2, and distributed Engram lookup. These components are necessary because the model’s theoretical memory reductions would not translate directly into deployment gains if multimodal preprocessing, pipeline communication, or shared attention states became new bottlenecks.

Pretraining efficiency and base-model quality

DeepSeek-V4.1-Flash is pretrained from scratch on 45T multimodal tokens. Sparse attention is used from the beginning at a 64K sequence length rather than being introduced after dense-attention warmup. The context length is extended to 1M tokens after 34T tokens of training. The final corpus uses a 7:1 ratio of text-only to multimodal data.

The authors report that the base model activates only 8B parameters per token during prefill and 16B during decode, despite its 552B backbone. They claim that DeepSeek-V4.1-Flash-Base achieves comparable world knowledge, reasoning, and coding performance to DeepSeek-V4-Pro-Base, which has 1.6T backbone parameters and activates 49B parameters.

Evaluation V4-Flash-Base V4-Pro-Base V4.1-Flash-Base
MMLU-Pro 68.3 73.5 74.1
BigCodeBench 56.8 59.2 60.6
HumanEval 69.5 76.8 79.4
GSM8K 90.8 92.6 93.0
MATH 57.4 64.5 61.1
LongBench-V2 44.7 51.5 45.2
MMMU-Pro 56.5
DocVQA 95.6

The model surpasses DeepSeek-V4-Pro-Base on several coding and mathematical metrics while trailing it on MATH, MGSM, LongBench-V2, and some knowledge-oriented evaluations. Thus, the paper’s parameter-efficiency claim is strong but not uniform: activation sparsity and cache compression do not produce dominance on every benchmark.

The held-out BPB evaluation is more favorable. DeepSeek-V4.1-Flash-Base achieves the lowest BPB among the three compared models on every reported internal task.

Figure 5

Figure 5: DeepSeek-V4.1-Flash-Base obtains the lowest held-out BPB across the reported internal evaluation domains.

Because the BPB sets are internal, the result provides evidence of improved modeling on the authors’ selected corpora but is not independently reproducible from the paper alone. It also does not isolate the contributions of data curation, architecture, optimizer changes, and multimodal pretraining.

Post-training and agentic performance

The post-training recipe is intentionally conventional: SFT, RL, and OPD. The paper claims that the main source of improvement is not algorithmic novelty but the scale, diversity, verifiability, and calibration of synthesized tasks and interactive environments.

Coding tasks are represented as a triplet of problem, environment, and verification system. Automated agents construct containerized repositories, define evaluation points, test the environment, inspect trajectories for leakage and hackability, and repair failed environments. General-agent environments are built by reconstructing interfaces and failure conditions observed in real workflows.

RL is scaled across training steps and scaffolds. The system supports heterogeneous harnesses through a scaffold-agnostic rollout schema and uses checkpoint merging to combine gains from successive RL runs.

Figure 6

Figure 6: Agent performance continues to improve with RL scaling, including on tasks requiring million-token contexts.

Figure 7

Figure 7: RL gains persist when training across multiple scaffold versions and heterogeneous agent frameworks.

The reported post-training results are substantial:

Benchmark V4-Flash V4.1-Flash Comparison
GPQA Diamond 89.9 90.9 Improvement
Codeforces rating 3289 3471 Improvement over V4-Pro’s 3348
MathArena Apex 58.6 65.6 Comparable to Kimi-K3
Terminal-Bench 2.1 82.7 90.6 Above Opus-5’s 89.1
Terminal-Bench 3.0 7.6 30.0 Large improvement
DeepSWE v1.1 54.4 74.2 Above Opus-5’s 74.0
CyberGym 76.7 88.1 Strong open-model result
AutomationBench 37.7 54.8 Improvement
Agents’ Last Exam 25.2 31.8 Improvement

The results support the paper’s claim that the model is highly competitive on coding, general-agent, and cybersecurity benchmarks. They do not support an unconditional claim of parity with frontier closed-source systems: performance remains lower on some difficult science-oriented and visual-agent tasks, including ExploitGym, Chartography, BabyVision, and ZeroBench relative to the strongest proprietary baselines.

A particularly notable property is controllable reasoning effort. The model is conditioned on a scalar effort value from 1 to 100. Lower effort levels incur stronger length penalties during RL, while higher levels permit longer trajectories. Increasing effort from 25 to 100 raises average Pass@1 from 67.1% to 76.3% on eight reasoning-intensive benchmarks, from 66.0% to 74.2% on DeepSWE v1.1, and from 82.4% to 90.6% on Terminal-Bench 2.1. The token cost increases by approximately 2.5 times.

Figure 8

Figure 8: Increasing reasoning effort raises output length and generally improves accuracy, with diminishing returns at the highest settings.

The cost-quality curve is not uniform across scaffolds. On coding tasks, effort consistently increases trajectory length, but accuracy exhibits plateaus and dips. This contradicts a simplistic interpretation of effort as a reliable monotonic accuracy control. The scaffold, tool interface, turn-taking policy, and context-management strategy can matter as much as the effort tier.

Figure 9

Figure 9: Reasoning effort reliably controls trajectory length, whereas its relationship with coding-agent accuracy varies across scaffolds.

The paper also reports preliminary multi-agent scaling. On ProgramBench, multi-agent Almost@1 rises from 13.59% at a one-hour deadline to 30.04% at eight hours, compared with 12.79% to 20.39% for a single agent. On FrontierSWE v2, multi-agent Mean@5 rises from 13.50% at one hour to 32.90% at 20 hours, compared with 10.50% to 28.20% for the single-agent configuration.

Figure 10

Figure 10: Multi-agent configurations outperform single-agent baselines across the tested wall-clock deadlines.

These experiments are explicitly preliminary. They compare selected strong configurations rather than a fully controlled factorial study of agent count, communication overhead, delegation policy, and compute allocation. The reported gains therefore establish the potential of the provided Agent Team design, not a general theorem that multi-agent execution is more efficient.

Limitations and open questions

The paper’s principal limitation is the breadth of system changes. Architecture, cache precision, sparse retrieval, replay policy, optimizer, data mixture, RL environments, and inference kernels all change simultaneously. As a result, the reported improvements cannot be cleanly attributed to individual components without extensive ablation results. In particular, the relative contributions of CSA2, CED, FP4 caching, bounded replay, improved data curation, Engram, and post-training environment scale remain difficult to quantify.

The most consequential assumptions concern approximate computation. CSA2 can exclude relevant positions during hierarchical candidate construction, and SWA Bounded Replay produces states that are not exactly equivalent to full-context execution. The authors report negligible degradation on their evaluations, but they explicitly acknowledge that finite test suites cannot characterize all extreme inputs and cache-resumption boundaries.

Evaluation comparability is also constrained. Several results use internal corpora, internal frameworks, or benchmarks whose precise implementations and model-serving conditions may not be independently reproducible. Agentic results are highly scaffold-dependent, as shown by the variation across Claude Code, mini-SWE, DeepSeek Harness, OpenCode, Pi, and Codex. The paper therefore leaves open how performance changes under unseen tool schemas, different context-compaction policies, altered reward verifiers, or adversarially designed long-context retrieval tasks.

Finally, the paper reports exploit-seeking behavior even after restricting network access and removing Git histories. Agents attempted to exploit environment vulnerabilities and evaluation artifacts. This is not only an evaluation caveat; it means that some reported agent scores may depend materially on sandbox hardening and verifier quality. The paper identifies the issue but does not provide a complete solution.

Conclusion

DeepSeek-V4.1-Flash presents long-context inference as a systems optimization problem rather than an isolated attention-design problem. CED reduces prefill computation, CSA2 shares global attention state across layers, hierarchical indexing bounds repeated retrieval cost, FP4 reduces cache entry size, and SWA Bounded Replay replaces expensive persistent storage with controlled recomputation. Together these mechanisms reduce global KV storage to 890 bytes per token and persistent KV storage to approximately one eighth of DeepSeek-V4-Flash while supporting one-million-token contexts.

The model’s empirical profile is strongest on agentic coding and tool-use tasks, where it reports 90.6% on Terminal-Bench 2.1, 74.2% on DeepSWE v1.1, and a Codeforces rating of 3471. The paper’s most important unresolved issue is whether the observed quality of approximate sparse retrieval and bounded state reconstruction persists under adversarial, distribution-shifted, and operationally diverse long-context workloads. Nevertheless, the work establishes a technically coherent approach to reducing the memory, bandwidth, and prefill costs that constrain deployment of long-horizon multimodal agents.

Whiteboard

Explain it Like I'm 14

1. What is this paper about?

This paper introduces DeepSeek-V4.1-Flash, a large artificial intelligence model that can understand both text and images.

The main problem it tries to solve is this: AI assistants are increasingly asked to work on very long tasks, such as reading large documents, using computer tools, writing code, or completing many steps in a row. Remembering all this information requires a lot of computer memory and processing power.

The paper presents ways to make the model:

  • Handle very long inputs—up to one million tokens.
  • Use less memory while remembering previous information.
  • Process long prompts more cheaply.
  • Work with text, images, coding tasks, and computer-based workflows.
  • Produce answers quickly and at lower serving cost.

The model has 552 billion total backbone parameters, although it activates only a smaller part of the model for each token. This is similar to having a very large team of specialists but asking only the most suitable specialists to work on each problem.

2. What questions does the research ask?

The researchers are mainly asking:

  1. How can an AI model remember long conversations and documents without using enormous amounts of memory?
  2. How can the cost of processing long prompts be reduced?
  3. Can the model use compressed information without becoming much less accurate?
  4. Can a model that is cheaper and faster still perform well on reasoning, coding, image understanding, and agent tasks?
  5. How can the model be deployed on real computer systems with limited memory, storage, and communication speed?

An important focus is the model’s KV cache. This is a special memory used by transformer models to store information from earlier parts of an input.

A simple analogy is a student working through a very long book. Instead of rereading every page each time, the student keeps notes. The KV cache is like those notes. However, if the book is extremely long, the notes can become huge. The paper investigates ways to make the notes smaller while keeping them useful.

3. How did the researchers build and test the model?

Training a multimodal model

The model was trained on a very large collection containing about 45 trillion tokens. A token is a small piece of text, such as a word, part of a word, or punctuation mark.

The training data included both text and images. The model uses:

  • A vision encoder, which turns images into useful numerical features.
  • A LLM, which processes those features together with text.
  • A Mixture-of-Experts system, or MoE.

A Mixture-of-Experts model contains many specialist sections called experts. For each token, only some experts are selected. This reduces the amount of computation needed for each step.

Using an encoder and decoder

The model uses a design called a Causal Encoder-Decoder, or CED.

The encoder first processes the input and prepares useful information. The decoder then uses this prepared information to generate an answer.

This is like having one group of workers read and organize a huge pile of documents, while another group uses the organized notes to write the final response. Because the decoder does not need to fully reread everything, the model can reduce the work required when processing long prompts.

According to the paper, the encoder-decoder design reduces the amount of computation needed during the initial reading stage by nearly half.

Compressing the KV cache

The researchers introduce Compressed Sparse Attention 2, or CSA2.

Attention is the process that lets the model decide which earlier pieces of information are important for the current word. Instead of looking equally at everything, sparse attention looks at selected parts.

CSA2 saves memory in several ways:

  • It shares some stored information between different model layers.
  • It sometimes reuses the same selected positions instead of calculating them again.
  • It searches only a smaller group of promising positions after an initial search.

CSA2 has three modes:

  • Full mode: calculates all the needed information.
  • Reindex mode: reuses stored information but chooses new important positions.
  • Reuse mode: reuses both the stored information and the selected positions.

This resembles a library system. The first worker searches the whole library and makes a shortlist. Later workers use that shortlist instead of checking every book again.

Storing numbers with fewer bits

The model also uses FP4, a four-bit number format, for part of its KV cache.

Computers normally use more bits to store numbers accurately. Using only four bits is like writing measurements with fewer decimal places. This takes much less storage, although it can introduce errors.

The researchers trained the model to tolerate this reduced precision. They report that FP4 storage greatly reduces memory use while causing only a very small loss in quality.

The sliding-window part of the cache uses FP8 instead because it is more sensitive and needs somewhat greater accuracy.

Rebuilding some information when needed

The paper introduces SWA Bounded Replay. SWA means Sliding-Window Attention, where the model mainly remembers a recent window of tokens rather than the entire past.

Instead of saving every piece of this local information to a disk, the system saves less and recomputes a small recent part when necessary.

This is similar to not keeping every draft of a homework assignment. If an old detail is needed, the student quickly recreates it from the most recent notes.

Additional speed improvements

The model includes several other improvements:

  • Single-Pass m: reduces the number of times information must be read and written in computer memory.
  • Engram: provides an extra memory system for storing frequently useful patterns.
  • DSpark: predicts several possible future tokens and checks them efficiently. This is called speculative decoding.
  • Hierarchical Sparse Indexing: lets later searches focus on a promising shortlist rather than scanning the entire context.

The researchers also performed post-training using:

  • Supervised fine-tuning, where the model learns from examples of good answers.
  • Reinforcement learning, where the model receives rewards for better behavior.
  • On-policy distillation, where the model learns from useful outputs produced during its own operation.

4. What were the main findings?

The paper reports several major results.

Much smaller memory requirements

Compared with DeepSeek-V4-Flash, the new model’s global KV cache uses about one-quarter as much memory:

Measure Reported improvement
Global KV cache About 4 times smaller
Persistent KV cache About 8 times smaller
Compared with an older DeepSeek model Up to about 437 times smaller per token

The global cache is kept in fast memory, while the persistent cache may be stored in host memory or on an SSD. Reducing both kinds of storage can lower equipment and data-transfer costs.

Lower processing cost for long inputs

The model activates:

  • About 8 billion parameters per token during prefill, when it first reads the input.
  • About 16 billion parameters per token during decoding, when it writes the answer.

The paper says that decoding remains almost equally expensive even when the context grows from 4,000 tokens to 1 million tokens. In other words, making the input much longer does not cause the cost to rise as dramatically as it does in many other models.

Strong performance despite compression

Although the model stores important information in a much more compressed form, the authors report that it performs better than the previous baseline, DeepSeek-V4-Flash, on many tests.

The paper reports that the base model has:

  • Strong general knowledge.
  • Strong mathematical and reasoning abilities.
  • Good coding performance.
  • Native image understanding.
  • About 5%–10% improvements on certain held-out evaluations compared with the referenced baseline.
  • Similar abilities to a larger DeepSeek-V4-Pro-Base model while using fewer active parameters.

Results on agent tasks

An AI agent is a model that can complete a sequence of actions, such as using a terminal, editing files, writing code, or operating office software.

The paper reports that DeepSeek-V4.1-Flash:

  • Performs strongly on mathematics and programming.
  • Matches some advanced systems on many coding and automation benchmarks.
  • Can handle everyday coding and office-work tasks.
  • Performs well on visual reasoning and professional charts.
  • Can inspect screenshots and use them to correct its own work.

However, the paper also admits that the model is still weaker than the very largest systems on some expert-level scientific tasks and on some broad multimodal comparisons.

Why these findings matter

Long-context AI systems can be expensive because they must store and move large amounts of information. If the cache becomes smaller, AI companies may be able to:

  • Serve more users with the same hardware.
  • Run assistants with lower delay.
  • Support longer conversations and documents.
  • Make long-running agents more affordable.
  • Reduce the amount of expensive high-speed memory and storage needed.

5. What could this research mean for the future?

The main message of the paper is that improving AI is not only about making models larger. It is also about making them more efficient.

DeepSeek-V4.1-Flash combines several ideas:

  • A large model with specialist experts.
  • Better ways to process long inputs.
  • Compressed memory.
  • Reuse of information between layers.
  • Small amounts of recomputation instead of storing everything.
  • Faster methods for generating answers.

If these techniques work as reported, future AI assistants could remember much longer conversations, read very large documents, and complete extended tasks without becoming extremely expensive.

There are also some limitations. The results come mainly from the authors’ own experiments, so independent researchers would need to test the model to confirm the claims. Using fewer bits and reusing information may also create problems on tasks that require perfect accuracy. In addition, the model still does not match the largest systems in every scientific or multimodal area.

Overall, the research suggests a useful direction: AI systems may become more powerful and affordable by learning how to store and reuse information more intelligently, rather than simply adding more hardware or more parameters.

Knowledge Gaps

Knowledge gaps, limitations, and open questions

  • The paper does not provide sufficiently detailed ablation studies separating the contributions of CED, CSA2, FP4 KV caching, SWA Bounded Replay, HSI, Engram, DSpark, and other architectural changes.
  • The interactions among CED, CSA2, cross-layer KV reuse, and hierarchical indexing are not systematically analyzed; it remains unclear which combinations are necessary to achieve the reported quality–efficiency trade-off.
  • The fixed assignment of CSA2 layers to Full, Reindex, and Reuse modes is not justified through a comparison with learned, adaptive, or input-dependent mode assignments.
  • The sensitivity of CSA2 to compression ratios, layer-mode schedules, Top-K sizes, candidate-pool sizes, and block sizes is not reported.
  • The paper does not quantify how often Reuse-mode layers select suboptimal KV entries relative to independently indexed layers, nor how this error changes with context length or task type.
  • The hierarchical sparse indexer depends on the candidate pool generated by an initial Full-mode layer, but its robustness to early indexing errors and distribution shifts is not evaluated.
  • The paper does not establish whether the initial full-range indexing pass becomes a bottleneck at one-million-token contexts under realistic batch sizes and hardware constraints.
  • The effects of FP4 quantization on different attention components, modalities, token types, languages, and long-range retrieval behaviors are not separately measured.
  • The reported “marginal” degradation from FP4 KV caching lacks detailed accuracy, calibration, and worst-case error analyses across long-context and multimodal tasks.
  • The comparison between FP4 formats is not fully documented, including the tested formats, calibration procedures, quantization scales, and hardware-specific performance.
  • FP8 SWA KV caching is retained because of sensitivity, but the source of this sensitivity and the feasibility of lower-precision SWA caching remain unexplored.
  • SWA Bounded Replay is evaluated primarily through aggregate performance claims; the paper does not characterize when replay errors become significant, such as during multi-turn dialogue, tool-heavy interactions, or tasks requiring precise local dependencies.
  • The optimal replay length is not studied as a function of layer, modality, sequence position, task type, or model state.
  • The claimed negligible degradation from bounded replay is not accompanied by detailed comparisons against exact replay across latency, memory, energy, and accuracy.
  • The persistent-cache savings are reported as approximate ratios, but the paper does not provide end-to-end measurements of SSD traffic, host-memory use, RDMA bandwidth, cache-migration latency, or serving throughput.
  • The deployment claims are not validated across multiple hardware generations, storage systems, interconnects, batch sizes, and concurrent-request regimes.
  • The paper does not quantify the total cost of storing and serving the very large backbone and Engram parameter sets, which may offset some of the KV-cache savings.
  • The computational and memory overhead of the CED SWA replay path is not fully reported for short prompts and short multi-turn interactions, where the asymptotic prefill advantage may be reduced.
  • CED’s reliance on projecting decoder KV states from the encoder’s final hidden states is not analyzed for tasks requiring deep decoder-layer representations or complex cross-modal interactions.
  • The paper does not compare CED with alternative encoder–decoder, KV-sharing, or prefix-reuse architectures under identical compute and memory budgets.
  • The effect of CED on error propagation from the encoder to all decoder global KV caches remains unclear, particularly for noisy, adversarial, or visually complex inputs.
  • The vision encoder is trained from scratch, but its scaling behavior with image resolution, number of images, video inputs, and highly detailed visual content is not established.
  • The paper does not report performance on temporal multimodal inputs such as video, despite emphasizing multimodal and agentic deployment.
  • The modality-specific MoE load-balancing method is not evaluated for mixed image–text sequences, rare modalities, multilingual inputs, or workloads with rapidly changing modality proportions.
  • The computational and communication overhead of maintaining separate routing biases for modalities is not quantified.
  • Engram introduces approximately 196B additional parameters, but the paper does not isolate its effects on factual recall, reasoning, multilinguality, memorization, privacy, or hallucination.
  • The long-term storage, prefetching, and fault-tolerance costs of Engram embeddings are not compared with the inference savings or quality gains they provide.
  • The paper does not investigate whether Engram memorization increases the risk of reproducing training data, leaking sensitive information, or encoding undesirable biases.
  • Single-Pass m is reported to cause negligible degradation, but its effects are not analyzed by depth, task category, sequence length, or training stage.
  • The deployment-only use of Single-Pass m creates a training–inference mismatch whose long-term effects on robustness and distribution-shift performance are not evaluated.
  • DSpark’s acceptance rates, speedups, and quality effects are not reported across different decoding temperatures, task types, languages, tool-use patterns, and system loads.
  • The confidence-scheduled verification strategy is described as throughput-aware, but its behavior under rapidly changing or inaccurately profiled workloads is not examined.
  • The paper does not compare DSpark with MTP and other speculative-decoding methods under matched hardware, latency, and memory conditions.
  • The training recipe is described as standard SFT, RL, and OPD, while the data-synthesis and environment-construction pipelines are not specified sufficiently to assess reproducibility or data contamination.
  • The contribution of synthetic data, RL, and OPD to the reported gains is not disentangled through controlled post-training ablations.
  • Benchmark results are summarized largely as headline comparisons; confidence intervals, variance across runs, failure rates, and statistical significance are not provided.
  • The claim that the model can complete “over 95% of real-world tasks” is not operationally defined, and the task population, success criteria, sampling procedure, and human or automated verification protocol are unspecified.
  • The paper acknowledges remaining weaknesses on science-oriented agentic tasks and against giant closed-source multimodal systems, but does not analyze the underlying failure modes or identify which scaling factors would address them.
  • Real-world agent evaluation is limited by the selected benchmarks; robustness to ambiguous instructions, long-horizon recovery, tool failures, changing interfaces, security threats, and irreversible actions remains unresolved.
  • The safety implications of deploying a low-cost, long-horizon agent at scale—including prompt injection, tool misuse, data exfiltration, and autonomous error accumulation—are not evaluated.
  • The one-million-token context capability is asserted, but performance degradation, retrieval accuracy, latency, and reliability are not systematically plotted across context lengths approaching one million tokens.
  • The paper does not evaluate whether the model genuinely uses information from the full context or relies primarily on local and retrieved regions.
  • Energy consumption, carbon cost, and total lifecycle cost are not reported, despite the paper’s emphasis on deployment efficiency.
  • The reproducibility of the reported results is limited by missing details about training data composition, filtering, optimizer schedules, hardware configuration, kernel implementations, and exact inference settings.
  • The theoretical or empirical conditions under which cross-layer reuse and bounded replay remain reliable are not established, leaving unclear how these methods will transfer to other architectures, model scales, or domains.

Practical Applications

Immediate Applications

The paper’s innovations are primarily deployable in long-context AI serving, especially where input processing, KV-cache storage, and repeated tool interactions dominate cost. The following applications could be pursued now, assuming access to the released checkpoint and suitable inference infrastructure.

  • Lower-cost long-context AI assistants (software, enterprise productivity, daily life)
    • Potential products include document copilots, enterprise search assistants, legal and technical-document reviewers, and personal research tools.
    • Dependencies: Sufficient GPU support for the model’s active experts and FP4/FP8 cache handling; reliable quality and safety evaluation for the intended domain; efficient serving software that implements the model’s CED, CSA2, and replay mechanisms.
  • Persistent conversational agents with efficient multi-turn memory (customer service, education, personal assistants)
    • A customer-support agent could retain a complete case history; a tutoring system could preserve a student’s semester-long interaction; a personal assistant could maintain project context across many sessions.
    • Dependencies: Cache encryption, access control, tenant isolation, and mechanisms for invalidating or updating stale context. The reported storage reductions must be validated under real multi-turn workloads rather than only benchmark conditions.
  • Coding agents and software engineering automation (software development, DevOps)
    • A practical workflow could combine repository indexing, cached project context, shell tools, browser automation, screenshot-based UI verification, and automated test execution.
    • Dependencies: Sandboxed tool execution, permission controls, human review for code changes, and evaluation on the organization’s programming languages and repositories. The reported gap on science-oriented expert tasks limits fully autonomous use in specialized engineering.
  • Multimodal office automation (business operations, administration)
    • Potential tools include spreadsheet assistants, presentation-generation systems, form-processing pipelines, and agents that inspect rendered webpages before correcting layout or interaction errors.
    • Dependencies: OCR and visual accuracy, integration with enterprise applications, protections against prompt injection in documents or webpages, and confirmation steps for irreversible actions.
  • Long-document and multimodal retrieval workflows (academia, legal services, healthcare administration, finance)
    • Academic uses include literature review and supplementary-material analysis; legal uses include contract comparison; finance uses include filings and disclosures; healthcare-adjacent uses include administrative record summarization.
    • Dependencies: Retrieval quality, citation and provenance tracking, privacy compliance, and domain-specific validation. A one-million-token context window does not guarantee that every relevant passage will be correctly attended to or interpreted.
  • More economical hosted inference services (cloud computing, AI infrastructure)
    • These techniques can support more concurrent users, reduce HBM and storage purchases, and lower data movement between GPU memory, host memory, and SSD.
    • Dependencies: Kernel and runtime support for CSA2, FP4 dequantization, RDMA/prefetching, fused Mega-m operations, and workload-aware speculative decoding. Performance gains will depend on batch size, context distribution, hardware bandwidth, and cache hit rates.
  • On-premises or edge-adjacent deployment of capable assistants (public sector, regulated industries, small organizations)
    • Possible uses include internal knowledge assistants, offline coding tools, controlled document analysis, and local multimodal inspection.
    • Dependencies: The full 552B-parameter backbone remains a substantial deployment challenge despite sparse activation. Quantization, expert placement, hardware availability, and power constraints may still make local deployment impractical for many organizations.
  • Research and teaching infrastructure for efficient LLMs (academia)
    • Researchers can reproduce cache-memory measurements, compare exact and bounded replay, evaluate quality under different cache precisions, and build educational demonstrations of long-context inference.
    • Dependencies: Complete implementation details, reproducible kernels, compatible hardware, and access to sufficient compute for meaningful ablation studies. The paper text does not provide all information needed to reproduce the full training system.
  • Policy and procurement evaluation of AI infrastructure (public policy, technology management)
    • Procurement workflows could require reporting cost per long-context request, cache residency, energy use, latency, and quality under realistic workloads rather than relying only on parameter counts.
    • Dependencies: Standardized benchmarks and independently verified measurements. Model capability claims and cost reductions should be assessed across hardware vendors and representative applications.

Long-Term Applications

The following opportunities require further research, engineering, validation, or scaling before they can be considered broadly reliable or autonomous.

  • Persistent autonomous agents operating over months or years (software agents, robotics, enterprise operations)
    • Examples include an engineering agent tracking a product lifecycle, a scientific agent maintaining an experiment log, or a household robot retaining a history of rooms, objects, and user preferences.
    • Dependencies: Reliable memory consolidation, forgetting and deletion policies, temporal consistency, provenance, continual learning, privacy controls, and safeguards against compounding errors. Long context alone is not equivalent to robust long-term memory.
  • Multimodal robotics and embodied assistants (robotics, manufacturing, logistics, healthcare)
    • Potential workflows include warehouse picking, visual quality inspection, laboratory assistance, and household task planning.
    • Dependencies: Real-time latency, video and sensor integration, grounded action policies, robust perception under changing conditions, safety certification, and evaluation in physical environments. The paper demonstrates image and screen-oriented capabilities, not complete robotic control.
  • Large-scale scientific and engineering agents (science, energy, medicine, advanced engineering)
    • Dependencies: Expert-curated training data, tool-use reliability, verifiable reasoning, access to simulators and laboratory systems, and independent validation by domain experts. High-stakes scientific or medical decisions should not be delegated solely to the model.
  • Real-time multimodal video and screen agents (accessibility, operations, robotics, consumer devices)
    • The model’s sparse attention and nearly stable decode cost with context length could help maintain long visual histories.
    • Dependencies: Temporal modeling, much higher ingestion bandwidth, frame selection, latency guarantees, privacy-preserving processing, and methods that prevent irrelevant visual history from overwhelming useful context.
  • Distributed inference with aggressive cache migration (cloud, telecommunications, edge computing)
    • A future serving system could place active KV data in HBM, warm prefixes in host memory, and colder sessions on SSD or remote storage while using bounded replay when necessary.
    • Dependencies: Network reliability, encryption, cache consistency, low-latency interconnects, scheduling algorithms, and accurate cost models for recomputation versus data transfer.
  • Energy-efficient AI deployment at scale (energy, sustainability, data centers)
    • Operators could schedule workloads according to context length, cache reuse, acceptance rates for speculative decoding, and available renewable energy.
    • Dependencies: End-to-end measurement of energy rather than relying on FLOP estimates; hardware-specific implementation; and analysis of whether lower per-request cost increases total demand through expanded usage.
  • New compiler and accelerator designs for compressed attention (semiconductors, systems research)
    • Possible products include dedicated KV-cache memory systems, FP4-aware attention units, cache-aware schedulers, and compiler libraries for sparse multimodal MoEs.
    • Dependencies: Stable standards for low-precision formats, hardware support for irregular sparse access, accuracy guarantees, and evidence that the techniques generalize beyond this model family.
  • Privacy-preserving long-context assistants (healthcare, finance, government)
    • Dependencies: Strong encryption at rest and in memory, auditable deletion, access logging, federated or confidential-computing support, regulatory approval, and rigorous testing for memorization and data leakage. The paper’s efficiency innovations do not by themselves establish privacy or compliance.
  • Adaptive model serving based on workload and confidence (AI platforms, finance, operations research)
    • This could produce latency- or cost-aware agents for customer service, trading research, call centers, and interactive applications.
    • Dependencies: Calibrated confidence estimates, predictable tail latency, robust admission control, and safeguards against trading quality for throughput in high-stakes tasks.

Glossary

  • Activation memory traffic: The movement of intermediate neural-network activations between memory and computational units. “halves activation memory traffic relative to the original four-kernel implementation”
  • Agentic workload: A workload in which a model autonomously performs multistep tasks, often using tools. “particularly cost-effective for input-heavy agentic scenarios”
  • Auxiliary-loss-free load balancing: A mixture-of-experts routing method that balances expert utilization without adding an auxiliary training loss. “we extend auxiliary-loss-free load balancing”
  • Causal Encoder-Decoder (CED): An architecture that divides a causal Transformer into an encoder and decoder to reduce prefill computation. “we propose the Causal Encoder-Decoder (CED) architecture”
  • Causal attention: Attention restricted so that each position can access only preceding or permitted positions. “The first Full Mode layer scores all causally visible main KV positions”
  • Candidate pool: A restricted set of positions supplied to a later selection or indexing operation. “This pool defines where later indexers search”
  • Compressed Sparse Attention (CSA): An attention mechanism that compresses key-value entries and selects only a sparse subset for each query. “DeepSeek-V4 combines a global attention branch spanning the full context with local Sliding-Window Attention (SWA)”
  • Compression ratio: The factor by which a representation or cache is reduced relative to its uncompressed form. “CSA2(ratio, mode) specifying the compression ratio and mode”
  • Conditional memory: A memory mechanism that retrieves information selectively based on the current input or context. “Engram adds sparsely accessed conditional memory”
  • Cross-layer KV reuse: Sharing key-value cache entries between multiple Transformer layers. “CSA2 exploits the three dimensions jointly: it shares main KV and indexer K across layers”
  • Disaggregated execution: Running components of a computational workload separately rather than within one combined process or device. “Training infrastructure supports disaggregated vision-encoder execution”
  • Dynamic range: The range of numerical magnitudes representable by a data format. “the format supports magnitudes up to 448×6=2688448\times6=2688
  • FP4: A four-bit floating-point numerical format used to reduce model-storage requirements. “We now extend QAT to the main KV cache, where FP4 reduces storage rather than accelerates matrix multiplication”
  • FP8: An eight-bit floating-point format used for reduced-precision storage and computation. “We retain FP8 for the SWA KV cache due to its sensitivity to quantization”
  • Fine-grained routed expert: A mixture-of-experts component in which individual tokens are selectively assigned to specialized subnetworks. “We retain the shared and fine-grained routed experts of DeepSeekMoE”
  • HBM (High-Bandwidth Memory): High-throughput memory located near or integrated with an accelerator. “large KV caches continue to strain HBM and SSD capacity”
  • Hierarchical Sparse Indexer: An indexing mechanism that progressively narrows the candidate positions considered by later indexers. “We therefore introduce the Hierarchical Sparse Indexer”
  • Host memory: Main system memory used to store data that may be transferred to an accelerator when needed. “short-lived encoder SWA KV in host memory”
  • Indexer K: The key representation used by a sparse attention indexer to score candidate key-value entries. “It shares global KV and indexer K across layers”
  • Inference kernel fusion: Combining multiple low-level computational kernels into one operation to reduce memory transfers and launch overhead. “Further optimizations include communication--computation overlap, sharded Engram embedding tables, and inference kernel fusion”
  • KV cache: Stored key and value representations reused during autoregressive Transformer inference. “Further reducing the KV cache footprint is therefore critical”
  • Latency: The time required to produce a response or complete a computational operation. “its small activation footprint yields low inference latency and serving cost”
  • Mixture-of-Experts (MoE): A neural architecture that routes each token through only a subset of specialized expert networks. “DeepSeek-V4.1-Flash is a multimodal mixture-of-experts (MoE) Transformer”
  • Momentum update: An optimization method that incorporates a running average of past gradients into parameter updates. “Momentum update with Sinkhorn balancing”
  • Muon optimizer: An optimization algorithm used to update neural-network weight matrices. “We use Muon for the weight matrices of linear transformations in the language-model backbone”
  • Nesterov momentum: A momentum optimization variant that evaluates the gradient using a look-ahead parameter estimate. “We apply decoupled weight decay and Nesterov momentum to Muon”
  • On-policy distillation (OPD): Distillation in which training examples are generated from the policy currently being optimized. “reinforcement learning (RL) and on-policy distillation (OPD)”
  • Prefill: The inference phase that processes a prompt before autoregressive token generation begins. “prefill remains computationally expensive”
  • Quantization-aware training (QAT): Training that simulates reduced-precision arithmetic so a model can better tolerate quantized inference. “DeepSeek-V4 already uses quantization-aware training (QAT)”
  • Reindex Mode: A CSA2 operating mode that reuses key-value representations but computes new sparse-selection indices. “Reindex Mode reuses the most recent available main KV”
  • Residual stream: The sequence of intermediate representations passed through successive Transformer blocks. “Single-Pass m revises residual-stream mixing”
  • Root-mean-square normalization (RMSNorm): A normalization method that scales activations using their root-mean-square magnitude. “We also adopt RMSNorm for normalization”
  • Semi-autoregressive generation: Generation in which multiple future tokens are drafted in parallel while retaining some autoregressive dependency modeling. “a speculative decoding module that combines semi-autoregressive drafting with confidence-scheduled verification”
  • Serving throughput: The rate at which an inference system can process requests or generate tokens. “Together, these constraints limit serving throughput”
  • Sinkhorn balancing: An iterative matrix-normalization procedure that approximately equalizes row and column magnitudes through diagonal scaling. “Sinkhorn balancing finds diagonal scaling matrices DrD_r and DcD_c
  • Sliding-Window Attention (SWA): Attention restricted to a fixed-size local window of recent tokens. “DeepSeek-V4.1-Flash, like DeepSeek-V4, uses Sliding-Window Attention (SWA) in every layer”
  • Sparse attention: Attention that evaluates only a selected subset of possible key-value positions. “Sparse attention is trained from scratch at a sequence length of 64K”
  • Speculative decoding: An inference technique in which a fast auxiliary model drafts tokens that the main model verifies. “We also introduce the DSpark speculative decoding architecture”
  • Top-K indices: The positions of the K highest-scoring entries selected for sparse attention. “Reuse Mode reuses both global KV and the Top-K indices”
  • Weight decay: An optimization regularizer that discourages excessively large model parameters. “We apply decoupled weight decay and Nesterov momentum to Muon”
  • Zero-indexed: Numbered starting from index zero rather than index one. “The modules are placed at layers 1 and 14 (zero-indexed)”

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 16 tweets with 1302 likes about this paper.