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

Pre-training 0–28T

×

Pre-training from scratch with sparse attention at a sequence length of 64K and a constant learning rate; the vision encoder’s body is frozen.

Next-token prediction

L=−1T∑i=2T+1log⁡Pi[ti]\mathcal L=-\frac1T\sum_{i=2}^{T+1}\log P_i[t_i]
In words

At every position the model gives each token of the vocabulary a probability of coming next; the loss is the negative logarithm of the probability it gave the token that does come next, averaged over the sequence.

tit_i: the token at position ii; Pi[ti]P_i[t_i]: the probability the model, reading the tokens before it, gave that token; TT: the sequence length.

  • Balance loss. A sequence-level loss of weight 0.0001, beside biases on the routing scores moved with no loss, one set for image tokens and one for text; the report does not write the loss.
Tokens
28T of 45Tderived
Context
64K
Learning rate
2.6×10⁻⁴ after 2,000 steps of warm-up
Batch
100.6 million tokens
Vision encoder
frozen, but for its final normalization layer

Not disclosed Batch in sequences · Gradient clipping · Initialization · Compute · The indexer’s training loss

Why

The report says the model is trained with sparse attention from scratch, with no dense warm-up stage. DeepSeek-V4.1 report §1, p. 6

What the terms meanSparse attention
Sparse attention
Each query attends only to a subset of the earlier positions, picked by an indexer, which keeps attention over a long context affordable.
All settings15
Objective
Next-token prediction on text
No MTP
“We omit the MTP module during backbone pre-training”
Load balancing
Auxiliary-loss-free: bias update speed 0.001 for image tokens and for text tokens, two sets of biases; a sequence-level balance loss with weight 0.0001
Batch
100.6 million tokens, fixed throughout
Attention
Sparse from scratch, “without any dense attention warmup stages”
Optimizer
Muon for linear weights (momentum 0.95, weight decay 0.1, update RMS rescaled to 0.18), head-wise for Query and Key weights; a Sinkhorn-balanced momentum update for the embeddings and the prediction head (K = 11, τ = 10⁻³); AdamW for normalization weights and other non-matrix parameters (β₁ = 0.9, β₂ = 0.95; weight decay 0.1 on normalization weights, none on biases and scaling factors)
Engram learning rate
5 × the learning rate
Data
Text and multimodal corpora joined, 7 : 1 in tokens of text-only to multimodal; multimodal data from the start of pre-training
Packing
Best-fit packing with a padding rate of at most 10⁻⁴; sample-level attention masking
Context
64K from the start
Learning rate
Linear warm-up over the first 2,000 steps, then 2.6×10⁻⁴ until 28T tokens
Tokens
28T of 45TderivedThe report gives the boundaries in tokens: the learning rate is constant until 28T and decays to 40T, and the sequence length changes at 34T, of 45T in all.
Vision encoder
Frozen until the learning-rate decay begins; its final normalization layer and the vision–language projector stay trainable
Total
45T tokens of multimodal data
Steps
45T ÷ 100.6M ≈ 447,000 for all of pre-training; the warm-up’s 2,000 steps are about 0.2T tokensderivedTotal tokens over the batch in tokens; steps times the batch.
Sources8