Track VI · Frontier Tech Reports · 06/20

Qwen3 — thinking 모드 융합, thinking budget, strong-to-weak 증류Qwen3 — fusing thinking modes, thinking budgets, strong-to-weak distillation

Qwen3 기술 보고서(2025-05)를 읽는다. 128-expert MoE와 global-batch load balancing, 36T 토큰 3단계 사전학습, 한 모델에 thinking/non-thinking을 넣는 4단계 사후학습과 그 부산물인 thinking budget, 작은 모델을 RL 대신 on-policy 증류로 만드는 strong-to-weak distillation을 식과 장난감 실험으로 재현한다.A reading of the Qwen3 technical report (2025-05). We reproduce, with equations and toy experiments, the 128-expert MoE with global-batch load balancing, the 36T-token three-stage pre-training, the four-stage post-training that puts thinking and non-thinking into one model (and the thinking budget that falls out of it), and strong-to-weak distillation, which builds the small models with on-policy distillation instead of RL.

Until early 2025, “reasoning models” and “chat models” were different checkpoints. Qwen shipped Qwen2.5-Instruct and QwQ-32B separately. The central claim of the Qwen3 report is that it put both into one model that switches with a flag, and that a thinking budget — cutting the reasoning at a given number of tokens — works as a by-product without being trained for. The second axis is cost. Only the two flagships go through the four-stage post-training; the other six models are distilled from them. The report says that, from the same starting point, on-policy distillation scored higher than RL at about 1/10 of the GPU hours (Table 21).

This lesson follows the report’s order but runs three things itself: global-batch load balancing for MoE, the accuracy curve of the thinking budget, and off-policy → on-policy distillation.

At a glance

ItemDetails
LabQwen Team, Alibaba
ReleaseReport 2025-05-14 (arXiv 2505.09388 v1)
Modelsdense 0.6B / 1.7B / 4B / 8B / 14B / 32B, MoE 30B-A3B / 235B-A22B (total / active)
ArchitectureGQA, SwiGLU, RoPE, pre-RMSNorm, QK-Norm (QKV bias removed). MoE: 8 of 128 experts active, no shared expert, global-batch LBL
Context32K for 0.6B and 1.7B, 128K for the rest (Tables 1–2). Pre-trained up to 32,768; 4× at inference with YaRN + DCA
Pre-training~36T tokens, 119 languages and dialects, 3 stages (general 30T+ → reasoning ~5T → long context, hundreds of billions)
Post-traininglong-CoT cold start → reasoning RL (GRPO) → thinking mode fusion (SFT) → general RL. Small models: strong-to-weak distillation
Tokenizerbyte-level BPE, vocabulary 151,669
Opennessall weights released, Apache 2.0

What is new

  • Fusing thinking and non-thinking. /think and /no_think flags plus an “empty think block” let one model move between the two modes (§4.3, Table 9).
  • Thinking budget. When the reasoning reaches a set number of tokens, generation stops, a stop phrase is inserted, and the model answers. It was not trained for, yet it works, and the score rises smoothly with the budget (Figure 2).
  • Strong-to-weak distillation. The six small models are first distilled off-policy on teacher outputs, then on-policy: the student generates, and its logits are matched to the teacher’s on those sequences. Better than RL from the same start, at 1/10 of the GPU hours (Table 21).
  • MoE details. No shared expert, 128 fine-grained experts, global-batch load balancing loss.
  • Data scale. 2× the tokens of Qwen2.5 (36T), more than 3× the languages (29 → 119). PDF OCR and synthetic data from Qwen2.5-Math/Coder add trillions of tokens.

Architecture

The dense models are almost the same as Qwen2.5 (a Transformer block with GQA, SwiGLU, RoPE, pre-RMSNorm). Two things changed. The QKV bias of Qwen2 is removed, and QK-Norm (RMSNorm) is applied to the attention qq and kk. It keeps the logit q⊤kq^\top k from blowing up during training and saturating the softmax into a one-hot — a device for stability at large learning rates (§2).

ModelLayersQ / KV headsTied embeddingContext
Qwen3-0.6B2816 / 8Yes32K
Qwen3-1.7B2816 / 8Yes32K
Qwen3-4B3632 / 8Yes128K
Qwen3-8B3632 / 8No128K
Qwen3-14B4040 / 8No128K
Qwen3-32B6464 / 8No128K
Qwen3-30B-A3B (MoE)4832 / 4128 experts / 8 active128K
Qwen3-235B-A22B (MoE)9464 / 4128 experts / 8 active128K
Report Tables 1 and 2.

→ Go deeper: The Qwen lineage — Qwen3 → Qwen3-Next → Qwen3.5 → Qwen3.8-Next.

MoE: fine-grained experts, no shared expert

An MoE layer splits one FFN into small experts E1,…,ENEE_1,\dots,E_{N_E}, and a router picks the top KK for each token (MoE in the inference lesson).

y=∑i∈TopK⁡(g(x))gi(x) Ei(x),g(x)=softmax⁡(Wrx)\mathbf{y}=\sum_{i\in\operatorname{TopK}(g(\mathbf{x}))} g_i(\mathbf{x})\,E_i(\mathbf{x}),\qquad g(\mathbf{x})=\operatorname{softmax}(W_r\mathbf{x})

Qwen3 follows DeepSeekMoE-style fine-grained segmentation with NE=128N_E=128 and K=8K=8, and unlike Qwen2.5-MoE it has no shared expert. Of 235B parameters, 22B are computed per token. The report summarises that, on the same data, the Qwen3 MoE base matches the Qwen3 dense base with 1/5 of the active parameters (§3.3).

Load balancing loss: where you take the average

The auxiliary loss that keeps experts evenly used (LBL) is defined from the fraction fif_i of tokens that selected expert ii and the mean router probability PiP_i:

LBL=NE∑i=1NEfi Pi\text{LBL}=N_E\sum_{i=1}^{N_E} f_i\,P_i

It equals 1 when both ff and PP are uniform (1/NE1/N_E) and grows as the load concentrates. fif_i is a frequency of the non-differentiable top-K choice and is treated as a constant, so the gradient flows only through PiP_i: ∂ LBL/∂Pi=NEfi\partial\,\text{LBL}/\partial P_i = N_E f_i — a pressure that cuts the probability of the most-used experts.

The question is which set of tokens these statistics are counted over. Most MoE frameworks compute the LBL on each parallel group’s (GPU’s) own micro-batch and average:

LBLmicro=1NP∑j=1NP(NE∑ifijPij)vsLBLglobal=NE∑ifˉi Pˉi\text{LBL}_{\text{micro}}=\frac{1}{N_P}\sum_{j=1}^{N_P}\Big(N_E\sum_i f^{j}_i P^{j}_i\Big) \qquad\text{vs}\qquad \text{LBL}_{\text{global}}=N_E\sum_i \bar f_i\,\bar P_i

A micro-batch holds only a few sequences, and in pre-training it is usually packed from one domain. LBLmicro\text{LBL}_{\text{micro}} then effectively forces balance inside each sequence: the tokens of a code sequence must spread evenly over all 128 experts, so domain experts cannot form. Qiu et al. (2025) proposed global-batch LBL, which all-reduces only the fif_i vector (NEN_E numbers) to get the global-batch fˉ\bar f; Qwen3 uses it (§2). The communication is a single expert-sized vector.

→ Go deeper: Anatomy of MoE — shared versus no shared expert and the balancing schemes of other labs.

2025년 초까지 “추론 모델”과 “대화 모델”은 다른 체크포인트였다. Qwen도 Qwen2.5-Instruct와 QwQ-32B를 따로 냈다. Qwen3 보고서의 중심 주장은 이것을 한 모델 안에서 플래그로 전환할 수 있게 만들었다는 것, 그리고 그 부산물로 사고 길이를 토큰 단위로 자르는 thinking budget이 따로 학습하지 않아도 생긴다는 것이다. 두 번째 축은 비용이다. 플래그십 두 개만 4단계 사후학습을 거치고, 나머지 6개는 플래그십에서 증류한다. 보고서는 같은 출발점에서 RL보다 on-policy 증류가 점수는 높고 GPU 시간은 약 1/10이었다고 보고한다(Table 21).

이 레슨은 보고서의 순서를 따라가되, 세 가지를 직접 돌려 본다. MoE의 global-batch load balancing, thinking budget의 정확도 곡선, 그리고 off-policy → on-policy 증류다.

한눈에

항목내용
연구실Qwen Team, Alibaba
공개보고서 2025-05-14 (arXiv 2505.09388 v1)
모델dense 0.6B / 1.7B / 4B / 8B / 14B / 32B, MoE 30B-A3B / 235B-A22B (총 / 활성)
아키텍처GQA, SwiGLU, RoPE, pre-RMSNorm, QK-Norm(QKV-bias 제거). MoE는 128 expert 중 8개 활성, shared expert 없음, global-batch LBL
문맥 길이0.6B·1.7B 32K, 나머지 128K (Table 1–2). 사전학습은 32,768까지, 추론 시 YaRN+DCA로 4배
사전학습약 36T 토큰, 119개 언어·방언, 3단계(일반 30T+ → 추론 약 5T → 장문맥 수천억)
사후학습long-CoT cold start → reasoning RL(GRPO) → thinking mode fusion(SFT) → general RL. 소형은 strong-to-weak 증류
토크나이저byte-level BPE, 어휘 151,669
공개 범위전 모델 가중치 공개, Apache 2.0

무엇이 새로운가

  • thinking / non-thinking 융합. /think, /no_think 플래그와 “빈 think 블록”으로 한 모델이 두 모드를 오간다(§4.3, Table 9).
  • thinking budget. 사고가 정해진 토큰 수에 닿으면 멈추고 중단 문구를 끼워 답하게 한다. 따로 학습하지 않았는데 동작하고, 예산을 늘리면 점수가 매끄럽게 오른다(Figure 2).
  • strong-to-weak distillation. 소형 6종은 teacher 출력으로 off-policy 증류한 뒤 학생이 만든 응답 위에서 teacher logit을 맞추는 on-policy 증류를 한다. 같은 출발점의 RL보다 좋고 GPU 시간은 1/10(Table 21).
  • MoE 세부. shared expert를 빼고 128개 fine-grained expert에 global-batch load balancing loss를 쓴다.
  • 데이터 규모. Qwen2.5 대비 토큰 2배(36T), 언어 3배 이상(29 → 119). PDF OCR과 Qwen2.5-Math/Coder 합성 데이터로 수 조 토큰을 늘렸다.

아키텍처

dense 모델은 Qwen2.5와 거의 같다(Transformer 블록에 GQA, SwiGLU, RoPE, pre-RMSNorm). 바뀐 점은 두 가지다. Qwen2에 있던 QKV bias를 없애고, attention의 qq, kk에 QK-Norm(RMSNorm)을 넣었다. 로짓 q⊤kq^\top k의 크기가 학습 중 폭주해 softmax가 one-hot으로 포화되는 것을 막는 장치로, 큰 학습률에서의 안정성을 위한 것이다(§2).

모델층Q / KV head임베딩 공유문맥
Qwen3-0.6B2816 / 8Yes32K
Qwen3-1.7B2816 / 8Yes32K
Qwen3-4B3632 / 8Yes128K
Qwen3-8B3632 / 8No128K
Qwen3-14B4040 / 8No128K
Qwen3-32B6464 / 8No128K
Qwen3-30B-A3B (MoE)4832 / 4128 expert / 8 활성128K
Qwen3-235B-A22B (MoE)9464 / 4128 expert / 8 활성128K
보고서 Table 1, 2.

→ 더 깊이: Qwen 계보 — Qwen3 → Qwen3-Next → Qwen3.5 → Qwen3.8-Next.

MoE: fine-grained expert와 shared expert 제거

MoE 층은 FFN 하나를 작은 expert E1,…,ENEE_1,\dots,E_{N_E}로 쪼개고, router가 토큰마다 상위 KK개를 고른다(추론 최적화의 MoE).

y=∑i∈TopK⁡(g(x))gi(x) Ei(x),g(x)=softmax⁡(Wrx)\mathbf{y}=\sum_{i\in\operatorname{TopK}(g(\mathbf{x}))} g_i(\mathbf{x})\,E_i(\mathbf{x}),\qquad g(\mathbf{x})=\operatorname{softmax}(W_r\mathbf{x})

Qwen3는 DeepSeekMoE식 fine-grained segmentation을 따르되 NE=128N_E=128, K=8K=8이고, Qwen2.5-MoE와 달리 shared expert가 없다. 총 235B 중 토큰당 22B만 계산한다. 보고서는 같은 데이터에서 Qwen3 MoE base가 활성 파라미터 1/5로 Qwen3 dense base와 비슷한 성능을 낸다고 요약한다(§3.3).

Load balancing loss: 어디서 평균을 내느냐

expert가 고르게 쓰이도록 붙이는 보조 손실(LBL)은 expert ii가 선택된 토큰 비율 fif_i와 평균 router 확률 PiP_i로 정의된다.

LBL=NE∑i=1NEfi Pi\text{LBL}=N_E\sum_{i=1}^{N_E} f_i\,P_i

ff와 PP가 모두 균등(1/NE1/N_E)이면 1이고, 몰릴수록 커진다. fif_i는 미분이 안 되는 top-K 선택의 빈도라 상수로 취급되고, 기울기는 PiP_i로만 흐른다. 그러면 ∂ LBL/∂Pi=NEfi\partial\,\text{LBL}/\partial P_i = N_E f_i, 즉 많이 쓰인 expert일수록 확률을 깎는 압력이다.

문제는 이 통계를 어떤 토큰 집합에서 세느냐다. 대부분의 MoE 프레임워크는 병렬 그룹(GPU)마다 자기 micro-batch로 LBL을 계산해 평균한다.

LBLmicro=1NP∑j=1NP(NE∑ifijPij)vsLBLglobal=NE∑ifˉi Pˉi\text{LBL}_{\text{micro}}=\frac{1}{N_P}\sum_{j=1}^{N_P}\Big(N_E\sum_i f^{j}_i P^{j}_i\Big) \qquad\text{vs}\qquad \text{LBL}_{\text{global}}=N_E\sum_i \bar f_i\,\bar P_i

micro-batch 하나에는 시퀀스가 몇 개뿐이고, 사전학습에서는 보통 한 도메인의 시퀀스를 packing해 넣는다. 그러면 LBLmicro\text{LBL}_{\text{micro}}는 사실상 시퀀스마다 균형을 강제한다. 코드 시퀀스의 토큰도 128개 expert에 고르게 퍼져야 한다는 뜻이니, 도메인 전문 expert가 생길 수 없다. Qiu et al.(2025)은 fif_i 벡터(NEN_E차원)만 all-reduce해 전역 배치의 fˉ\bar f로 바꾸는 global-batch LBL을 제안했고, Qwen3가 이것을 쓴다(§2). 통신량은 expert 수 크기의 벡터 하나뿐이다.

→ 더 깊이: MoE 해부 — shared expert 유무와 다른 lab의 부하 균형 방식.

전문 expert로 간 비율routed to useful experts: micro – · global – 전역 최대 부하/평균global max load / mean: micro – · global – step 0
Four domains (rows) and 16 experts (columns). Cell shade is the probability pd,i that the domain's tokens go to the expert; outlined cells are the experts "useful" to that domain. Left: the same objective ascended with micro-batch LBL (Eq. 3); right: with global-batch LBL (Eq. 4). Raise α: on the left every row flattens and specialisation disappears; on the right each row specialises while the column sums (global load) stay even. Raise k to 4 and every micro-batch mixes all domains, so the two methods coincide. 도메인 4개(행)와 expert 16개(열). 칸의 진하기는 그 도메인 토큰이 expert로 가는 확률 pd,i, 테두리 친 칸은 그 도메인에 "유용한" expert다. 왼쪽은 micro-batch LBL(Eq. 3), 오른쪽은 global-batch LBL(Eq. 4)로 같은 목적함수를 경사상승한 결과다. α를 올려 보면 왼쪽은 각 행이 균등해지며 전문화가 사라지고, 오른쪽은 행마다 전문화하면서도 열 합(전역 부하)은 고르게 유지된다. k를 4로 올리면 micro-batch 하나에 모든 도메인이 섞여 두 방식이 같아진다.

The toy uses exactly the gradients of the two formulas above. For domain dd‘s router distribution pd=softmax⁡(zd)p_d=\operatorname{softmax}(z_d) we ascend “fraction routed to useful experts − α⋅-\ \alpha\cdotLBL”. In the micro version pdp_d itself is penalised, so every row flattens; in the global version only the column sum pˉ\bar p is penalised, so each row can use different experts while the global load stays uniform. In the original paper, performance also rose with the Balance BSZ (the number of tokens over which the LBL is counted). For example, for a 15A2.54B MoE trained on 400B tokens, going from Balance BSZ 16 to 512 moved average PPL 5.778 → 5.603 and GSM8k 48.07 → 54.28 (Qiu et al. Table 1).

NumPy micro vs global LBL — same routing, different penalty
import numpy as np
E, D = 16, 4                         # number of experts, domains (= micro-batches)
rng = np.random.default_rng(0)

def lbl_micro(f, P):                 # f, P: (N_P, E) — computed per micro-batch, then averaged (Eq. 3)
    return np.mean(E * (f * P).sum(1))

def lbl_global(f, P):                # average f and P over the global batch first (Eq. 4)
    return E * (f.mean(0) * P.mean(0)).sum()

def routing(spec, tokens=2048, k=2):
    """top-k routing where tokens of domain d prefer experts 4d..4d+3 (logit bonus = spec)."""
    f = np.zeros((D, E)); P = np.zeros((D, E))
    for d in range(D):
        z = rng.normal(0, 1, (tokens, E)); z[:, 4*d:4*d+4] += spec
        p = np.exp(z - z.max(1, keepdims=True)); p /= p.sum(1, keepdims=True)
        top = np.argsort(-p, 1)[:, :k]
        f[d] = np.bincount(top.ravel().astype(np.intp), minlength=E) / (tokens * k)
        P[d] = p.mean(0)
    return f, P

print(f"{'specialise':>10} | {'LBL_micro':>9} | {'LBL_global':>10} | global max load / mean")
for spec in [0.0, 1.0, 2.0, 4.0]:
    f, P = routing(spec)
    print(f"{spec:>10.1f} | {lbl_micro(f, P):9.3f} | {lbl_global(f, P):10.3f} | {f.mean(0).max()*E:.2f}")
 

As specialisation grows only LBLmicro\text{LBL}_{\text{micro}} increases, even though the global load stays uniform throughout (max/mean ≈ 1). What the micro version penalises is not “imbalance” but “specialisation”.

Data

Scale and composition. 36T tokens, 119 languages and dialects (Qwen2.5: 18T, 29 languages). Code, STEM, reasoning, books, multilingual and synthetic data (§3.1). No mixture table is published.

How the corpus grewDetails (§3.1)
Text from PDFsQwen2.5-VL OCRs PDF-like documents → Qwen2.5 refines the text. “Trillions” of tokens
Synthetic dataQwen2.5, Qwen2.5-Math and Qwen2.5-Coder synthesise textbooks, QA, instructions and code snippets. Trillions of tokens, dozens of domains
More languages29 → 119
Instance-level mixingLabels for educational value, field, domain and safety on 30T+ tokens; mixture optimised per document (not per domain) with ablations on small proxy models

Post-training data. Differs by stage (§4.1–4.4).

  • Cold start: math, code, logic and STEM problems with verified answers or test cases. Qwen2.5-72B-Instruct removes hard-to-verify queries and queries it can answer without CoT; QwQ-32B generates NN responses, and wrong, repetitive, guessing, thinking-summary-inconsistent, language-mixing and validation-set-like responses are filtered. Only “a carefully selected subset” is used. The goal is to instil reasoning patterns, not performance, so samples and steps are kept minimal.
  • Reasoning RL: 3,995 query–verifier pairs that were not used in the cold start, are learnable, as hard as possible, and broad across sub-domains.
  • Thinking mode fusion: thinking data from rejection sampling with the Stage-2 model itself (on Stage-1 queries); non-thinking data curated for coding, math, instruction following, multilingual, creative writing, QA and role-play. Quality judged with auto-generated checklists; more translation data for low-resource languages.
  • General RL: a reward system over 20+ tasks (rules, reference-based model judging, reference-free reward model).

Training

Pre-training: three stages

StageTokensSequence lengthData and settings
S1 General30T+4,096119 languages, general knowledge and language skill
S2 Reasoning~5T4,096more STEM, code, reasoning and synthetic data; faster LR decay
S3 Long Contexthundreds of billions32,76875% of text 16K–32K long, 25% 4K–16K. RoPE base 10,000 → 1,000,000 (ABF)
Report §3.2.

At inference YaRN and Dual Chunk Attention extend this to 4× the trained length. The report only says the learning-rate schedule and batch size were predicted per stage from scaling laws relating model size, data and stage to the optimal hyperparameters; the concrete values (optimizer, peak LR, batch, precision) are not given.

Post-training: four stages and distillation

The flagships (235B-A22B, 32B) go through four stages. The first two build the ability “to think”, the last two the non-thinking mode and generality (§4, Figure 1).

  1. Long-CoT cold start. A short SFT on the filtered data above.
  2. Reasoning RL. GRPO on the 3,995 query–verifier pairs. The stated rules of thumb: large batches, many rollouts per query, off-policy training for sample efficiency, and controlling entropy so it rises steadily or stays stable. In a single run without manual hyperparameter changes, the 235B’s AIME’24 went from 70.1 to 85.1 over 170 steps.
  3. Thinking mode fusion. Continue SFT on the Stage-2 model with mixed thinking and non-thinking data. Covered in detail below.
  4. General RL. Instruction following, format following (including obeying /think flags), preference alignment, agent ability (multi-turn tool calls with real environment feedback), and special scenarios such as RAG.

In Track V notation the GRPO objective is (the report does not write it out; it only says GRPO was used):

J(θ)=E[1G∑i=1G1∣yi∣∑tmin⁡(ρi,tA^i, clip⁡(ρi,t,1−ε,1+ε)A^i)],ρi,t=πθ(yi,t∣x,yi,<t)πold(yi,t∣x,yi,<t),A^i=ri−mean⁡(r)std⁡(r)J(\theta)=\mathbb{E}\Big[\frac1G\sum_{i=1}^{G}\frac{1}{|y_i|}\sum_{t}\min\big(\rho_{i,t}\hat A_i,\ \operatorname{clip}(\rho_{i,t},1-\varepsilon,1+\varepsilon)\hat A_i\big)\Big],\quad \rho_{i,t}=\frac{\pi_\theta(y_{i,t}\mid x,y_{i,<t})}{\pi_{\text{old}}(y_{i,t}\mid x,y_{i,<t})},\quad \hat A_i=\frac{r_i-\operatorname{mean}(r)}{\operatorname{std}(r)}

Whether a KL term β\beta was used, the clip range ε\varepsilon and the group size GG are not disclosed. Later the Qwen team published GSPO, which handles the MoE problem of token ratios ρi,t\rho_{i,t} swinging with expert-selection changes by using a sequence-level ratio, and said it was applied to the RL of the “latest Qwen3 models” (Zheng et al. 2025). GSPO is covered in the RLVR lesson.

Three kinds of reward (§4.4). (1) Rule-based: answer checks, format and instruction compliance. (2) Model-based with a reference answer: Qwen2.5-72B-Instruct scores the response against the reference, reducing the false negatives of pure rules. (3) Reference-free reward model: a scalar RM trained on human preference data.

Strong-to-weak distillation (§4.5). The 0.6B–14B dense models and 30B-A3B skip the four stages.

  • Off-policy distillation: SFT the student on teacher responses generated with both /think and /no_think. Basic reasoning and mode switching.
  • On-policy distillation: the student itself generates /think or /no_think responses to prompts, and on those sequences its logits are aligned to those of the teacher (Qwen3-32B or Qwen3-235B-A22B) by minimising a KL.

The on-policy loss averages, over each token position of a response y∼πθ(⋅∣x)y\sim\pi_\theta(\cdot\mid x) generated by the student, a divergence between the two distributions:

LOPD(θ)=Ex, y∼πθ[1∣y∣∑t=1∣y∣D(πθ(⋅∣x,y<t) ∥ πT(⋅∣x,y<t))]\mathcal{L}_{\text{OPD}}(\theta)=\mathbb{E}_{x,\ y\sim\pi_\theta}\Big[\frac{1}{|y|}\sum_{t=1}^{|y|} D\big(\pi_\theta(\cdot\mid x,y_{<t})\ \big\|\ \pi_T(\cdot\mid x,y_{<t})\big)\Big]

The report does not state the KL direction (forward/reverse) or how gradients through the sampling are handled. The key is where the KL is measured. Off-policy SFT learns only at prefixes the teacher visits; on-policy learns the teacher’s judgement at prefixes the student actually visits. It also presupposes a shared vocabulary (the Qwen3 tokenizer), so logits can be compared token by token.

Core methods in depth

1. Thinking mode fusion and the thinking budget

The Stage-3 SFT data puts both modes inside one chat template (Table 9). The point is that non-thinking samples also keep an empty think block.

<|im_start|>user
{query} /think<|im_end|>
<|im_start|>assistant
<think>
{thinking_content}
</think>

{response}<|im_end|>
<|im_start|>user
{query} /no_think<|im_end|>
<|im_start|>assistant
<think>

</think>

{response}<|im_end|>

The output format is then always “think block → answer”, and developers can switch thinking off by appending the empty think block to the template themselves (enable_thinking=False). Thinking is the default, so thinking samples without a flag were included too, and in multi-turn data flags were inserted at random several times so the model learns to follow the last flag.

A model that has learned both modes can also handle the case in between — answering from an interrupted line of thought. The thinking budget uses this. When the thinking tokens reach the budget BB, generation stops, the following phrase is inserted, and the model continues with the answer.

Considering the limited time by the user, I have to give the solution based on the thinking directly now.
</think>.

The report writes that this ability was not explicitly trained but emerged from thinking mode fusion. The dots in the figure below are the result (Figure 2): even a 1K budget beats non-thinking, and accuracy keeps rising up to 32K.

그림의 장난감은 위 두 식의 기울기를 그대로 쓴다. 도메인 dd의 router 분포 pd=softmax⁡(zd)p_d=\operatorname{softmax}(z_d)에 대해 목적함수 “유용한 expert로 간 비율 − α⋅-\ \alpha\cdotLBL”을 올린다. micro 버전에서는 pdp_d 자신이 벌점을 받으니 각 행이 평평해지고, global 버전에서는 열 합 pˉ\bar p만 벌점을 받으니 행마다 다른 expert를 쓰면서도 전역 부하는 균등할 수 있다. 원 논문의 실험에서도 Balance BSZ(LBL을 세는 토큰 집합 크기)를 키울수록 성능이 올랐다. 예를 들어 15A2.54B MoE를 400B 토큰 학습했을 때 Balance BSZ 16 → 512로 평균 PPL 5.778 → 5.603, GSM8k 48.07 → 54.28이었다(Qiu et al. Table 1).

NumPy micro vs global LBL — 같은 라우팅, 다른 벌점
import numpy as np
E, D = 16, 4                         # expert 수, 도메인(=micro-batch) 수
rng = np.random.default_rng(0)

def lbl_micro(f, P):                 # f, P: (N_P, E) — micro-batch마다 계산해서 평균 (Eq. 3)
    return np.mean(E * (f * P).sum(1))

def lbl_global(f, P):                # f, P를 전역 배치로 먼저 평균한 뒤 계산 (Eq. 4)
    return E * (f.mean(0) * P.mean(0)).sum()

def routing(spec, tokens=2048, k=2):
    """도메인 d의 토큰이 expert 4d..4d+3을 선호(spec만큼 logit 가산)하는 top-k 라우팅."""
    f = np.zeros((D, E)); P = np.zeros((D, E))
    for d in range(D):
        z = rng.normal(0, 1, (tokens, E)); z[:, 4*d:4*d+4] += spec
        p = np.exp(z - z.max(1, keepdims=True)); p /= p.sum(1, keepdims=True)
        top = np.argsort(-p, 1)[:, :k]
        f[d] = np.bincount(top.ravel().astype(np.intp), minlength=E) / (tokens * k)
        P[d] = p.mean(0)
    return f, P

print(f"{'전문화 정도':>10} | {'LBL_micro':>9} | {'LBL_global':>10} | 전역 최대부하/평균")
for spec in [0.0, 1.0, 2.0, 4.0]:
    f, P = routing(spec)
    print(f"{spec:>10.1f} | {lbl_micro(f, P):9.3f} | {lbl_global(f, P):10.3f} | {f.mean(0).max()*E:.2f}")
 

전문화가 강해질수록 LBLmicro\text{LBL}_{\text{micro}}만 커진다. 전역 부하는 내내 균등(최대/평균 ≈ 1)한데도 그렇다. micro 버전이 벌하는 것은 “불균형”이 아니라 “전문화”라는 뜻이다.

데이터

규모와 구성. 36T 토큰, 119개 언어·방언(Qwen2.5는 18T, 29개 언어). 코드, STEM, 추론, 책, 다국어, 합성 데이터가 들어간다(§3.1). 비율 표는 공개하지 않았다.

늘린 방법내용 (§3.1)
PDF 텍스트 추출Qwen2.5-VL로 PDF류 문서를 OCR → Qwen2.5로 정제. “수 조(trillions)” 토큰
합성 데이터Qwen2.5, Qwen2.5-Math, Qwen2.5-Coder로 교과서·QA·instruction·코드 조각 형식을 합성. 수 조 토큰, 수십 개 도메인
다국어 확장언어 29 → 119
인스턴스 단위 혼합30T+ 토큰에 교육적 가치·분야·도메인·안전성 라벨을 붙이고, 소형 proxy 모델 ablation으로 문서 단위로 혼합 비율을 최적화(도메인 단위가 아니라)

사후학습 데이터. 단계마다 다르다(§4.1–4.4).

  • cold start: 수학·코드·논리·STEM 문제에 검증 가능한 정답이나 테스트 케이스를 붙인다. Qwen2.5-72B-Instruct로 검증이 어려운 질의와 CoT 없이도 맞히는 질의를 제거하고, QwQ-32B로 NN개 응답을 생성한 뒤 오답·반복·찍기·사고-요약 불일치·언어 혼용·검증셋 유사 응답을 걸러낸다. 그중 “선별된 일부”만 쓴다. 목적은 성능이 아니라 추론 패턴을 심는 것이라 샘플과 step을 최소화한다.
  • reasoning RL: cold start에 쓰지 않았고, 학습 가능하며, 최대한 어렵고, 하위 도메인이 넓은 query–verifier 쌍 3,995개.
  • thinking mode fusion: thinking 데이터는 Stage 2 모델 자신의 rejection sampling(Stage 1 질의), non-thinking 데이터는 코딩·수학·지시 따르기·다국어·창작·QA·롤플레이를 직접 큐레이션. 자동 생성 체크리스트로 품질을 평가하고, 저자원 언어를 위해 번역 비율을 높였다.
  • general RL: 20개 이상 과제의 보상 체계(규칙, 참조답 기반 모델 채점, 참조답 없는 보상모델).

학습

사전학습: 3단계

단계토큰시퀀스 길이데이터·설정
S1 General30T 이상4,096119개 언어, 일반 지식·언어 능력
S2 Reasoning약 5T4,096STEM·코드·추론·합성 비율 증가, 학습률 감쇠를 가속
S3 Long Context수천억32,76875%는 16K–32K, 25%는 4K–16K 길이. RoPE base 10,000 → 1,000,000(ABF)
보고서 §3.2.

추론 시에는 YaRN과 Dual Chunk Attention으로 학습 길이의 4배까지 쓴다. 학습률 스케줄과 배치 크기는 세 단계별로 모델 크기·데이터·단계와 최적 하이퍼파라미터의 관계를 맞춘 scaling law로 예측해 정했다고만 밝히고, 구체값(optimizer, peak LR, 배치, 정밀도)은 공개하지 않았다.

사후학습: 4단계와 증류

플래그십(235B-A22B, 32B)은 4단계를 거친다. 앞의 두 단계가 “생각하는 능력”, 뒤의 두 단계가 “생각하지 않는 모드와 범용성”이다(§4, Figure 1).

  1. Long-CoT cold start. 위의 필터링된 데이터로 짧게 SFT.
  2. Reasoning RL. GRPO로 3,995개 query–verifier 쌍을 학습한다. 보고서가 밝힌 경험칙은 큰 배치, 질의당 많은 rollout, sample efficiency를 위한 off-policy 학습, 그리고 엔트로피가 꾸준히 오르거나 유지되도록 제어하는 것이다. 하이퍼파라미터를 손대지 않은 한 번의 run에서 235B의 AIME’24가 170 step 동안 70.1 → 85.1로 올랐다.
  3. Thinking mode fusion. Stage 2 모델에 thinking·non-thinking 데이터를 섞어 이어서 SFT. 아래에서 자세히 본다.
  4. General RL. 지시 따르기, 형식 따르기(/think 플래그 준수 포함), 선호 정렬, agent(실제 환경 실행 피드백을 받는 멀티턴 tool 호출), RAG 같은 특수 시나리오.

GRPO 목적함수는 Track V의 표기로 다음과 같다(보고서는 식을 쓰지 않고 GRPO를 썼다고만 밝힌다).

J(θ)=E[1G∑i=1G1∣yi∣∑tmin⁡(ρi,tA^i, clip⁡(ρi,t,1−ε,1+ε)A^i)],ρi,t=πθ(yi,t∣x,yi,<t)πold(yi,t∣x,yi,<t),A^i=ri−mean⁡(r)std⁡(r)J(\theta)=\mathbb{E}\Big[\frac1G\sum_{i=1}^{G}\frac{1}{|y_i|}\sum_{t}\min\big(\rho_{i,t}\hat A_i,\ \operatorname{clip}(\rho_{i,t},1-\varepsilon,1+\varepsilon)\hat A_i\big)\Big],\quad \rho_{i,t}=\frac{\pi_\theta(y_{i,t}\mid x,y_{i,<t})}{\pi_{\text{old}}(y_{i,t}\mid x,y_{i,<t})},\quad \hat A_i=\frac{r_i-\operatorname{mean}(r)}{\operatorname{std}(r)}

KL 항 β\beta를 썼는지, clip 범위 ε\varepsilon, 그룹 크기 GG는 공개되지 않았다. 이후 Qwen 팀은 MoE RL에서 토큰 ratio ρi,t\rho_{i,t}가 expert 선택 변화로 크게 흔들리는 문제를 시퀀스 단위 ratio로 푼 GSPO를 발표했고, “최신 Qwen3 모델”의 RL에 적용했다고 밝혔다(Zheng et al. 2025). GSPO는 RLVR 레슨에서 다뤘다.

보상 세 종류(§4.4). (1) 규칙 기반: 정답 비교, 형식·지시 준수. (2) 참조답이 있는 모델 채점: Qwen2.5-72B-Instruct가 참조답을 보고 채점해 규칙 기반의 false negative를 줄인다. (3) 참조답이 없는 보상모델: 사람 선호 데이터로 학습한 스칼라 RM.

Strong-to-weak distillation(§4.5). 0.6B–14B dense와 30B-A3B는 4단계를 거치지 않는다.

  • off-policy 증류: teacher가 /think와 /no_think로 생성한 응답을 섞어 학생을 SFT한다. 추론 능력과 모드 전환의 기초.
  • on-policy 증류: 학생이 프롬프트에 대해 직접 /think 또는 /no_think 응답을 생성하고, 그 시퀀스 위에서 학생 logit을 teacher(Qwen3-32B 또는 235B-A22B)의 logit에 맞춰 KL을 줄인다.

on-policy 단계의 손실은 학생이 만든 응답 y∼πθ(⋅∣x)y\sim\pi_\theta(\cdot\mid x)의 각 토큰 위치에서 두 분포의 KL을 평균한 것이다.

LOPD(θ)=Ex, y∼πθ[1∣y∣∑t=1∣y∣D(πθ(⋅∣x,y<t) ∥ πT(⋅∣x,y<t))]\mathcal{L}_{\text{OPD}}(\theta)=\mathbb{E}_{x,\ y\sim\pi_\theta}\Big[\frac{1}{|y|}\sum_{t=1}^{|y|} D\big(\pi_\theta(\cdot\mid x,y_{<t})\ \big\|\ \pi_T(\cdot\mid x,y_{<t})\big)\Big]

보고서는 KL의 방향(forward/reverse)과 샘플링에 대한 기울기 처리를 밝히지 않는다. 핵심은 어디서 KL을 재느냐다. off-policy SFT는 teacher가 방문하는 prefix에서만, on-policy는 학생이 실제로 방문하는 prefix에서 teacher의 판단을 받는다. 같은 vocabulary(Qwen3 토크나이저)라 logit을 토큰마다 바로 비교할 수 있다는 점도 전제다.

핵심 method 깊게 보기

1. Thinking mode fusion과 thinking budget

Stage 3의 SFT 데이터는 두 모드를 한 대화 템플릿 안에 넣는다(Table 9). non-thinking 샘플에도 비어 있는 think 블록을 남겨 둔다는 것이 요점이다.

<|im_start|>user
{query} /think<|im_end|>
<|im_start|>assistant
<think>
{thinking_content}
</think>

{response}<|im_end|>
<|im_start|>user
{query} /no_think<|im_end|>
<|im_start|>assistant
<think>

</think>

{response}<|im_end|>

이렇게 하면 출력 형식이 언제나 “think 블록 → 답”으로 같아지고, 개발자는 템플릿에 빈 think 블록을 직접 붙여(enable_thinking=False) 사고를 끌 수 있다. 기본값은 thinking이라 플래그 없는 thinking 샘플도 넣었고, 멀티턴에서는 플래그를 무작위로 여러 번 넣어 마지막 플래그를 따르도록 학습했다.

두 모드를 다 배운 모델은 그 중간, 즉 사고가 도중에 끊긴 상태에서 답하기도 할 수 있게 된다. thinking budget은 이것을 이용한다. 사고 토큰이 예산 BB에 닿으면 생성을 멈추고 다음 문구를 삽입한 뒤 답을 이어 쓰게 한다.

Considering the limited time by the user, I have to give the solution based on the thinking directly now.
</think>.

보고서는 이 능력이 명시적으로 학습되지 않았고 thinking mode fusion의 결과로 생겼다고 쓴다. 아래 그림의 점이 그 결과(Figure 2)다. 1K 토큰 예산에서도 non-thinking보다 낫고, 32K까지 꾸준히 오른다.

B에서 잘린 문제 비율problems cut at B – 모형 정확도model accuracy – 보고서 점과의 RMSERMSE vs report points –
Dots: Qwen3-235B-A22B pass@1 at each thinking budget (approximate values read from report Figure 2, ±0.5 pt); the red dashed line is the non-thinking score. The solid curve is a simple model: "problems need different thinking lengths L, and a problem cut at budget B is answered from the thinking so far". Right: the distribution of L and the budget B (the cut part in red). Switch benchmarks: auto-fit puts the median needed length m at about 6K for GPQA, 8K for AIME'24 and 13–16K for AIME'25 and LiveCodeBench. Where the curve is steepest is "the thinking length that benchmark asks for". 왼쪽 점은 Qwen3-235B-A22B의 thinking budget별 pass@1(보고서 Figure 2에서 읽은 근삿값, ±0.5점), 빨간 점선은 non-thinking 모드 점수다. 실선은 "문제마다 필요한 사고 길이 L이 다르고, 예산 B에서 잘리면 그때까지의 사고로 답한다"는 단순 모형이다. 오른쪽은 L의 분포와 예산 B(잘린 부분은 빨강). 벤치마크를 바꿔 보면 자동 맞춤이 필요 길이 중앙값 m을 GPQA 약 6K, AIME'24 약 8K, AIME'25·LiveCodeBench 약 13–16K로 잡는다. 곡선이 가장 가파른 위치가 "그 벤치마크가 요구하는 사고 길이"다.

Let us read the curve with a toy model. Each problem needs a different length LL to think through (ln⁡L∼N(ln⁡m,σ2)\ln L\sim\mathcal{N}(\ln m,\sigma^2)), and if cut at budget BB the accuracy interpolates between the non-thinking level anta_{\text{nt}} and the full-thinking level afulla_{\text{full}} by the completed fraction (B/L)γ(B/L)^\gamma:

acc(B)=EL[1[L≤B] afull+1[L>B](ant+(afull−ant)(BL)γ)]\text{acc}(B)=\mathbb{E}_L\Big[\mathbb{1}[L\le B]\,a_{\text{full}}+\mathbb{1}[L>B]\Big(a_{\text{nt}}+(a_{\text{full}}-a_{\text{nt}})\big(\tfrac{B}{L}\big)^{\gamma}\Big)\Big]

B→0B\to 0 gives anta_{\text{nt}}, B→∞B\to\infty gives afulla_{\text{full}}, and the curve is steepest near B≈mB\approx m. Auto-fit puts the median required length mm at about 6K for GPQA, 8K for AIME’24 and 13–16K for AIME’25 and LiveCodeBench. For GPQA the gap between non-thinking and 32K thinking is itself small, about 9 points. That the AIME curves have not flattened at 32K reads as “quite a few problems still need more than 32K tokens”, and the report also expects gains beyond 32K (§4.7). This model is a toy for interpretation, not the report’s.

NumPy Qwen3 template, last flag, cutting at a thinking budget
STOP = ("Considering the limited time by the user, I have to give the solution "
        "based on the thinking directly now.\n</think>.\n\n")

def render(messages, enable_thinking=True):
    """Prompt string in Qwen3 format (report Table 9). enable_thinking=False pre-fills an empty think block."""
    s = ""
    for m in messages:
        s += f"<|im_start|>{m['role']}\n{m['content']}<|im_end|>\n"
    s += "<|im_start|>assistant\n"
    if not enable_thinking:
        s += "<think>\n\n</think>\n\n"
    return s

def last_flag(messages):
    """In multi-turn chats the last /think or /no_think wins (default: think)."""
    mode = "think"
    for m in messages:
        if m["role"] == "user":
            for tok in m["content"].split():
                if tok in ("/think", "/no_think"):
                    mode = tok[1:]
    return mode

def generate_with_budget(thinking_tokens, budget):
    """Stop when thinking hits the budget and insert the stop phrase; the model then writes the answer."""
    if len(thinking_tokens) <= budget:
        return "<think>\n" + " ".join(thinking_tokens) + "\n</think>\n\n", False
    cut = " ".join(thinking_tokens[:budget])
    return "<think>\n" + cut + "\n\n" + STOP, True

msgs = [{"role": "user", "content": "What is 2+2? /no_think"},
        {"role": "assistant", "content": "4"},
        {"role": "user", "content": "Then what is 17*23? /think"}]
mode = last_flag(msgs)
print("last flag ->", mode)
print(render(msgs[-1:], enable_thinking=(mode == "think")))
thought = "17*23 = 17*20 + 17*3 = 340 + 51 = 391 . check : 23*17 = 391".split()
for b in (40, 6):
    out, truncated = generate_with_budget(thought, b)
    print(f"--- budget={b} truncated={truncated}\n{out}")
 

2. Strong-to-weak: why on-policy distillation

Off-policy distillation (SFT on teacher responses) learns only at prefixes the teacher visits. But the student is weaker and makes mistakes the teacher almost never makes. Prefixes after a mistake hardly appear in the teacher data, so the student never learns how to recover from its own mistakes. A well-known result in imitation learning: with per-step error ϵ\epsilon, the cumulative error of off-policy imitation can grow as O(T2ϵ)O(T^2\epsilon) in the horizon TT in the worst case, and drops to O(Tϵ)O(T\epsilon) when the student gets teacher labels on its own distribution (DAgger; Ross et al. 2011). GKD (Agarwal et al. 2024) applied the same logic to LLM distillation, and Qwen3’s on-policy stage has that form.

The toy below keeps only this difference. The state is (step, on track / after a mistake); after a mistake a specific “recovery action” is needed to get back on track. The student has a capacity floor — it mixes a fraction λ\lambda of uniform noise into every step — so it errs more often than the teacher.

장난감 모형으로 곡선을 읽어 보자. 문제마다 끝까지 생각하는 데 필요한 길이 LL이 다르고(ln⁡L∼N(ln⁡m,σ2)\ln L\sim\mathcal{N}(\ln m,\sigma^2)), 예산 BB에서 잘리면 정확도가 non-thinking 수준 anta_{\text{nt}}와 완전 사고 수준 afulla_{\text{full}} 사이에서 완료 비율 (B/L)γ(B/L)^\gamma만큼 보간된다고 하자.

acc(B)=EL[1[L≤B] afull+1[L>B](ant+(afull−ant)(BL)γ)]\text{acc}(B)=\mathbb{E}_L\Big[\mathbb{1}[L\le B]\,a_{\text{full}}+\mathbb{1}[L>B]\Big(a_{\text{nt}}+(a_{\text{full}}-a_{\text{nt}})\big(\tfrac{B}{L}\big)^{\gamma}\Big)\Big]

B→0B\to 0이면 anta_{\text{nt}}, B→∞B\to\infty이면 afulla_{\text{full}}이고, 곡선이 가장 가파른 곳은 B≈mB\approx m 근처다. 자동 맞춤을 하면 필요 길이 중앙값 mm이 GPQA 약 6K, AIME’24 약 8K, AIME’25와 LiveCodeBench 약 13–16K로 잡힌다. GPQA는 non-thinking과 32K thinking의 차이 자체가 약 9점으로 작다. 32K에서도 AIME 곡선이 평평해지지 않는 것은 “32K보다 길게 생각해야 하는 문제가 아직 꽤 있다”는 뜻으로 읽히고, 보고서도 32K를 넘기면 더 오를 것으로 본다(§4.7). 이 모형은 해석을 위한 장난감이지 보고서의 모형이 아니다.

NumPy Qwen3 템플릿, 마지막 플래그, thinking budget 자르기
STOP = ("Considering the limited time by the user, I have to give the solution "
        "based on the thinking directly now.\n</think>.\n\n")

def render(messages, enable_thinking=True):
    """Qwen3 형식의 프롬프트 문자열 (보고서 Table 9). enable_thinking=False면 빈 think 블록을 미리 붙인다."""
    s = ""
    for m in messages:
        s += f"<|im_start|>{m['role']}\n{m['content']}<|im_end|>\n"
    s += "<|im_start|>assistant\n"
    if not enable_thinking:
        s += "<think>\n\n</think>\n\n"
    return s

def last_flag(messages):
    """multi-turn에서는 마지막으로 나온 /think 또는 /no_think를 따른다 (기본값 think)."""
    mode = "think"
    for m in messages:
        if m["role"] == "user":
            for tok in m["content"].split():
                if tok in ("/think", "/no_think"):
                    mode = tok[1:]
    return mode

def generate_with_budget(thinking_tokens, budget):
    """사고 토큰이 budget에 닿으면 멈추고 중단 문구를 넣는다. 그 뒤 답은 모델이 이어 쓴다."""
    if len(thinking_tokens) <= budget:
        return "<think>\n" + " ".join(thinking_tokens) + "\n</think>\n\n", False
    cut = " ".join(thinking_tokens[:budget])
    return "<think>\n" + cut + "\n\n" + STOP, True

msgs = [{"role": "user", "content": "2+2는? /no_think"},
        {"role": "assistant", "content": "4"},
        {"role": "user", "content": "그럼 17*23은? /think"}]
mode = last_flag(msgs)
print("마지막 플래그 →", mode)
print(render(msgs[-1:], enable_thinking=(mode == "think")))
thought = "17*23 = 17*20 + 17*3 = 340 + 51 = 391 . check : 23*17 = 391".split()
for b in (40, 6):
    out, truncated = generate_with_budget(thought, b)
    print(f"--- budget={b} truncated={truncated}\n{out}")
 

2. Strong-to-weak: 왜 on-policy 증류인가

off-policy 증류(teacher 응답으로 SFT)는 teacher가 방문한 prefix에서만 배운다. 그런데 학생은 teacher보다 약해서 teacher가 거의 하지 않는 실수를 한다. 실수한 뒤의 prefix는 teacher 데이터에 거의 없으니, 학생은 실수에서 회복하는 법을 배운 적이 없다. 모방학습에서 잘 알려진 결과로, 한 step 오류율이 ϵ\epsilon이면 off-policy 모방의 누적 오류는 길이 TT에 대해 최악 O(T2ϵ)O(T^2\epsilon)까지 커지고, 학생 자신의 분포에서 teacher 라벨을 받으면(DAgger) O(Tϵ)O(T\epsilon)으로 줄어든다(Ross et al. 2011). LLM 증류에서 같은 논리를 쓴 것이 GKD(Agarwal et al. 2024)이고, Qwen3의 on-policy 단계가 이 형태다.

아래 장난감은 이 차이만 남긴 것이다. 상태는 (step, 정상 / 실수 뒤)이고, 실수 뒤에는 특정 “복구 행동”을 해야 정상으로 돌아온다. 학생은 매 step λ\lambda만큼 균등 잡음을 섞는 용량 한계가 있어 teacher보다 자주 실수한다.

teacher 데이터의 off-track 방문off-track visits in teacher data – 복구 행동 확률(평균): off-policy 후mean recovery-action prob: after off-policy – · on-policy 후after on-policy –
An autoregressive task of length 24 with 8 actions. Left bars: task success (on track at the end): initial student, after off-policy distillation, after the following on-policy distillation, and the maximum possible at capacity λ. Right: per state, the probability that the student picks the teacher's action (top two rows: after off-policy; bottom two: after on-policy; each pair is on-track / off-track). Lower εT: the teacher almost never errs, so off-track states are missing from the teacher data and the off-policy student never learns "how to recover after a mistake" (the second row stays pale). The on-policy stage gets the teacher distribution in states where the student itself erred, and fills that row. Set λ to 0 and the student stops erring, so the difference vanishes. 길이 24, 행동 8개인 자기회귀 과제. 왼쪽 막대는 과제 성공률(끝에 on-track이면 성공): 초기 학생, off-policy 증류 뒤, 이어서 on-policy 증류 뒤, 그리고 용량 λ에서 가능한 최대치. 오른쪽은 상태별로 학생이 teacher의 행동을 고를 확률이다(위 두 줄: off-policy 뒤, 아래 두 줄: on-policy 뒤; 각 쌍은 on-track/off-track). εT를 낮춰 보면 teacher가 거의 실수하지 않아 off-track 상태가 teacher 데이터에 나오지 않고, off-policy 학생은 "실수한 뒤 복구하는 법"을 배우지 못한다(오른쪽 둘째 줄이 흐림). on-policy 단계는 학생이 스스로 실수한 상태에서 teacher 분포를 받으므로 그 줄을 채운다. λ를 0으로 내리면 학생이 실수하지 않아 차이가 사라진다.
NumPy off-policy → on-policy distillation (tabular toy)
import numpy as np
rng = np.random.default_rng(0)
A, T = 8, 24                          # number of actions, length
a_star = rng.integers(0, A, T)        # correct action in the on-track state
r_star = rng.integers(0, A, T)        # recovery action in the off-track (after-mistake) state
lam, eps_T = 0.08, 0.002              # student capacity floor, teacher error rate

TP = np.full((T, 2, A), eps_T / (A - 1))      # teacher policy (T, on/off, A)
TP[np.arange(T), 0, a_star] = 1 - eps_T
TP[np.arange(T), 1, r_star] = 1 - eps_T

def softmax(Z):
    e = np.exp(Z - Z.max(-1, keepdims=True)); return e / e.sum(-1, keepdims=True)

def student(Z):                       # capacity floor: a fraction λ of uniform noise at every step
    return (1 - lam) * softmax(Z) + lam / A

def rollout(P, n, R):
    off = np.zeros(n, dtype=np.intp)
    offs = np.zeros((n, T), dtype=np.intp); acts = np.zeros((n, T), dtype=np.intp)
    for t in range(T):
        offs[:, t] = off
        a = (P[t, off].cumsum(1) < R.random((n, 1))).sum(1).clip(0, A - 1)
        acts[:, t] = a
        ok = np.where(off == 1, a == r_star[t], a == a_star[t])
        off = (~ok).astype(np.intp)
    return offs, acts, off == 0

def success(P):
    return rollout(P, 4000, np.random.default_rng(1))[2].mean()

def ce_step(Z, offs, acts, lr=8.0, teacher_target=False):
    """One cross-entropy step on visited states. Target: sampled action (off-policy) or full teacher distribution (on-policy)."""
    n = offs.shape[0]; Q = softmax(Z); G = np.zeros_like(Z)
    for t in range(T):
        for o in (0, 1):
            m = offs[:, t] == o; k = m.sum()
            if k == 0: continue
            y = TP[t, o] if teacher_target else np.bincount(acts[m, t], minlength=A) / k
            G[t, o] = k * (Q[t, o] - y)
    return Z - lr * G / n

Z = rng.normal(0, 0.3, (T, 2, A))
print(f"initial student success       {success(student(Z)):.3f}")
offs, acts, _ = rollout(TP, 256, np.random.default_rng(2))
print(f"teacher data: off-track visits per response {offs.sum(1).mean():.3f}")
for _ in range(60):
    Z = ce_step(Z, offs, acts)
rec = lambda Z: softmax(Z)[np.arange(T), 1, r_star].mean()
print(f"after off-policy distillation {success(student(Z)):.3f}  (recovery-action prob {rec(Z):.2f})")
R = np.random.default_rng(3)
for it in range(40):
    o2, a2, _ = rollout(student(Z), 32, R)        # the student generates
    Z = ce_step(Z, o2, a2, teacher_target=True)   # and follows the teacher distribution in those states
print(f"+ on-policy distillation      {success(student(Z)):.3f}  (recovery-action prob {rec(Z):.2f})")
best = np.zeros((T, 2, A)); best[np.arange(T), 0, a_star] = 30; best[np.arange(T), 1, r_star] = 30
print(f"ceiling at capacity λ={lam}     {success(student(best)):.3f}")
 

After the off-policy stage the recovery-action probability stays low, and the on-policy stage lifts it almost to the teacher’s level. Accuracy on the on-track path is similar after both stages; the whole difference comes from “states the student produced itself”.

Compared with RL the density of the signal differs. RL (GRPO) gets one scalar reward per response. On-policy distillation gets, at every token position of the response, the teacher’s distribution over the whole vocabulary. Report Table 21 compares the two starting from the same off-policy-distilled 8B checkpoint.

Method (Qwen3-8B)AIME’24AIME’25MATH500LiveCodeBench v5MMLU-ReduxGPQA-DiamondGPU hours
Off-policy distillation55.0 (90.0)42.8 (83.3)92.442.086.455.6–
+ RL67.6 (90.0)55.5 (83.3)94.852.986.961.317,920
+ On-policy distillation74.4 (93.3)65.5 (86.7)97.060.388.363.31,800
Parentheses: pass@64. Report Table 21.

RL raised pass@1 but left pass@64 unchanged (90.0, 83.3); distillation raised pass@64 as well. The report reads this as evidence that teacher logits widened the student’s exploration space. It points the same way as the observation that RL mostly concentrates probability on what the base can already solve (Yue et al. 2025).

PyTorch PyTorch: on-policy distillation loss (reference) 로컬에서 실행run locally (pip install torch)
import torch
import torch.nn.functional as F

@torch.no_grad()
def sample(student, tok, prompts, max_new_tokens=4096, thinking=True):
    # the student generates its own responses, mixing /think and /no_think modes
    texts = [tok.apply_chat_template([{"role": "user", "content": p}], tokenize=False,
                                     add_generation_prompt=True, enable_thinking=thinking) for p in prompts]
    tok.padding_side = "left"
    enc = tok(texts, return_tensors="pt", padding=True).to(student.device)
    out = student.generate(**enc, do_sample=True, temperature=1.0, max_new_tokens=max_new_tokens)
    resp_mask = torch.zeros_like(out, dtype=torch.bool)
    resp_mask[:, enc.input_ids.shape[1]:] = True
    resp_mask &= out.ne(tok.pad_token_id)
    return out, enc.attention_mask, resp_mask

def on_policy_distill_loss(student, teacher, seqs, prompt_attn, resp_mask):
    attn = torch.cat([prompt_attn, resp_mask[:, prompt_attn.shape[1]:].long()], dim=1)
    s_logits = student(seqs, attention_mask=attn).logits[:, :-1]        # position t predicts token t+1
    with torch.no_grad():
        t_logits = teacher(seqs, attention_mask=attn).logits[:, :-1]    # must share the tokenizer
    mask = resp_mask[:, 1:].float()                                     # response tokens only
    s_logp = F.log_softmax(s_logits.float(), -1)
    t_logp = F.log_softmax(t_logits.float(), -1)
    # reverse KL(π_θ || π_T) over the full vocabulary at every student-visited prefix
    kl = (s_logp.exp() * (s_logp - t_logp)).sum(-1)
    return (kl * mask).sum() / mask.sum()

# for step in range(num_steps):
#     seqs, pattn, rmask = sample(student, tok, next(prompt_iter), thinking=random.random() < 0.5)
#     loss = on_policy_distill_loss(student, teacher, seqs, pattn, rmask)
#     loss.backward(); opt.step(); opt.zero_grad()
 
확인 문제Check yourself

On Qwen3-8B, RL and on-policy distillation were compared from the same off-policy-distilled checkpoint. What does report Table 21 show?

On-policy distillation reaches AIME’24 74.4 (93.3) and AIME’25 65.5 (86.7), above RL’s 67.6 (90.0) and 55.5 (83.3) in both pass@1 and pass@64, with 1,800 versus 17,920 GPU hours. RL did not move pass@64 from the off-policy starting point (90.0, 83.3).

Results

Flagship, thinking mode. Qwen3-235B-A22B scores AIME’24 85.7, AIME’25 81.5, LiveCodeBench v5 70.7, CodeForces 2,056 and BFCL v3 70.8 (Table 11). In the same table Gemini 2.5 Pro leads on most rows, and against o1 and DeepSeek-R1 it varies by benchmark. GPQA-Diamond (71.1) is the lowest among the compared models.

NumPy off-policy → on-policy 증류 (표 형태 장난감)
import numpy as np
rng = np.random.default_rng(0)
A, T = 8, 24                          # 행동 수, 길이
a_star = rng.integers(0, A, T)        # on-track 상태의 정답 행동
r_star = rng.integers(0, A, T)        # off-track(실수 뒤) 상태의 복구 행동
lam, eps_T = 0.08, 0.002              # 학생 용량 한계, teacher 오류율

TP = np.full((T, 2, A), eps_T / (A - 1))      # teacher 정책 (T, on/off, A)
TP[np.arange(T), 0, a_star] = 1 - eps_T
TP[np.arange(T), 1, r_star] = 1 - eps_T

def softmax(Z):
    e = np.exp(Z - Z.max(-1, keepdims=True)); return e / e.sum(-1, keepdims=True)

def student(Z):                       # 용량 한계: 매 step λ만큼 균등 분포가 섞인다
    return (1 - lam) * softmax(Z) + lam / A

def rollout(P, n, R):
    off = np.zeros(n, dtype=np.intp)
    offs = np.zeros((n, T), dtype=np.intp); acts = np.zeros((n, T), dtype=np.intp)
    for t in range(T):
        offs[:, t] = off
        a = (P[t, off].cumsum(1) < R.random((n, 1))).sum(1).clip(0, A - 1)
        acts[:, t] = a
        ok = np.where(off == 1, a == r_star[t], a == a_star[t])
        off = (~ok).astype(np.intp)
    return offs, acts, off == 0

def success(P):
    return rollout(P, 4000, np.random.default_rng(1))[2].mean()

def ce_step(Z, offs, acts, lr=8.0, teacher_target=False):
    """방문한 상태들에서 cross-entropy의 한 step. 목표는 샘플된 행동(off-policy) 또는 teacher 분포 전체(on-policy)."""
    n = offs.shape[0]; Q = softmax(Z); G = np.zeros_like(Z)
    for t in range(T):
        for o in (0, 1):
            m = offs[:, t] == o; k = m.sum()
            if k == 0: continue
            y = TP[t, o] if teacher_target else np.bincount(acts[m, t], minlength=A) / k
            G[t, o] = k * (Q[t, o] - y)
    return Z - lr * G / n

Z = rng.normal(0, 0.3, (T, 2, A))
print(f"초기 학생 성공률          {success(student(Z)):.3f}")
offs, acts, _ = rollout(TP, 256, np.random.default_rng(2))
print(f"teacher 데이터: 응답당 off-track 방문 {offs.sum(1).mean():.3f}회")
for _ in range(60):
    Z = ce_step(Z, offs, acts)
rec = lambda Z: softmax(Z)[np.arange(T), 1, r_star].mean()
print(f"off-policy 증류 뒤         {success(student(Z)):.3f}  (복구 행동 확률 {rec(Z):.2f})")
R = np.random.default_rng(3)
for it in range(40):
    o2, a2, _ = rollout(student(Z), 32, R)        # 학생이 직접 생성
    Z = ce_step(Z, o2, a2, teacher_target=True)   # 그 상태에서 teacher 분포를 따라간다
print(f"+ on-policy 증류 뒤        {success(student(Z)):.3f}  (복구 행동 확률 {rec(Z):.2f})")
best = np.zeros((T, 2, A)); best[np.arange(T), 0, a_star] = 30; best[np.arange(T), 1, r_star] = 30
print(f"용량 λ={lam}에서의 상한    {success(student(best)):.3f}")
 

off-policy 단계 뒤 복구 행동 확률이 낮게 남고, on-policy 단계가 그것을 거의 teacher 수준으로 끌어올린다. 정상 경로의 정답률은 두 단계 모두 비슷하다. 차이는 전부 “학생이 스스로 만든 상태”에서 나온다.

RL과 비교하면 신호의 밀도가 다르다. RL(GRPO)은 응답 하나에 스칼라 보상 하나를 받는다. on-policy 증류는 응답의 모든 토큰 위치에서 vocabulary 전체에 대한 teacher 분포를 받는다. 보고서 Table 21은 같은 off-policy 증류 8B 체크포인트에서 출발한 두 방법을 비교한다.

방법 (Qwen3-8B)AIME’24AIME’25MATH500LiveCodeBench v5MMLU-ReduxGPQA-DiamondGPU 시간
Off-policy 증류55.0 (90.0)42.8 (83.3)92.442.086.455.6–
+ RL67.6 (90.0)55.5 (83.3)94.852.986.961.317,920
+ On-policy 증류74.4 (93.3)65.5 (86.7)97.060.388.363.31,800
괄호는 pass@64. 보고서 Table 21.

RL은 pass@1을 올렸지만 pass@64는 그대로(90.0, 83.3)였고, 증류는 pass@64도 올렸다. 보고서는 이것을 teacher logit이 학생의 탐색 공간을 넓힌 증거로 해석한다. RL이 base가 이미 풀 수 있는 것의 확률을 모으는 데 그친다는 관찰(Yue et al. 2025)과 같은 방향이다.

PyTorch PyTorch: on-policy 증류 손실 (참고용) 로컬에서 실행run locally (pip install torch)
import torch
import torch.nn.functional as F

@torch.no_grad()
def sample(student, tok, prompts, max_new_tokens=4096, thinking=True):
    # 학생이 직접 응답을 만든다: /think 또는 /no_think 모드를 섞어서
    texts = [tok.apply_chat_template([{"role": "user", "content": p}], tokenize=False,
                                     add_generation_prompt=True, enable_thinking=thinking) for p in prompts]
    tok.padding_side = "left"
    enc = tok(texts, return_tensors="pt", padding=True).to(student.device)
    out = student.generate(**enc, do_sample=True, temperature=1.0, max_new_tokens=max_new_tokens)
    resp_mask = torch.zeros_like(out, dtype=torch.bool)
    resp_mask[:, enc.input_ids.shape[1]:] = True
    resp_mask &= out.ne(tok.pad_token_id)
    return out, enc.attention_mask, resp_mask

def on_policy_distill_loss(student, teacher, seqs, prompt_attn, resp_mask):
    attn = torch.cat([prompt_attn, resp_mask[:, prompt_attn.shape[1]:].long()], dim=1)
    s_logits = student(seqs, attention_mask=attn).logits[:, :-1]        # 위치 t가 토큰 t+1을 예측
    with torch.no_grad():
        t_logits = teacher(seqs, attention_mask=attn).logits[:, :-1]    # 같은 토크나이저여야 한다
    mask = resp_mask[:, 1:].float()                                     # 응답 토큰만
    s_logp = F.log_softmax(s_logits.float(), -1)
    t_logp = F.log_softmax(t_logits.float(), -1)
    # 학생이 방문한 prefix마다 vocabulary 전체에서 reverse KL(π_θ || π_T)
    kl = (s_logp.exp() * (s_logp - t_logp)).sum(-1)
    return (kl * mask).sum() / mask.sum()

# for step in range(num_steps):
#     seqs, pattn, rmask = sample(student, tok, next(prompt_iter), thinking=random.random() < 0.5)
#     loss = on_policy_distill_loss(student, teacher, seqs, pattn, rmask)
#     loss.backward(); opt.step(); opt.zero_grad()
 
확인 문제Check yourself

Qwen3-8B에서 같은 off-policy 증류 체크포인트로부터 RL과 on-policy 증류를 비교했다. 보고서 Table 21에서 확인되는 것은?

on-policy 증류는 AIME’24 74.4(93.3), AIME’25 65.5(86.7)로 RL의 67.6(90.0), 55.5(83.3)보다 pass@1과 pass@64가 모두 높고, GPU 시간은 1,800 대 17,920이다. RL은 pass@64를 off-policy 출발점(90.0, 83.3)에서 바꾸지 못했다.

실험 결과

플래그십 thinking 모드. Qwen3-235B-A22B는 AIME’24 85.7, AIME’25 81.5, LiveCodeBench v5 70.7, CodeForces 2,056, BFCL v3 70.8이다(Table 11). 같은 표에서 Gemini 2.5 Pro가 대부분 앞서고, o1·DeepSeek-R1과는 항목별로 엇갈린다. GPQA-Diamond(71.1)는 비교 모델 중 가장 낮다.

출처Source: Qwen3 report, Table 11 (thinking mode)
Qwen3-235B-A22B (thinking) versus reasoning models. Tick All to see every benchmark at once as the difference from the across-model mean (points). A dash (–) means the value is not in the source. Qwen3-235B-A22B (thinking)과 추론 모델들. 모두를 켜면 각 벤치마크에서 모델 평균과의 차이(점)를 한 번에 본다. 값이 없는 칸(–)은 보고서에 없는 값이다.

The evaluation settings matter. AIME is the mean of 64 samples per problem, GPQA-Diamond the mean of 10. BFCL evaluates Qwen3 in FC format, while some baselines take the higher of FC and Prompt from the leaderboard. LiveCodeBench in thinking mode removes a restriction sentence from the prompt (§4.6).

Base models. The report says 235B-A22B-Base beats DeepSeek-V3-Base on 14 of 15 benchmarks with about 1/3 of the total and 2/3 of the active parameters (Table 3) — e.g. MMLU-Pro 68.18 vs 59.84, MATH 71.84 vs 62.62, GSM8K 94.39 vs 87.57 — and trails only on INCLUDE, 73.46 vs 75.17.

Stage-by-stage effect (Table 22, Qwen3-32B). The most candid table in the report.

BenchmarkStage 2 ThinkingStage 3 ThinkingStage 3 Non-thinkStage 4 ThinkingStage 4 Non-think
ThinkFollow*–88.798.9
ToolUse*63.370.473.285.586.5
IFEval strict73.078.478.485.083.2
BFCL v369.068.461.570.363.0
AIME’2483.881.928.581.431.0
LiveCodeBench v568.467.231.165.731.3
* in-house benchmarks. Report Table 22.

Mode-switching accuracy (ThinkFollow) is 88.7 after Stage 3 and 98.9 after general RL. The price: thinking-mode AIME’24 and LiveCodeBench peak at Stage 2 and then drop 1.5–2.4 points. The report states explicitly that this trade-off was accepted for generality.

Long context. On RULER at 128K, the 235B scores 90.6 in non-thinking mode and 86.0 in thinking mode (budget 8,192) (Table 23). The report reads it as thinking getting in the way on retrieval tasks.

Reading critically

  • Almost no training hyperparameters. Optimizer, peak LR, batch size, precision and pre-training FLOPs are missing; there is only the sentence “predicted with scaling laws”.
  • No mixture ratios. Instance-level mixing is described, but neither the resulting ratios nor the proxy experiments are given. There is also no check of how much the trillions of synthetic tokens overlap the benchmarks (beyond removing validation-like samples in the cold-start stage).
  • RL recipe. Beyond 3,995 pairs and 170 steps, group size, KL, clip and the entropy-control method are missing. How “off-policy” the training was (how often data was reused) is unclear.
  • The thinking-budget figure can only be read approximately. Figure 2 has no number table, and the AIME’24 point read at the 32K budget (about 86–87) is not exactly Table 11’s 85.7, so it is unclear whether the two evaluations share a setting.
  • Comparison conditions. Many baseline numbers come from official reports or leaderboards, with no guarantee of identical prompts or sample counts; for BFCL the report itself flags the format difference.
  • Scope of the distillation comparison. Table 21 is one 8B case on math and code queries only. Whether the RL side was well tuned, or whether this holds only when the teacher is much stronger than the student, cannot be told.
확인 문제Check yourself

What is the most accurate reason micro-batch LBL hinders expert specialisation in MoE?

∂ LBLmicro/∂Pij∝fij\partial\,\text{LBL}_{\text{micro}}/\partial P^{j}_i \propto f^{j}_i, so experts used heavily inside one micro-batch are penalised. If that micro-batch is all code, the code experts are penalised. The global version penalises by the global frequency fˉi\bar f_i, so the penalty is minimal (= 1) when each domain uses different experts and only the overall load is even.

Summary

  • Qwen3 is 6 dense models plus 2 MoE models (30B-A3B, 235B-A22B). The MoE uses 8 of 128 experts, no shared expert, and global-batch LBL that allows domain specialisation.
  • Pre-training is 36T tokens in three stages — general (30T+) → reasoning (~5T) → long context (32K) — with hyperparameters said to come from per-stage scaling laws.
  • Flagship post-training: cold start → GRPO reasoning RL (3,995 pairs, AIME’24 70.1 → 85.1) → thinking mode fusion → general RL. The empty-think-block template enables mode switching and the thinking budget.
  • The thinking budget is an untrained ability, yet gives a smooth accuracy curve from 1K to 32K.
  • Small models come from off-policy → on-policy distillation. The key is teacher distributions in student-visited states; on 8B it beat RL at 1/10 of the GPU hours (Table 21).
  • General RL raises generality but cost the thinking-mode math and code peaks 1–2 points (Table 22).

평가 설정이 결과를 좌우한다. AIME는 문제당 64번 샘플의 평균, GPQA-Diamond는 10번 평균이다. BFCL은 Qwen3를 FC 형식으로, 일부 baseline은 리더보드에서 FC와 Prompt 중 높은 점수를 가져왔다. LiveCodeBench는 thinking 모드에서 프롬프트의 제약 문구를 빼고 평가했다(§4.6).

base 모델. 235B-A22B-Base는 DeepSeek-V3-Base 대비 총 파라미터 약 1/3, 활성 2/3로 15개 중 14개 벤치마크에서 앞선다고 보고한다(Table 3). 예를 들어 MMLU-Pro 68.18 vs 59.84, MATH 71.84 vs 62.62, GSM8K 94.39 vs 87.57, INCLUDE에서만 73.46 vs 75.17로 뒤진다.

단계별 효과(Table 22, Qwen3-32B). 가장 정직한 표다.

벤치마크Stage 2 ThinkingStage 3 ThinkingStage 3 Non-thinkStage 4 ThinkingStage 4 Non-think
ThinkFollow*–88.798.9
ToolUse*63.370.473.285.586.5
IFEval strict73.078.478.485.083.2
BFCL v369.068.461.570.363.0
AIME’2483.881.928.581.431.0
LiveCodeBench v568.467.231.165.731.3
*는 사내 벤치마크. 보고서 Table 22.

모드 전환 정확도(ThinkFollow)는 Stage 3에서 88.7, General RL 뒤 98.9가 된다. 그 대가로 thinking 모드의 AIME’24와 LiveCodeBench는 Stage 2가 최고점이고 이후 1.5–2.4점 떨어진다. 보고서는 범용성을 위해 이 trade-off를 받아들였다고 명시한다.

장문맥. RULER에서 non-thinking 모드의 235B는 128K에서 90.6, thinking 모드(예산 8,192)는 86.0이다(Table 23). 검색형 과제에서는 사고가 오히려 방해된다고 해석한다.

비판적으로 읽기

  • 학습 하이퍼파라미터가 거의 없다. optimizer, peak LR, 배치 크기, 정밀도, 사전학습 FLOPs가 빠져 있다. “scaling law로 예측했다”는 문장만 있다.
  • 데이터 혼합 비율 비공개. 인스턴스 단위 혼합을 했다고 하지만 결과 비율도, proxy 실험도 없다. 합성 데이터 수 조 토큰이 벤치마크와 얼마나 겹치는지 검증한 결과도 없다(cold start 단계에서 검증셋 유사 샘플을 걸렀다는 언급뿐).
  • RL 레시피. 3,995개 쌍, 170 step 외에 그룹 크기, KL, clip, 엔트로피 제어 방법이 없다. “off-policy training”의 정도(몇 번 재사용했는지)도 불명이다.
  • thinking budget 그림은 근삿값으로만 읽힌다. Figure 2에는 수치 표가 없다. 그림에서 읽은 32K 예산의 AIME’24 점(약 86–87)도 Table 11의 85.7과 정확히 같지 않아, 두 평가의 설정이 같은지 알 수 없다.
  • 비교 조건. baseline 숫자 상당수가 공식 보고값이나 리더보드에서 왔고, 평가 프롬프트·샘플 수가 모델마다 같다는 보장이 없다. BFCL처럼 형식 선택이 다른 경우는 보고서가 직접 밝혔다.
  • 증류 비교의 범위. Table 21은 수학·코드 질의만 쓴 8B 한 사례다. RL 쪽이 충분히 튜닝됐는지, teacher가 학생보다 훨씬 강할 때만 성립하는지는 알 수 없다.
확인 문제Check yourself

micro-batch LBL이 MoE의 expert 전문화를 방해하는 이유로 가장 정확한 것은?

∂ LBLmicro/∂Pij∝fij\partial\,\text{LBL}_{\text{micro}}/\partial P^{j}_i \propto f^{j}_i라서, 한 micro-batch 안에서 많이 쓰인 expert가 벌을 받는다. 그 micro-batch가 코드 시퀀스뿐이면 코드 전용 expert가 벌을 받는다. global 버전은 전역 빈도 fˉi\bar f_i로 벌하므로, 도메인마다 다른 expert를 쓰고 전체 부하만 고르면 벌점이 최소(=1)다.

정리

  • Qwen3는 dense 6종 + MoE 2종(30B-A3B, 235B-A22B)이다. MoE는 128 expert 중 8개, shared expert 없음, global-batch LBL로 도메인 전문화를 허용한다.
  • 사전학습은 36T 토큰, 일반(30T+) → 추론(약 5T) → 장문맥(32K) 3단계이고, 하이퍼파라미터는 단계별 scaling law로 정했다고만 밝힌다.
  • 플래그십 사후학습은 cold start → GRPO reasoning RL(3,995쌍, AIME’24 70.1 → 85.1) → thinking mode fusion → general RL. 빈 think 블록 템플릿이 모드 전환과 thinking budget을 가능하게 한다.
  • thinking budget은 학습하지 않은 능력이지만 1K–32K에서 매끄러운 정확도 곡선을 만든다.
  • 소형 모델은 off-policy → on-policy 증류로 만든다. 학생이 방문한 상태에서 teacher 분포를 받는 것이 핵심이며, 8B에서 RL보다 높은 점수를 1/10 GPU 시간에 얻었다(Table 21).
  • general RL은 범용성을 올리는 대신 thinking 모드의 수학·코드 최고점을 1–2점 깎았다(Table 22).

더 읽을거리Further reading