DeepSeek-V4.1-Flash-1017: what the update changes, and how the model keeps its KV cache at 890 bytes per token
DeepSeek released an updated V4.1-Flash with open MIT weights and higher self-reported scores on agentic and coding benchmarks. The architecture is unchanged; we explain how its encoder-decoder layout and FP4 cache make a 1M-token context cost under 1 GB of global KV cache.
In short
On 17 October 2026 DeepSeek released DeepSeek-V4.1-Flash-1017, an update of its V4.1-Flash model, with open weights under the MIT license and the same API model name (deepseek-flash). DeepSeek reports higher scores on all eleven benchmarks in its table and says the model finishes tasks faster with shorter outputs. The underlying architecture did not change: its most notable feature is a very small KV cache of 890 bytes per token, which is what makes a 1-million-token context cheap to serve. This article explains what changed and how that cache size is reached, as far as the public material allows.
How it works
When a Transformer generates text, it stores a key and a value vector for every past token in every attention layer: the KV cache. For long contexts this cache, not the model weights, becomes the main memory cost per user.
V4.1-Flash reduces the cache in several ways that stack on top of each other:
- Causal encoder-decoder (CED) layout. The 40 layers are split into a 20-layer causal encoder and a 20-layer decoder. The decoder's global keys and values are projected from the encoder's final hidden states, instead of each decoder layer producing its own. So the long-term cache is built from one shared representation, not twenty.
- Low-precision cache. The main KV cache is stored in 4-bit floating point (FP4).
- Sparse and shared attention (CSA2). Layers are assigned a fixed mode (Full, Reindex or Reuse) so that some layers reuse keys and the selected top-k token indices of earlier layers.
- Sliding-window states are rebuilt, not stored. For local (sliding-window) attention, the missing states are recomputed by replaying the most recent tokens ("SWA Bounded Replay") instead of being saved to SSD.
The update in 1017 is about training, not architecture: DeepSeek describes reinforcement learning "with self-feedback" for end-to-end project work, with no further method details.
Under the hood
Published architecture facts (V4.1-Flash model card; 1017 uses the same configuration).
| Property | Value |
|---|---|
| Backbone parameters | 552B (file metadata lists 763B; the card also describes a 196B "Engram" conditional memory, which may explain part of the gap) |
| Active parameters | 8B per token in prefill, 16B in decode |
| Layers | 40 (20 encoder + 20 decoder) |
| Experts | 384 routed + 1 shared, 6 routed active per token |
| Context / max output | 1,048,576 / 384K tokens |
| Global KV cache | 890 bytes per token, about 1/4 of V4-Flash |
| Persistent KV cache | about 1/8 of V4-Flash (with SWA Bounded Replay) |
| KV format | FP4 E2M1 values, one FP8 E4M3 scale per 16 channels |
What 890 bytes per token means. For comparison, a classic grouped-query-attention model with a Llama-3-70B-like configuration (80 layers, 8 KV heads, head size 128, BF16) stores 80 × 8 × 128 × 2 × 2 = 327,680 bytes per token. At 1,048,576 tokens that is about 344 GB, against about 0.93 GB for 890 bytes per token. The comparison covers only the global cache; sliding-window and indexer state are extra and their size per token is not stated on the model card.
FP4 with group scales. E2M1 can represent only 0, ±0.5, ±1, ±1.5, ±2, ±3, ±4, ±6. Each group of 16 values shares one 8-bit scale, so storage is 4 + 8/16 = 4.5 bits per value. The accuracy cost of this on DeepSeek's real activations is not reported on the model card.
Reported benchmarks (DeepSeek, self-reported).
| Benchmark | V4.1-Flash-1017 | V4.1-Flash |
|---|---|---|
| HLE, no tools | 42.6 | 36.8 |
| Terminal-Bench 4.0 (Claude Code harness) | 42.3 | 31.2 |
| DeepSWE v1.1 (Mini-SWE-V2 harness) | 77.0 | 74.2 |
| ProgramBench | 29.1 | 20.3 |
| NL2Repo-Bench | 68.2 | 65.4 |
| Agents' Last Exam | 35.4 | 31.8 |
The card does not state the reasoning-effort or sampling settings behind these numbers, and it does not say whether the V4.1-Flash column was measured again. Scores from different harnesses are not directly comparable.
Price and access. On DeepSeek's pricing page the deepseek-flash model costs, per million tokens, $0.15 input (cache miss) and $0.60 output off-peak, and double that in peak hours; we did not find a statement that prices changed with 1017. DeepSeek also opened its Search & Fetch APIs to all users at $0.75 per 1,000 calls per endpoint, free through certain server-side tool integrations until 31 October 2026, 16:00 UTC.
Unknowns. The training method behind the update is described in one sentence. The size of the "shorter outputs" claim is not quantified. We could not read the technical report ("Pushing the Limits of KV Cache Compression") for this article, so details of CED and CSA2 here come only from the model card.
Try it yourself
1. Cache arithmetic and FP4 rounding (CPU, Python 3.13, NumPy 2.5). The scale is kept in float32 here; the real format stores it in FP8 E4M3, which adds a little more error.
import numpy as np
tokens = 1_048_576
gqa = 80 * 8 * 128 * 2 * 2 # layers * kv_heads * head_dim * (K,V) * bytes(BF16)
for name, b in [("GQA 70B-class, BF16", gqa), ("DeepSeek-V4.1-Flash", 890)]:
print(f"{name:22s} {b:>8d} B/token {b * tokens / 1e9:8.2f} GB for 1M tokens")
E2M1 = np.array([0, 0.5, 1, 1.5, 2, 3, 4, 6])
GRID = np.concatenate([-E2M1[::-1], E2M1])
def quant_fp4(x, group=16):
x = x.reshape(-1, group)
scale = np.abs(x).max(axis=1, keepdims=True) / 6.0
idx = np.abs((x / scale)[..., None] - GRID).argmin(-1)
return (GRID[idx] * scale).reshape(-1)
kv = np.random.default_rng(0).standard_normal(4096 * 16).astype(np.float32)
err = np.linalg.norm(quant_fp4(kv) - kv) / np.linalg.norm(kv)
print(f"relative error FP4/16-group on Gaussian data: {err:.3f}")
Expected output:
GQA 70B-class, BF16 327680 B/token 343.60 GB for 1M tokens
DeepSeek-V4.1-Flash 890 B/token 0.93 GB for 1M tokens
relative error FP4/16-group on Gaussian data: 0.094
Change group to 32 or 64 to see why a small group size is used: fewer scales save bits but increase the error.
2. Check the "shorter outputs" claim. The API keeps the old model names, so a before/after comparison of the API is no longer possible, but the open weights of both versions are on Hugging Face (deepseek-ai/DeepSeek-V4.1-Flash and deepseek-ai/DeepSeek-V4.1-Flash-1017). On a server that can hold the model, serve each version with the same vLLM or SGLang settings (DeepSeek recommends temperature 1.0, top_p 1.0), run the same 50 coding prompts, and compare the median number of output tokens and the pass rate. We have not run this experiment; results will depend on the reasoning-effort setting.
Play with it
Sources
What should happen next with this?
One click per article, no account needed. “Go deeper” feeds the research queue.