Training

Pinned sources DeepSeek‑V4.1 technical report @ 2cba9e4 · no training code is published

  1. Start of training
  2. Start of the encoder’s training
  3. Vision encoder: contrastiveDeepSeek-ViT≈ 47B pairsnot statedContrastiveSigLIPWhat trains: ViTnot stated: context
  4. Vision encoder: autoregressiveDeepSeek-ViT236Bnot statedNTPWhat trains: ViTnot stated: context
  5. DeepSeek-ViT
  6. Pre‑training 0–28T28T64KNTPBalanceweight 0.0001What trains: not ViTsparse from scratch
  7. Pre‑training 28–34TLR decay begins6T64KNTPBalanceweight 0.0001What trains: all
  8. Pre‑training 34–45T11T1MNTPBalanceweight 0.0001What trains: all
  9. DeepSeek-V4.1-Flash-Base
  10. DSpark stagenot statednot statednot statedWhat trains: DSparkDSpark addednot stated: tokens, context, objective
  11. SFTnot statednot statedSFTnot statedpost-training changesnot stated: tokens, context, what trains
  12. RLnot statednot statedGRPOnot statednot stated: tokens, context, what trains
  13. On‑policy distillationnot statednot statedOPDover 40 teachersnot statednot stated: tokens, context, what trains
  14. DeepSeek-V4.1-Flash
  • tokens, log scale
  • derived: computed from stated numbers
  • not stated by the sources
  • the architecture changes
  • checkpoint
  • checkpoint, weights published

RL

×

Large-scale asynchronous reinforcement learning in synthesized agent tasks, with the reasoning effort as a condition and a length penalty that depends on it.

GRPO, group relative policy optimization

For each prompt the model writes a group of answers; each is scored and compared with the group’s mean, and the model is moved toward the answers above it, by a step clipped near the policy that wrote them and with a penalty for leaving a reference model.

J=1G∑i=1G(min⁡(wiAi, wˉiAi)−βDi)wˉi=clip⁡(wi, 1−ε, 1+ε)\begin{aligned}J&=\frac1G\sum_{i=1}^{G}\Big(\min\big(w_iA_i,\ \bar w_iA_i\big)-\beta D_i\Big)\\\bar w_i&=\operatorname{clip}(w_i,\,1-\varepsilon,\,1+\varepsilon)\end{aligned}

DeepSeek-R1 paper, eq. 1 to 3, and DeepSeek-V3 report, eq. 26 to 28; for one prompt, in the atlas’s letters w, w̄, D

What the letters mean

wiw_i: answer ii’s probability under the model being trained over its probability under the policy that wrote it; AiA_i: its reward less the group’s mean, over the group’s standard deviation; DiD_i: a KL penalty to the reference model; GG: the group size; ε\varepsilon, β\beta: hyper-parameters. Maximized.

The report names GRPO only through its group (“GRPO group size”, p. 30) and writes no objective. Before mean-centring the rewards among the answers to one prompt at one effort, it adds a length penalty that falls as the requested effort rises; it mentions no division by the rewards’ deviation (p. 29). Its clipping and KL term are not disclosed.

Effort
a scalar from 1 to 100 in the prompt
Length penalty
falls exponentially with the effort
Successive runs
merged checkpoints start the next run

Not disclosed Context of this stage · What is trained · Group size · The trained effort levels · The length penalty’s base coefficient (k0)(k_0), decay rate (λ)(\lambda), cap (Cmax⁡)(C_{\max}) and reference length (Lnorm)(L_{\mathrm{norm}}) · Clipping, KL term · Learning rate · Tokens

Why

The report says the gains come from the scale, diversity and verifiability of synthesized tasks and environments, under a fixed and unremarkable optimization procedure. DeepSeek-V4.1 report §5.1, p. 25

What the terms meanAsynchronous RL · Reasoning effort
Asynchronous RL
Generation keeps a steady number of responses in flight, and training takes over the machines as soon as enough are finished; an unfinished response resumes under the updated model, so the model also learns from tokens an earlier version of itself wrote, and tokens that are too stale are left out of the loss. DeepSeek-V4.1 report §5.2, pp. 30–31
Reasoning effort
How much the model may reason before it answers: a level given in its prompt, which training ties to a token budget or a length penalty. DeepSeek-V4.1 report §5.1.4, p. 29
All settings14
Kind
Large-scale asynchronous RL in synthesized tasks, over several agent scaffolds
Algorithm
GRPO is named only through its group; rewards are mean-centered within a subgroup to give group-relative advantages; the report writes no objective
Effort
A scalar effort b from 1 to 100 in the system prompt; responses sampled for the same prompt and effort form a subgroup (eq. 8)
Length penalty
Added to the reward: −min⁡(Cmax⁡, k(b) ℓ/Lnorm)-\min\big(C_{\max},\,k(b)\,\ell/L_{\mathrm{norm}}\big), ℓ\ell the reasoning tokens, with k(b)k(b) falling exponentially in bb (eq. 9, 10)
Tasks
A task is a problem, an environment and a verification system; environments for general agents and coding agents are synthesized and checked by agents
Successive runs
Checkpoints of runs across scaffolds or configurations are merged to start the next run
Other reward signals
A crashed environment is a failed trajectory with a “repercussion” signal; Agent Team mode has a reward of its own
Asynchronous training
A prompt is dispatched once as many samples complete as its group holds; recorded expert routing is replayed; tokens too stale are masked from the loss
Figures
Figure 7 labels its runs 512K and, on one benchmark from about 1,900 cumulative steps, 1M; three set-ups are plotted to about 2,000, 2,500 and 4,500 cumulative RL steps, none identified as the released model’s
DSpark
Trained alongside the backbone through post-training, with no gradient from its objective into the backbone
Hierarchical Sparse Indexer
“Training-aware and introduced in post-training”: later indexers score a candidate pool an earlier one selected
Number format
Quantization-aware training for the main KV cache in FP4, introduced in post-training; the sliding-window KV cache stays FP8
Replay
The decoder’s bounded replay of the sliding window is simulated in post-training
Long sequences
“A substantial share of training occurring at ultra-long sequence lengths in both the pre-training and post-training stages”, of sequences up to one million tokens
Sources12