Pre-training step

Balance loss

×

For each routed expert, its load on the sequence (the fraction of the sequence’s tokens it is chosen for, scaled by Nr/KrN_r/K_r) times its mean normalized score; summed and weighted by a very small α\alpha. It discourages an extreme imbalance within one sequence.

LBal=α∑i=1NrfiPi\mathcal L_{\mathrm{Bal}}=\alpha\sum_{i=1}^{N_r}f_iP_i
in
hh [B batch, T positions, 7168 d]
out
LBal\mathcal L_{\mathrm{Bal}} [1]

Read from the routing scores inside the model’s MoE layers; fif_i and PiP_i are the report’s (eq. 18 to 20), and this PiP_i is not the token distribution.

Sources

Direct evidence

§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.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