A million-token context window creates a second problem: paying to keep that context around.
DeepSeek V4.1 Flash tackles both the compute and the memory bill.
Its architecture deserves a closer look.
Different compute budgets for reading and writing.
The model has a 552B-parameter mixture-of-experts backbone. It activates 8B parameters per input token and 16B per output token.
That asymmetry matters for agents that consume long documents, repositories, and tool results before producing a short response. [1]
An encoder that supplies the decoder’s memory.
The 40-layer network splits into a 20-layer causal encoder and a 20-layer decoder. The decoder builds its global key-value cache from the encoder’s final representations.
The key-value cache stores attention state for earlier tokens so the model can reuse it during generation. [2]
Reuse inside attention.
Compressed Sparse Attention 2 shares cached representations across layers and reuses selected attention positions.
A hierarchical indexer narrows later searches to an initial candidate pool. This bounds deeper indexing work as context grows.
FP4 caching helps reduce global KV storage to 890 bytes per token. [2]
At one million tokens, that works out to about 890 MB for the global cache component. Model weights, local attention state, and runtime memory still sit outside that number.
Recompute a small window to save persistent storage.
SWA Bounded Replay reconstructs missing local attention state from recent tokens. [2]
DeepSeek reports roughly one-quarter of the previous Flash model’s KV memory requirement and one-eighth of its persistent cache storage. These are cache reductions, not equivalent end-to-end speedups. [1]
The architecture also includes Engram token-based memory, Single-Pass mHC residual mixing, and DSpark speculative decoding. [2]
My takeaway: this is an architecture shaped around the lifecycle of an agent request.
Read a large input. Retain its state. Search relevant context. Generate the next step. Repeat.
Each stage creates a different cost. V4.1 Flash gives several of them a specific architectural treatment.
For inference teams, the test is cost per completed task under realistic concurrency, with long histories and repeated tool calls.
A million-token window defines what an agent can read.
The cost of retaining and reusing it helps determine how much work that agent can afford to finish.