DeepSeek V4.1-Flash
Separate the model's causal encoder–decoder memory sharing from FlashAttention and linear attention.
Jump to a section
552 billion parameters, two active counts
DeepSeek's model card for V4.1-Flash reports 552B backbone parameters, with Engram parameters counted separately. A token activates 8B of the backbone during prefill and 16B during decode. For this model, "active parameters" is not one number: it depends on which phase is running.
The name invites a second misreading. "Flash" is the model's name. It does not mean FlashAttention, the exact tiled attention kernel, and it does not mean linear attention. The attention the card describes is compressed sparse attention, a third thing.
Where the decoder's keys and values come from
The card describes a causal encoder–decoder arrangement. The decoder's global keys and values are projected from the encoder's final hidden states, instead of each decoder layer deriving its own from its own hidden states. One set of hidden states feeds the global memory that every decoder query reads.
This is not the encoder–decoder of the 2017 translation Transformer, whose encoder read a separate source sentence bidirectionally. Here the encoder is causal. Similar architectural names do not imply the same masks or the same execution schedule, so read the attention description rather than the label.
The attention is Compressed Sparse Attention 2 (CSA2). Each layer runs in one of three modes, Full, Reindex or Reuse, which is how layers share memory and reuse sparse selections. A hierarchical indexer narrows later candidate searches. FP4 storage for the main cache and local-window replay handle other parts of the memory problem, and the local sliding-window branch is separate from CSA2.
Select which memory entries a query reads.
Compression reduces the stored representation; sparse indexing selects entries to attend to. These are different decisions. DeepSeek V4.1-Flash combines compression, indexing, cross-layer reuse and a local-window branch.
- Dense score entries / head
- 16,777,216
- Uncompressed K + V entries / head
- 524,288
Element counts with fixed head width 64. Excludes model weights, other intermediates, batching and layers; not peak GPU memory or a speed benchmark.
A model name containing “Flash” does not mean FlashAttention or linear attention. Sparse selection has its own costs and can omit useful context. DeepSeek V4.1-Flash model card
Full · Reindex · Reuse
Sliding-window attention
Compression, selection and reuse change different costs
A deployment's memory splits into terms that respond to different design choices:
Compression changes the size of each cache entry: a 4-bit element is a quarter of a 16-bit one, before any quantization metadata. Selection changes how many entries a query reads, and leaves the store the same size. Reuse across layers changes how many copies exist. Each lever moves a different term, so a gain from one says nothing about the others.
None of them alone proves that total runtime is linear in context length. Indexing, projections, feed-forward work and scheduling all still cost time, and the card's separate prefill and decode counts are a reminder that the two phases do different work. Prefill processes the whole input prefix; decode extends it one token at a time with the cache already built.
Putting units on a cache estimate
Cache figures are easy to misquote because they mix per-token rates, token counts and binary or decimal units. The example below uses an invented budget of 1,024 bytes per token, not a DeepSeek measurement, to show the arithmetic for a million-token context.
bytes_per_token = 1024 # Hypothetical budget, not DeepSeek telemetry.
tokens = 1_000_000
cache_gib = bytes_per_token * tokens / 2**30
assert round(cache_gib, 3) == 0.954
print(round(cache_gib, 3))
# Add weights, local state and runtime allocations separately.A kibibyte per token for a million tokens is 0.954 GiB, not 1 GB, and confusing GB with GiB alone moves an estimate by about 7%. A real estimate needs the actual checkpoint and serving engine: quantization metadata, replication and temporary allocations can each invalidate a number built from a headline cache rate.
Where the reasoning slips
Reading the name as a kernel. FlashAttention computes exact attention in tiles without storing the full score matrix; linear attention replaces softmax attention with a fixed-size recurrent state. V4.1-Flash is neither, and its efficiency claims have to be checked against its own attention description. Compare FlashAttention with linear attention to see what each one changes.
Treating smaller entries as fewer interactions. A system that shrinks its stored keys and values but still lets every query read every past entry has not reduced the number of query–key scores at all. Memory compression and interaction sparsity are separate claims, and a design can make either without the other.
Quoting one throughput number. Because prefill and decode activate different amounts of the model and reuse the cache differently, a single tokens-per-second figure cannot describe both. Measure them separately.
Sources and further reading
- DeepSeek V4.1-Flash official model card: architecture claims reviewed October 2026. The figures on this page show data dependencies, not measured timing or independently reproduced performance.
- Dao et al., FlashAttention (2022): the exact, tiled attention kernel the model's name is often confused with.
- Katharopoulos et al., Transformers are RNNs (2020): linear attention as a recurrence.