Working Notes on Agent Systems/Brad Zhang

@teach_fireworks / X longform

Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cache used to store

Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cache used to store historical context features when a large model generates answers, which...

April 24, 2026 · 2 min read

Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cache used to store
Figure 1 / source image

Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cache used to store historical context features when a large model generates answers, which is equivalent to the model's short-term memory scratch paper.

The biggest problem with traditional large models is that the longer the text, the KV cache will expand exponentially.

When it comes to ultra-long documents with one million tokens, the cache will reach the TB level, and dozens of A100 graphics cards must be stacked to run the document.

The cost is extremely high and cannot be implemented.

The core breakthrough of DeepSeek‑V4 is to completely reconstruct the attention structure, using the dual scheme of CSA local compression + HCA global ultra-high compression to directly compress the KV cache to 7% to 10% of the previous generation model.

Coupled with MoE sparse activation and Engram hot and cold data tiered storage, infrequently used cold data is sinked to the CPU and hard disk, leaving only the real-time KV in the graphics card memory.

Finally, a key qualitative change was achieved: a single 80G A100 and H100 graphics card can fully run 1 million Token contexts.

For agent development, privatized deployment, and enterprise long document knowledge base, the cost of multi-card clusters is directly cut, and ultra-long text analysis, full warehouse code understanding, and batch contract analysis can all be implemented at low cost.

Figure 2 / source image

Visual summary

Article argument map

Generated from the post's content graph

FORMATTOPICCAPABILITYMARKETcoverscoverscoverssignalssignalsFORMATlongform noteTOPICagentsTOPICmemoryTOPICretrievalCAPABILITYagent workflowCAPABILITYtechnical writing
Mermaid outline
flowchart LR
  format-long_post["longform note"]
  topic-agents["agents"]
  topic-memory["memory"]
  topic-retrieval["retrieval"]
  capability-agent-workflow["agent workflow"]
  capability-technical-writing["technical writing"]
  format-long_post -->|covers| topic-agents
  format-long_post -->|covers| topic-memory
  format-long_post -->|covers| topic-retrieval
  format-long_post -->|signals| capability-agent-workflow
  format-long_post -->|signals| capability-technical-writing

Visual structure

Essay structure map

Built from summary and key paragraph positions

Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cach...THESISOptimization andInnovation of DeepSeekV4's KV Cache KV Cacheis a video memorySIGNALOptimization andInnovation of DeepSeekV4's KV Cache KV Cacheis a video memoryOPERATORThe core breakthroughof DeepSeek‑V4 is tocompletely reconstructthe attentionIMPLICATIONFor agent development,privatized deployment,and enterprise longdocument knowledge
Mermaid outline
flowchart LR
  thesis["Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cache used to store histor..."]
  signal["Optimization and Innovation of DeepSeek V4's KV Cache KV Cache is a video memory cache used to store histor..."]
  operator["The core breakthrough of DeepSeek‑V4 is to completely reconstruct the attention structure, using the dual s..."]
  implication["For agent development, privatized deployment, and enterprise long document knowledge base, the cost of mult..."]
  thesis -->|frames| signal
  signal -->|develops| operator
  operator -->|lands in| implication

Source: View the original post