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

On-policy distillation

×

The last stage: full-vocabulary on-policy distillation on datasets from all domains, with over 40 teacher models.

On-policy distillation

The model being trained writes its own response and a teacher scores each of its tokens: a token the teacher finds more probable than the student does is rewarded, one it finds less probable is penalized.

rt=clip⁡(sg⁡(log⁡(pT/pS)),−Rmax⁡, Rmax⁡)\begin{aligned}r_t=\operatorname{clip}\big(&\operatorname{sg}(\log(p_T/p_S)),\\&-R_{\max},\ R_{\max}\big)\end{aligned}

Kimi K3 report, eq. 15, in the atlas’s letters

What the letters mean

pTp_T, pSp_S: the teacher’s and the student’s probability of token tt of the student’s response; sg⁡\operatorname{sg}: no gradient flows through it; Rmax⁡R_{\max}: a clipping bound. A per-token reward, not a loss: it enters a reinforcement-learning update.

The report cites on-policy distillation (Gu et al., 2024; Lu and Thinking Machines Lab, 2025), calls its form “full-vocabulary” and writes no loss for it.

Teachers
over 40, from all domains
Recipe
Asynchronous generation; the dataset mixture, per-dataset concurrency limits and active teachers may be adjusted during training

Not disclosed Context of this stage · What is trained · Loss · Steps · Learning rate · Tokens

What the terms meanAsynchronous RL
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
All settings9
Place
The last stage of post-training
Teachers
Over 40, on datasets from all domains; a domain’s best teacher may come from another stage of development and differ in architecture
Objective
Full-vocabulary on-policy distillation; the report writes no equation
Recipe
Asynchronous generation; the dataset mixture, per-dataset concurrency limits and active teachers may be adjusted during training
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
Sources6