out [1]
Explanation
Fill-in-Middle is in the data and adds no loss of its own: one document in ten is rearranged as prefix, suffix, middle, and the same next-token prediction then learns to write the middle.
The experts’ load is balanced mainly without a loss: a bias on each expert’s routing score moves by at the end of each step, against its load: 0.001 for the first 14.3T tokens, 0 for the last 500B. The balance loss drawn here is the complement, with .
The report writes the MTP loss and the balance loss, and calls the first “an additional training objective”. The main loss is drawn in its Figure 3, with no formula.
The multi-token prediction module is trained here. The report says inference can discard it, and the pinned inference code builds 61 layers and no such module; the published checkpoint’s tensor index still lists its tensors, as layer 61.
Sources
Direct evidence
§2.2, Multi-Token Prediction: D sequential modules predict D additional tokens. The k-th module has a shared embedding layer, a shared output head, a Transformer block TRM_k and a projection matrix M_k; it combines the previous depth’s representation with the embedding of the (i+k)-th token, h′ = M_k[RMSNorm(h); RMSNorm(Emb(t_{i+k}))] (eq. 21), runs the block (eq. 22) and the shared head (eq. 23). The loss of a depth is a cross-entropy (eq. 24); the overall MTP loss is their average times a weight λ (eq. 25), “an additional training objective”.
DeepSeek-V3-technical-report-2412.19437v2.pdf pp. 10–11 ↗ · arXiv 2412.19437 @ v2
§4.2: the maximum sequence length is 4K; the MTP depth D is 1, “besides the exact next token, each token will predict one additional token”; λ = 0.3 for the first 10T tokens and 0.1 for the remaining 4.8T; α = 0.0001; the bias update speed γ = 0.001 for the first 14.3T tokens and 0 for the remaining 500B.
DeepSeek-V3-technical-report-2412.19437v2.pdf pp. 22–23 ↗ · arXiv 2412.19437 @ v2
§2.1.2: an auxiliary-loss-free bias on the routing scores, moved by γ at the end of each step; and a complementary sequence-wise balance loss L_Bal = α Σ_i f_i P_i (eq. 17 to 20), α “an extremely small value”.
DeepSeek-V3-technical-report-2412.19437v2.pdf p. 9 ↗ · arXiv 2412.19437 @ v2
§4.1: the Fill-in-Middle strategy, in the Prefix-Suffix-Middle framework, applied at the document level at a rate of 0.1; documents are packed without cross-sample attention masking.
DeepSeek-V3-technical-report-2412.19437v2.pdf p. 22 ↗ · arXiv 2412.19437 @ v2
§4.2, Hyper-Parameters: 61 Transformer layers, hidden dimension 7168, 128 attention heads.
DeepSeek-V3-technical-report-2412.19437v2.pdf p. 22 ↗ · arXiv 2412.19437 @ v2
The published checkpoint’s tensor index lists model.layers.0 to model.layers.61, 62 in all; layer 61 has tensors of its own (eh_proj, enorm, hnorm, embed_tokens, shared_head): one multi-token prediction module, of depth 1. Recorded in docs/reviews/deepseek-v3-2/sources/CHECKPOINT-INDEX-MTP.md.
model.safetensors.index.json 1 ↗ · deepseek-ai/DeepSeek-V3.2-Exp @ 194c67e12b1b