Track VI · Frontier Tech Reports · 13/20

Xiaomi MiMo-V2 — hybrid SWA, 경량 MTP, MOPD, 그리고 V2.6의 RL 스케일링Xiaomi MiMo-V2 — hybrid SWA, light MTP, MOPD, and V2.6's RL scaling

MiMo-V2-Flash(309B/15B) 보고서로 128-token sliding window + attention sink 하이브리드, 추측 디코딩용 경량 MTP, 다중 교사 on-policy distillation(MOPD)을 직접 계산해 보고, 후속 MiMo-V2.6 보고서의 대규모 agent RL(groupwise grading, router freezing, reward hacking 방어)까지 읽는다.Using the MiMo-V2-Flash report (309B/15B), compute the 128-token sliding-window + attention-sink hybrid, the light MTP used for speculative decoding, and multi-teacher on-policy distillation (MOPD) yourself, then read the follow-up MiMo-V2.6 report on large-scale agent RL (groupwise grading, router freezing, reward-hacking defences).

In May 2025 Xiaomi’s LLM-Core team published MiMo-7B, arguing that “a small model works if it is designed for reasoning from pre-training on”. MiMo-V2-Flash (January 2026) is the same team’s first flagship at 309B MoE scale, and MiMo-V2.6 (released September 2026; 1.02T Pro, 310B Flash) is the follow-up that greatly scales RL compute on the same hybrid-SWA backbone. The two reports differ in character: V2-Flash is about architecture and a post-training paradigm (MOPD), while V2.6 is almost entirely about “how we scaled agent RL”. This lesson reads V2-Flash as the spine and then looks at what V2.6 added on the RL side.

At a glance

MiMo-V2-FlashMiMo-V2.6-FlashMiMo-V2.6-Pro
Releasereport 2026-01 (arXiv 2601.02780)2026-09 (PDF report in the HF repo)same
Total / active params309B / 15B310B / 15B1.02T / 42B
Layers (total/SWA/GA)48 / 39 / 948 / 39 / 970 / 60 / 10
Hidden / experts4096 / 8 of 256, no shared expert4096 / 256→86144 / 384→8
AttentionSWA (W=128, 64Q/8KV) + GA (64Q/4KV), 5:1, sink biassameSWA 128Q/8KV, GA 128Q/8KV
Context32K pre-training → 256K256K → 1M (mid-training)same
Pre-training tokens27T (text)48T (26T text + 22T omni)30T (27T + 3T)
PrecisionFP8 mixed (DeepSeek-V3 style)MXFP4 QAT from mid-trainingsame
Open weightsMIT (HF), incl. 3-layer MTP weightsMITMIT

Sources: V2-Flash report Abstract, Table 1, §3; V2.6 report Table 1, §3. The V2.6-Flash total is copied as the V2.6 report states it (310B).

What is new

  • Aggressive hybrid SWA. One global-attention layer for every five 128-token sliding-window layers. With a learnable attention sink bias, the report finds this tiny window beats an all-global model in 32B experiments.
  • A light MTP as the draft model. Three MTP blocks of 0.33B each (dense FFN + SWA) give accept length up to 3.6 and up to 2.6× faster decoding. The motivation is RL rollout speed as much as inference.
  • MOPD (Multi-Teacher On-Policy Distillation). To merge teachers RL-trained per domain into one student, the student samples its own tokens and receives the teacher’s log-ratio as a token-level reward, added to an ORM advantage.
  • (V2.6) Scaling RL compute. 1,568 prompts × 16 rollouts per step, 2.7–3.7B tokens, RL cost US2.6M(Pro)andUS2.6M (Pro) and US0.9M (Flash). The key pieces are groupwise agentic grading beyond test pass/fail, MoE router freezing, and layered reward-hacking defences.

Architecture

Hybrid blocks

V2-Flash is a standard Transformer + MoE backbone that mixes two kinds of attention. Eight hybrid blocks each consist of five SWA blocks and one GA block, and only the very first layer is GA + dense FFN to stabilise early representation learning (48/39/9 in Table 1). All other 47 layers use an MoE FFN choosing 8 of 256 experts, with no shared expert. Both attentions are GQA with head dims QK 192 and V 128, and RoPE is applied only to the first 64 dimensions of Q and K (partial RoPE).

Sliding-window attention lets token ii see only [i−W+1,i][i-W+1, i]. The KV cache of an SWA layer is then fixed at WW entries regardless of context length, and its attention cost is O(LW)O(LW). The long-context cost remains O(L2)O(L^2) only in the GA layers.

Xiaomi의 LLM-Core 팀은 2025년 5월 MiMo-7B로 “작은 모델도 사전학습부터 추론용으로 설계하면 된다”는 보고서를 냈다. 2026년 1월의 MiMo-V2-Flash는 같은 팀이 309B MoE로 체급을 올린 첫 플래그십이고, 2026년 9월에 공개된 MiMo-V2.6(1.02T Pro, 310B Flash)은 같은 hybrid-SWA 뼈대 위에서 RL 컴퓨트를 크게 늘린 후속작이다. 두 보고서는 성격이 다르다. V2-Flash는 아키텍처와 사후학습 패러다임(MOPD)의 보고서이고, V2.6은 거의 전부가 “agent RL을 어떻게 키웠나”에 관한 보고서다. 이 레슨은 V2-Flash를 축으로 읽고, RL 부분은 V2.6이 무엇을 더했는지 이어서 본다.

한눈에

MiMo-V2-FlashMiMo-V2.6-FlashMiMo-V2.6-Pro
공개보고서 2026-01 (arXiv 2601.02780)2026-09 (HF 저장소의 PDF 보고서)같음
총 / 활성 파라미터309B / 15B310B / 15B1.02T / 42B
층 (전체/SWA/GA)48 / 39 / 948 / 39 / 970 / 60 / 10
hidden / experts4096 / 256개 중 8개, shared 없음4096 / 256→86144 / 384→8
attentionSWA(W=128, 64Q/8KV) + GA(64Q/4KV), 5:1, sink bias같음SWA 128Q/8KV, GA 128Q/8KV
context32K 사전학습 → 256K256K → 1M (mid-training)같음
사전학습 토큰27T (텍스트)48T (텍스트 26T + omni 22T)30T (27T + 3T)
정밀도FP8 mixed (DeepSeek-V3 방식)mid-training부터 MXFP4 QAT같음
공개 가중치MIT (HF), 3-layer MTP 가중치 포함MITMIT

출처: V2-Flash 보고서 Abstract·Table 1·§3, V2.6 보고서 Table 1·§3. V2.6-Flash의 총 파라미터는 V2.6 보고서 표기(310B)를 그대로 옮겼다.

무엇이 새로운가

  • 공격적인 hybrid SWA. 128 토큰짜리 sliding window 층 5개마다 global attention 층 1개. learnable attention sink bias를 넣으면 이렇게 작은 window로도 32B 실험에서 전부 global인 모델보다 낫다고 보고한다.
  • 경량 MTP를 draft 모델로. 층당 0.33B(dense FFN + SWA)짜리 MTP 블록 3개로 accept length 최대 3.6, 디코딩 최대 2.6배. 추론뿐 아니라 RL rollout 가속이 동기다.
  • MOPD(Multi-Teacher On-Policy Distillation). 도메인별로 RL한 교사들을 학생 하나에 합칠 때, 학생이 스스로 뽑은 토큰에 교사의 log 비율을 토큰 단위 보상으로 준다. ORM advantage와 더해 쓴다.
  • (V2.6) RL 컴퓨트 스케일링. step당 1,568 프롬프트 × 16 rollout, 2.7–3.7B 토큰, RL 비용 Pro 260만 달러·Flash 90만 달러. 테스트 통과 여부를 넘어서는 groupwise agentic grading, MoE router freezing, 다층 reward hacking 방어가 핵심이다.

아키텍처

하이브리드 블록

V2-Flash는 표준 Transformer + MoE 뼈대에 attention만 두 종류를 섞는다. 8개의 hybrid block이 각각 SWA 블록 5개와 GA 블록 1개로 이뤄지고, 맨 첫 층만은 초기 표현 학습을 안정시키려고 GA + dense FFN이다(Table 1의 48/39/9). 나머지 47층은 모두 256개 expert 중 8개를 고르는 MoE FFN이고 shared expert가 없다. 두 attention 모두 GQA이며 head 차원은 QK 192, V 128이고, RoPE는 Q·K의 앞 64차원에만 건다(partial RoPE).

sliding window attention은 토큰 ii가 [i−W+1,i][i-W+1, i]만 보게 한다. 그러면 SWA 층의 KV cache는 문맥 길이와 무관하게 WW개로 고정되고, 그 층의 attention 연산도 O(LW)O(LW)가 된다. 긴 문맥 비용은 GA 층에서만 O(L2)O(L^2)로 남는다.

SWA/GA 층SWA/GA layers – KV (BF16, 1 시퀀스1 sequence) all-GA – hybrid – 절감saving – L→∞ 한계limit –
The strip is the 48 layers (■ GA, ■ SWA; the first layer is GA + dense FFN). Change N and the strip is re-laid out and the curves below change. An SWA layer stores K·V only for the most recent W tokens, so once L exceeds W it goes flat and almost all memory comes from the GA layers. The saving therefore converges to 48·4 / (number of GA layers·4) as L grows. With the report's setting (N=5, W=128) the limit is 48/9 ≈ 5.3×; the report's "about 6×" is a rounding that comes from the 5:1 ratio. 위 띠는 48개 층이다(■ GA, ■ SWA, 첫 층은 GA + dense FFN). N을 바꾸면 띠가 다시 배치되고 아래 곡선이 달라진다. SWA 층은 최근 W개 토큰의 K·V만 저장하므로 L이 W를 넘으면 평평해지고, 메모리는 거의 전부 GA 층에서 나온다. 그래서 L이 커질수록 절감 비율은 48·4 / (GA 층 수·4)로 수렴한다. 보고서 설정(N=5, W=128)에서 한계는 48/9 ≈ 5.3배다. 보고서가 말하는 "약 6배"는 5:1 비율에서 나온 어림이다.

Written out: split the layers into SWA (S\mathcal{S}) and GA (G\mathcal{G}), let hkvh^{\text{kv}} be the number of KV heads and d=192+128d=192+128 the K plus V dimension per head. The number of KV elements for one sequence is

KV(L)=∑ℓ∈GL hGAkv d  +  ∑ℓ∈Smin⁡(L,W) hSWAkv d.\text{KV}(L) = \sum_{\ell\in\mathcal{G}} L\, h^{\text{kv}}_{\text{GA}}\, d \;+\; \sum_{\ell\in\mathcal{S}} \min(L, W)\, h^{\text{kv}}_{\text{SWA}}\, d .

For L≫WL \gg W the second term is constant, so relative to a model of the same depth with GA everywhere (4 KV heads) the ratio converges to 48/∣G∣=48/9≈5.348/|\mathcal{G}| = 48/9 \approx 5.3. That the SWA layers use twice as many KV heads (8) is almost free because the window is tiny. The report summarises this as “nearly a 6× reduction in KV cache and attention computation”.

Attention sink bias

A 128-token window creates a problem. Even when nothing useful is in the current window, softmax must still distribute a mass of 1 somewhere. Earlier models learned to “dump” that mass on a fixed position such as the first token (the attention sink described by StreamingLLM), but an SWA layer cannot see the first token. MiMo follows gpt-oss and adds a learnable per-head scalar sink∈R\text{sink}\in\mathbb{R} to the denominator only (report Eq. 2–3):

sij=exp⁡(aij−mi)exp⁡(sink−mi)+∑j′exp⁡(aij′−mi),mi=max⁡ ⁣(max⁡jaij, sink),oi=∑jsijvj.s_{ij} = \frac{\exp(a_{ij}-m_i)}{\exp(\text{sink}-m_i) + \sum_{j'} \exp(a_{ij'}-m_i)},\qquad m_i = \max\!\big(\max_j a_{ij},\ \text{sink}\big),\qquad o_i = \sum_j s_{ij} v_j .

Now ∑jsij=1−esinkesink+∑j′eaij′<1\sum_j s_{ij} = 1 - \frac{e^{\text{sink}}}{e^{\text{sink}} + \sum_{j'} e^{a_{ij'}}} < 1, so a head can choose to “look at nothing”. As sink→−∞\text{sink}\to-\infty it reduces to the ordinary softmax.

계산을 한 줄로 쓰면 이렇다. 층 집합을 SWA(S\mathcal{S})와 GA(G\mathcal{G})로 나누고 KV head 수를 hkvh^{\text{kv}}, head당 K·V 차원 합을 d=192+128d=192+128이라 하면 한 시퀀스의 KV 원소 수는

KV(L)=∑ℓ∈GL hGAkv d  +  ∑ℓ∈Smin⁡(L,W) hSWAkv d.\text{KV}(L) = \sum_{\ell\in\mathcal{G}} L\, h^{\text{kv}}_{\text{GA}}\, d \;+\; \sum_{\ell\in\mathcal{S}} \min(L, W)\, h^{\text{kv}}_{\text{SWA}}\, d .

L≫WL \gg W이면 둘째 항은 상수이므로, 모든 층이 GA(KV head 4개)인 같은 깊이의 모델 대비 비율은 48/∣G∣=48/9≈5.348/|\mathcal{G}| = 48/9 \approx 5.3에 수렴한다. SWA 층이 KV head를 8개로 두 배 쓰는 것은 window가 작아서 거의 공짜다. 보고서는 이를 “KV cache와 attention 연산이 약 6배 줄어든다”고 요약한다.

attention sink bias (학습되는 sink)

window가 128 토큰밖에 안 되면 문제가 하나 생긴다. 지금 보는 window 안에 쓸 만한 정보가 없을 때도 softmax는 질량 1을 어딘가에 나눠 줘야 한다. 예전 모델은 이 질량을 첫 토큰 같은 특정 위치에 “버리는” 법을 배웠는데(StreamingLLM이 말한 attention sink), SWA 층은 첫 토큰을 볼 수 없다. MiMo는 gpt-oss와 같은 방식으로 head마다 학습되는 스칼라 sink∈R\text{sink}\in\mathbb{R}를 분모에만 더한다(보고서 Eq. 2–3).

sij=exp⁡(aij−mi)exp⁡(sink−mi)+∑j′exp⁡(aij′−mi),mi=max⁡ ⁣(max⁡jaij, sink),oi=∑jsijvj.s_{ij} = \frac{\exp(a_{ij}-m_i)}{\exp(\text{sink}-m_i) + \sum_{j'} \exp(a_{ij'}-m_i)},\qquad m_i = \max\!\big(\max_j a_{ij},\ \text{sink}\big),\qquad o_i = \sum_j s_{ij} v_j .

이제 ∑jsij=1−esinkesink+∑j′eaij′<1\sum_j s_{ij} = 1 - \frac{e^{\text{sink}}}{e^{\text{sink}} + \sum_{j'} e^{a_{ij'}}} < 1이라 head가 “아무것도 안 보기”를 선택할 수 있다. sink→−∞\text{sink}\to-\infty이면 보통 softmax로 돌아간다.

window 안 토큰이 받는 질량mass on window tokens Σjsij – sink가 가져간 질량mass taken by the sink – ‖oi‖ –
The grey bar is the sink; blue bars are the attention weights sij on the W tokens in the window. With "nothing relevant" and the sink at its lowest (−6, effectively no sink), softmax must still sum to 1, so it spreads mass over irrelevant tokens and noise leaks into the output oi. Raise the sink and the mass drains into it, shrinking oi toward 0 — the head can say "there is nothing to look at in this window". With one relevant token, that token survives even a fairly large sink. 회색 막대가 sink, 파란 막대가 window 안 토큰 W개의 attention weight sij다. "관련 토큰 없음"에서 sink를 가장 낮게(−6, 사실상 sink 없음) 두면 softmax는 합이 1이어야 하므로 무관한 토큰들에 억지로 질량을 나눠 주고, 출력 oi에 잡음이 섞인다. sink를 올리면 질량이 sink로 빠지고 oi가 0 쪽으로 줄어든다. 즉 "이 window에는 볼 것이 없다"를 표현할 수 있다. 관련 토큰이 하나 있으면 sink가 웬만큼 커도 그 토큰은 살아남는다.

The report’s 32B dense experiment (250B tokens of pre-training, extension to 32K, then the same SFT pipeline) shows the effect of the sink clearly.

Setting (report Tables 2·3·4)MMLUBBHGSM8KMATHGSM-Inf.NoLiMaRULER-32kMRCRAIME24/25LCBGPQA-D
All GA57.354.734.29.512.349.789.432.545.540.041.7
SWA W=128, no sink54.952.436.98.9–––––––
SWA W=128, sink58.356.136.910.317.351.289.434.447.143.948.1
SWA W=512, sink58.354.937.910.017.238.584.719.6–––

The counter-intuitive part is that W=512 is worse than W=128 at long context (NoLiMa 38.5, MRCR 19.6). The report’s hypothesis is division of labour: with a small window, SWA handles only local information and GA handles only long-range dependencies; with a large window, SWA partly and clumsily takes on long-range work and the boundary blurs. The report itself cautions that these are “empirical observations from specific settings of scale, data and procedure”. Why that caveat matters becomes clear in the MiniMax-M2 lesson, which reaches the opposite conclusion.

Let us check the numbers. The code below transcribes Table 1’s layer layout and KV sizes and the sink softmax (Eq. 2–3).

NumPy Hybrid layout, KV cache, attention sink
import numpy as np

NL = 48
def layout(N=5):
    # layer 0 = GA (+dense FFN), then every (N+1)-th layer is GA
    return ['GA' if i == 0 or (i + 1) % (N + 1) == 0 else 'SWA' for i in range(NL)]

def kv_bytes(L, N=5, W=128, hybrid=True):
    tot = 0
    for kind in layout(N):
        if hybrid and kind == 'SWA':
            tot += min(L, W) * 8 * (192 + 128)   # SWA: 8 KV heads, only the last W tokens
        else:
            tot += L * 4 * (192 + 128)           # GA: 4 KV heads, every token
    return 2 * tot                               # BF16 = 2 bytes

lay = layout(5)
print("SWA / GA layers:", lay.count('SWA'), "/", lay.count('GA'), "(Table 1: 39/9)")
for L in [4_096, 32_768, 262_144]:
    f, h = kv_bytes(L, hybrid=False), kv_bytes(L)
    print(f"L={L:>7,}: all-GA {f/1e9:6.2f} GB | hybrid {h/1e9:5.2f} GB | {f/h:4.2f}x")
print("limit as L→∞ = 48/9 =", round(48 / 9, 2))

def attn_with_sink(a, sink):
    """MiMo-V2-Flash Eq.(2)-(3): the sink logit only enters the denominator."""
    m = max(a.max(), sink)
    e = np.exp(a - m)
    return e / (np.exp(sink - m) + e.sum())

rng = np.random.default_rng(0)
a = 0.6 * rng.standard_normal(128)      # a window with no relevant token at all
v = rng.standard_normal((128, 4))
print()
for sink in [-30.0, 0.0, 2.0, 5.0]:
    s = attn_with_sink(a, sink)
    print(f"sink={sink:6.1f}: window mass {s.sum():.3f}   |o| = {np.linalg.norm(s @ v):.3f}")
sm = np.exp(a - a.max()); sm /= sm.sum()
print("sink → -inf equals the ordinary softmax:", np.allclose(attn_with_sink(a, -1e9), sm))
 

A sink of 0 does almost nothing against the summed mass of 128 window tokens; it needs to be around log 128 ≈ 4.9 to take half the mass. The learned sink’s magnitude therefore adapts to the window size and the logit distribution.

→ Go deeper: Attention and KV for windows and sinks in general, and Design choices compared for how this SWA ablation sits against MiniMax-M2’s opposite result.

A light MTP as the draft model

MTP (multi-token prediction) is a small block that, as in DeepSeek-V3, takes the main model’s hidden state and the next token’s embedding and predicts the token after that. MiMo cares less about MTP as an auxiliary training loss and more about using it as its own draft model, so the block is deliberately light: a small dense FFN instead of MoE and SWA instead of GA, 0.33B per block. Pre-training attaches a single MTP head (loss weight 0.3 → 0.1); post-training replicates it into K=3K=3 heads trained jointly for multi-step prediction.

The basic arithmetic of speculative decoding is the same as in the inference lesson. Draft kk tokens and verify them with one forward pass of the main model; if each draft is right independently with probability α\alpha, the expected number of tokens per step is

E[len]=∑i=0kαi=1−αk+11−α\mathbb{E}[\text{len}] = \sum_{i=0}^{k} \alpha^{i} = \frac{1-\alpha^{k+1}}{1-\alpha}

(the leading 1 is the bonus token obtained at verification). With k=3k=3 the maximum is 4. Figure 7 of the report finds that, across datasets, the next-token cross-entropy xx and the mean accept length yy follow y=4(1−0.58 x0.58)y = 4(1-0.58\,x^{0.58}) almost exactly (R2=0.995R^2=0.995).

→ Go deeper: Both ends of the model for MTP designs across labs, and Speculative decoding in depth for the acceptance-length math behind the 2.6× speed-up.

보고서의 32B dense 실험(250B 토큰 사전학습 후 32K 확장, SFT까지 같은 파이프라인)은 sink의 효과를 분명하게 보여 준다.

설정 (보고서 Table 2·3·4)MMLUBBHGSM8KMATHGSM-Inf.NoLiMaRULER-32kMRCRAIME24/25LCBGPQA-D
All GA57.354.734.29.512.349.789.432.545.540.041.7
SWA W=128, sink 없음54.952.436.98.9–––––––
SWA W=128, sink58.356.136.910.317.351.289.434.447.143.948.1
SWA W=512, sink58.354.937.910.017.238.584.719.6–––

반직관적인 것은 W=512가 W=128보다 긴 문맥에서 나쁘다는 점이다(NoLiMa 38.5, MRCR 19.6). 보고서의 가설은 분업이다. window가 작으면 SWA는 지역 정보만, GA는 장거리 의존성만 맡게 되고, window가 크면 SWA가 장거리 일부를 어설프게 떠맡아 경계가 흐려진다는 것이다. 보고서 스스로 “특정 규모·데이터·절차에서 얻은 경험적 관찰”이라고 단서를 단다. 이 단서가 왜 중요한지는 MiniMax-M2 레슨에서 정반대의 결론을 볼 때 드러난다.

숫자로 확인해 두자. 아래 코드는 Table 1의 층 배치와 KV 크기, sink가 있는 softmax(Eq. 2–3)를 그대로 옮긴 것이다.

NumPy hybrid 배치, KV cache, attention sink
import numpy as np

NL = 48
def layout(N=5):
    # layer 0 = GA (+dense FFN), then every (N+1)-th layer is GA
    return ['GA' if i == 0 or (i + 1) % (N + 1) == 0 else 'SWA' for i in range(NL)]

def kv_bytes(L, N=5, W=128, hybrid=True):
    tot = 0
    for kind in layout(N):
        if hybrid and kind == 'SWA':
            tot += min(L, W) * 8 * (192 + 128)   # SWA: 8 KV heads, 최근 W 토큰만
        else:
            tot += L * 4 * (192 + 128)           # GA: 4 KV heads, 모든 토큰
    return 2 * tot                               # BF16 = 2 bytes

lay = layout(5)
print("SWA / GA layers:", lay.count('SWA'), "/", lay.count('GA'), "(Table 1: 39/9)")
for L in [4_096, 32_768, 262_144]:
    f, h = kv_bytes(L, hybrid=False), kv_bytes(L)
    print(f"L={L:>7,}: all-GA {f/1e9:6.2f} GB | hybrid {h/1e9:5.2f} GB | {f/h:4.2f}x")
print("L→∞ 한계 = 48/9 =", round(48 / 9, 2))

def attn_with_sink(a, sink):
    """MiMo-V2-Flash Eq.(2)-(3): sink 로짓이 분모에만 들어간다."""
    m = max(a.max(), sink)
    e = np.exp(a - m)
    return e / (np.exp(sink - m) + e.sum())

rng = np.random.default_rng(0)
a = 0.6 * rng.standard_normal(128)      # window 안에 관련 토큰이 하나도 없는 경우
v = rng.standard_normal((128, 4))
print()
for sink in [-30.0, 0.0, 2.0, 5.0]:
    s = attn_with_sink(a, sink)
    print(f"sink={sink:6.1f}: window 질량 {s.sum():.3f}   |o| = {np.linalg.norm(s @ v):.3f}")
sm = np.exp(a - a.max()); sm /= sm.sum()
print("sink → -inf 이면 보통 softmax와 같다:", np.allclose(attn_with_sink(a, -1e9), sm))
 

sink가 0이면 window 128개 토큰의 질량 합 앞에서 거의 효과가 없고, sink ≈ log 128 ≈ 4.9 근처가 되어야 질량의 절반을 가져간다. 학습된 sink 값의 크기는 window 크기와 로짓 분포에 맞춰 정해진다는 뜻이다.

→ 더 깊이: window와 sink 일반은 Attention과 KV, 이 SWA ablation이 MiniMax-M2의 반대 결과와 어떻게 맞서는지는 설계 선택 비교.

경량 MTP를 draft 모델로

MTP(multi-token prediction)는 DeepSeek-V3처럼 본 모델의 hidden state와 다음 토큰 embedding을 받아 그다음 토큰을 예측하는 작은 블록이다. MiMo는 이 블록을 학습 보조 손실보다 자기 자신의 draft 모델로 쓰는 데 무게를 둔다. 그래서 블록을 일부러 가볍게 만든다. MoE 대신 작은 dense FFN, GA 대신 SWA를 써서 블록당 0.33B다. 사전학습 때는 MTP head 하나만 붙이고(손실 가중치 0.3 → 0.1), 사후학습에서 이를 K=3K=3개로 복제해 다단계 예측을 함께 학습한다.

추측 디코딩의 기본 계산은 추론 최적화 레슨과 같다. draft 토큰 kk개를 뽑고 본 모델이 한 번의 forward로 검증하면, 각 draft가 독립적으로 확률 α\alpha로 맞는다는 단순 모델에서 한 step에 얻는 토큰 수의 기대값은

E[len]=∑i=0kαi=1−αk+11−α\mathbb{E}[\text{len}] = \sum_{i=0}^{k} \alpha^{i} = \frac{1-\alpha^{k+1}}{1-\alpha}

이다(마지막 항 1은 검증 때 덤으로 얻는 토큰). k=3k=3이면 상한은 4다. 보고서 Figure 7은 데이터셋마다 다음 토큰 cross-entropy xx와 평균 accept length yy가 y=4(1−0.58 x0.58)y = 4(1-0.58\,x^{0.58}) (R2=0.995R^2=0.995)로 거의 정확히 맞는다고 보고한다.

→ 더 깊이: 여러 lab의 MTP 설계는 모델의 양 끝, 2.6배 가속 뒤의 수락 길이 계산은 Speculative decoding 심화.

accept length (보고서 fitreport fit) – i.i.d. 모델로 역산한α implied by the i.i.d. model α (k=3) – Table 10 보간 speedupTable 10 interpolated speed-up –
batchw/o MTP2.83.03.23.43.63.8
321.00×1.86×1.99×2.12×2.25×2.39×2.52×
481.00×1.82×1.95×2.08×2.21×2.34×2.47×
641.00×1.97×2.11×2.25×2.39×2.53×2.67×
961.00×1.99×2.13×2.28×2.42×2.56×2.70×
1281.00×1.82×1.94×2.07×2.20×2.33×2.46×
Drag x and the left dot moves along the report's empirical fit (R²=0.995). Easy-to-predict (low-entropy) output such as WebDev gets close to 3.6 accepted tokens; uncertain output such as MMLU-Pro gets shorter runs. The right panel is the simple model "each draft token is right independently with probability α". With three MTP layers (k=3) the maximum is 4 tokens (3 drafts + 1 bonus token from verification). The table is the report's measured speed-up (Table 10); it is almost linear in accept length. At the same accept length the speed-up starts between 1.8× and 2.0× depending on batch size. x를 끌면 왼쪽 점이 보고서의 경험식(R²=0.995) 위를 움직인다. WebDev처럼 예측이 쉬운(낮은 entropy) 출력은 3.6 토큰 가까이 받아들여지고, MMLU-Pro처럼 불확실한 출력은 짧아진다. 오른쪽은 "각 draft 토큰이 독립적으로 확률 α로 맞는다"는 단순 모델이다. 3개의 MTP 층(k=3)이면 최대 4토큰(draft 3 + 검증 때 덤으로 얻는 1)이다. 아래 표는 보고서 Table 10의 실측 speedup으로, accept length에 거의 선형이다. 같은 accept length라도 batch에 따라 1.8–2.0배에서 시작한다.

Why does this matter for RL? Section 2.3.1 of the report gives two reasons. Decoding is memory-bound, and a larger batch does not raise the arithmetic intensity of attention; MTP adds parallelism along the token dimension and raises the arithmetic intensity of both FFN and attention. And the end of an RL rollout leaves a long tail of stragglers with batch size near 1, which is exactly where MTP helps most. In other words, it makes small-batch, near-on-policy RL affordable. V2.6 replaced this drafter with a DFlash-style block-diffusion drafter (5 layers, 7 tokens at once; V2.6 report §2.4).

Data

27T pre-training tokens. Sources are public web, books, papers, code, math and STEM material, and the pipeline largely follows MiMo-7B. The difference is a deliberate shift toward data with long-range dependencies: long web documents, repository-level code, and PR, issue and commit histories (§3). Training has three stages.

StageToken rangeContextData
Stage 1 pre-training0 – 22T32Kgeneral high-quality corpus
Stage 2 mid-training22 – 26T32Kcode upsampled, about 5% synthetic reasoning data
Stage 3 context extension26 – 27T256KStage 2 mixture + upsampled long-dependency data

Mixture ratios and the concrete dedup and filtering numbers are not disclosed.

Post-training data. SFT uses “millions” of thinking and non-thinking samples whose responses come from in-house domain-specialised checkpoints. The agent RL data (Table 8):

AgentTasksEnvironmentPrompts
Code agent90Kreal (GitHub issues)real
Code agent30Kreal (Stack Overflow/Exchange → terminal)synthesised
Search agent150Krealsynthesised (fact-graph expansion)
General agent50Ksynthesisedsynthesised

Code-agent environments come from a pipeline that builds container images from repository snapshots automatically (8 languages, 70% success rate) and run on more than 10,000 concurrent Kubernetes pods. There are only three tools: bash, str_replace, finish. The web-development agent is rewarded by a multimodal verifier that watches rendered videos (less visual hallucination than static screenshots).

V2.6 RL data. The domain mix is agentic and competitive coding 68%, general tool use 12%, design 13%, context following 3%, and cybersecurity 4% (V2.6 §5.1). Coding tasks are synthesised along five paths — GitHub PRs, in-house development requests, specification-driven tasks, functionality extracted from existing code (CodeMidas), and long-horizon tasks — and reward correctness is checked in two directions. A coding agent attempts each task four times; an auditing agent then reads the patches and conversation logs and flags “passed but wrong” (false positives) and “failed but correct” (false negatives); and F2P/P2P outcomes before and after the reference patch must be identical across eight reruns.

Training

Pre-training recipe (V2-Flash §3.2)

  • Optimisation. AdamW (β1=0.9\beta_1=0.9, β2=0.95\beta_2=0.95, weight decay 0.1), gradient clip 1.0. LR warms up 0 → 3.2×10−43.2\times10^{-4} over 50B tokens, stays constant for 12T tokens, decays by cosine to 1.0×10−41.0\times10^{-4} over 10T tokens, and in Stage 2 to 3.0×10−53.0\times10^{-5} over 4T. The batch ramps to 2,048 over the first 500B tokens.
  • MoE balance. A sequence aux loss coefficient of 10−510^{-5} together with expert-bias updates (factor 0.001; DeepSeek-V3-style auxiliary-loss-free balancing).
  • RoPE and extension. At 32K, RoPE base 640,000 for GA and 10,000 for SWA. For the 256K extension only GA goes to 5,000,000; SWA’s positional range does not change because its window is 128. The extension stage uses batch 256 and LR 3×10−5→10−53\times10^{-5}\to10^{-5}.
  • Precision. FP8 mixed precision; attention output projections, embeddings and the output head stay in BF16 and the MoE router in FP32.

Post-training: SFT → domain teachers → MOPD

V2-Flash post-training has three stages: (1) general SFT, (2) independent RL (or SFT) per domain — math, reasoning, safety, search, coding, tool use — to create teachers, and (3) MOPD, in which one student samples from its own distribution and receives token-level supervision from that domain’s teacher. The key point is merging by on-policy RL instead of parameter merging or a static dataset generated by the teachers.

A diagnostic the report stresses for SFT is interesting: the number of parameters with zero gradient (num-zeros). A rising count signals deteriorating expert load balance; a falling count signals overfitting. To keep it stable they used an expert-bias update rate of 10−410^{-4}, AdamW ϵ=10−8\epsilon=10^{-8}, aux loss 10−610^{-6}, LR 5×10−5→5×10−65\times10^{-5}\to5\times10^{-6}, and batch 128.

The MOPD objective. Let πθ\pi_\theta be the student in the training engine, μθ\mu_\theta the sampling policy in the inference engine, and πdom(x)\pi_{\text{dom}(x)} the teacher for the domain of prompt xx. The reverse KL over tokens sampled from the student is

LRKL(θ)=− Eyt∼πθ[log⁡πdom(x)(yt∣x,y<t)πθ(yt∣x,y<t)],\mathcal{L}_{\text{RKL}}(\theta) = -\,\mathbb{E}_{y_t\sim\pi_\theta}\left[\log\frac{\pi_{\text{dom}(x)}(y_t\mid x,y_{<t})}{\pi_\theta(y_t\mid x,y_{<t})}\right],

and its gradient equals a policy gradient with log⁡πdomπθ\log\frac{\pi_{\text{dom}}}{\pi_\theta} as the advantage (checked in code below). Adding an importance weight and mask that correct training–inference mismatch (following Zhao et al. 2025) gives the surrogate of report Eq. 7–9:

LMOPD(θ)=− Ey∼μθ[1∣y∣∑t=1∣y∣wt A^tlog⁡πθ(yt∣x,y<t)],\mathcal{L}_{\text{MOPD}}(\theta) = -\,\mathbb{E}_{y\sim\mu_\theta}\left[\frac{1}{|y|}\sum_{t=1}^{|y|} w_t\, \hat A_t \log\pi_\theta(y_t\mid x,y_{<t})\right],wt={sg⁡ ⁣[πθ(yt)μθ(yt)]ϵlow≤πθμθ≤ϵhigh0otherwise,A^t=sg⁡ ⁣[log⁡πdom(x)(yt)πθ(yt)]+α A^ORM.w_t = \begin{cases}\operatorname{sg}\!\left[\dfrac{\pi_\theta(y_t)}{\mu_\theta(y_t)}\right] & \epsilon_{\text{low}}\le \dfrac{\pi_\theta}{\mu_\theta}\le\epsilon_{\text{high}}\\[4pt] 0 & \text{otherwise}\end{cases},\qquad \hat A_t = \operatorname{sg}\!\left[\log\frac{\pi_{\text{dom}(x)}(y_t)}{\pi_\theta(y_t)}\right] + \alpha\,\hat A_{\text{ORM}} .

A^ORM\hat A_{\text{ORM}} is a GRPO-style advantage computed from outcome rewards. The report lists as advantages that the teacher can be an RL model, a different SFT model, or the student itself, and that a distilled student can re-enter domain RL to produce stronger teachers (co-evolution). Structurally this is the on-policy distillation of the distillation lesson plus “per-domain teacher routing” and “outcome rewards”.

RL infrastructure. SGLang (inference) and Megatron-LM (training) run in FP8, and the MoE routing mismatch between training and inference is prevented with R3 (reusing the experts chosen at rollout time during training). For multi-turn agents a request-level prefix cache stores the KV cache and routed experts of earlier turns. Partial rollouts use staleness-aware truncated importance sampling (§4.6).

V2.6: what it took to scale RL

The V2.6 RL objective (Eq. 1) is GRPO with a token mask:

L(θ)=− E[1∑i∣oi∣∑i=1G∑t=1∣oi∣ri,t Mi,t Ailog⁡πθ(oi,t∣q,oi,<t)],ri,t=sg⁡ ⁣[πθ(oi,t)μθold(oi,t)].\mathcal{L}(\theta) = -\,\mathbb{E}\left[\frac{1}{\sum_i |o_i|}\sum_{i=1}^{G}\sum_{t=1}^{|o_i|} r_{i,t}\, M_{i,t}\, A_i \log\pi_\theta(o_{i,t}\mid q,o_{i,<t})\right],\qquad r_{i,t} = \operatorname{sg}\!\left[\frac{\pi_\theta(o_{i,t})}{\mu_{\theta_{\text{old}}}(o_{i,t})}\right].

The detailed settings (§5.1) are full of practical lessons.

  • Switching optimiser at mid-training. Pre-training used AdamW, but efficiency dropped in large-batch mixed-task RL, so from mid-training on the hidden matrices use Muown, a Muon variant with row-norm control; embeddings, the LM head and the router stay on AdamW. Prior work reported degradation when switching an Adam-pre-trained model to Muon, but they saw no loss spikes. RL LR is 3×10−63\times10^{-6} with no warmup or weight decay.
  • Asymmetric, adaptive clipping. Separate IS-ratio clip bounds for positive advantages [ϵ+l,ϵ+h][\epsilon^l_+,\epsilon^h_+] and negative advantages [ϵ−l,ϵ−h][\epsilon^l_-,\epsilon^h_-], both initialised at [0.2,5.0][0.2, 5.0] and tuned at runtime from the policy entropy: when entropy is too low, widen the positive bounds and narrow the negative ones.
  • Prompt-mean aggregation. Averaging per prompt rather than over all response tokens keeps response length from growing too fast. Combined with asynchronous partial rollout (staleness 4), a dynamic sampler that drops all-pass and all-fail groups, and training–inference alignment that replays even the top-p candidate sets.
  • Router freezing. See the results section below.

→ Go deeper: The stability playbook — reading RL failures from metrics, and how other labs kept large-scale RL stable.

Deep dive 1 — groupwise agentic grading

The default reward for code-agent RL is binary: “did the tests pass?” If four passing patches in a group get the same reward, patches that swallow exceptions, loosen validation or change evaluation-only configuration just to pass are reinforced exactly as much as clean ones. The V2.6 report says such behaviours did increase (§4.3.2). The fix is to spend compute on grading, in two forms.

GRS (Groupwise Reward Synthesis, offline rubrics). For a subset of high-pass-rate tasks, an agent compares several offline rollouts and writes task-specific solution rubrics and behaviour rubrics. During training a grader agent enters each rollout’s execution environment, assigns rubric scores Sisol,SibehS^{\text{sol}}_i, S^{\text{beh}}_i, and combines them multiplicatively (Eq. 2):

Ri=Ritest⋅Sisol⋅Sibeh.R_i = R^{\text{test}}_i\cdot S^{\text{sol}}_i\cdot S^{\text{beh}}_i .

Because it is a product, failed trajectories stay at 0, and even a group in which everything passes gets a signal from quality differences.

GAR (Groupwise Advantage Redistribution, online). For the remaining tasks, an SFT-trained grader agent compares all trajectories of each mixed-outcome group in a shared workspace. It ranks passing patches along five axes — suitability of the approach, precision of the implementation, minimality of the change, side effects outside the task, and consistency with codebase conventions — and resets the reward to 0 when it confirms that an external answer was copied. With the hack-corrected binary reward RiR_i, group mean Rˉ\bar R, Ai=Ri−RˉA_i = R_i-\bar R, passing set P\mathcal{P} and quality factors fi∈(0,1]f_i\in(0,1] (Eq. 3):

λ=∑j∈PAj∑j∈PfjAj,Ai′={λfiAii∈PAii∉P\lambda = \frac{\sum_{j\in\mathcal{P}} A_j}{\sum_{j\in\mathcal{P}} f_j A_j},\qquad A'_i = \begin{cases}\lambda f_i A_i & i\in\mathcal{P}\\ A_i & i\notin\mathcal{P}\end{cases}

This update preserves ∑i∈PAi′=∑i∈PAi\sum_{i\in\mathcal{P}}A'_i = \sum_{i\in\mathcal{P}}A_i: the total positive mass of the passing trajectories is unchanged and is redistributed in proportion to quality. Merely down-weighting low-quality positive advantages would make the negative mass relatively larger and inflate entropy; the report explains that the renormalisation preserves that balance. In practice λ\lambda is capped, and finally the group mean is subtracted to obtain zero-mean sequence advantages that are broadcast to all response tokens.

왜 이것이 RL에 중요한가. 보고서 §2.3.1의 논리는 두 가지다. 디코딩은 memory-bound라 batch를 키워도 attention의 산술 강도는 오르지 않는데, MTP는 토큰 방향으로 병렬성을 늘려 FFN과 attention 모두의 산술 강도를 올린다. 또 RL rollout의 끝에는 batch가 1에 가까운 긴 꼬리(long-tail straggler)가 남는데, 바로 그 구간에서 MTP의 이득이 가장 크다. on-policy에 가까운 작은 batch RL을 감당할 수 있게 해 준다는 뜻이다. V2.6은 이 drafter를 DFlash식 block diffusion drafter(5층, 한 번에 7토큰)로 바꿨다(V2.6 보고서 §2.4).

데이터

사전학습 27T 토큰. 출처는 공개 웹, 책, 논문, 코드, 수학과 STEM 자료이고 파이프라인은 MiMo-7B를 대체로 따른다. 달라진 점은 장거리 의존성이 있는 데이터로의 의도적 이동이다. 긴 웹 문서와 저장소 단위 코드, PR·issue·commit 이력을 강조한다(§3). 학습은 세 단계다.

단계토큰 구간context데이터
Stage 1 사전학습0 – 22T32K일반 고품질 코퍼스
Stage 2 mid-training22 – 26T32K코드 upsampling, 합성 추론 데이터 약 5%
Stage 3 context 확장26 – 27T256KStage 2 분포 + 장거리 의존 데이터 upsampling

혼합 비율, 중복 제거·필터링의 구체 수치는 공개되지 않았다.

사후학습 데이터. SFT는 “수백만 건”의 thinking/non-thinking 샘플로, 응답은 사내 도메인 특화 체크포인트가 만들었다. agent RL 데이터(Table 8)는 다음과 같다.

agent과제 수환경프롬프트
Code agent90K실제 (GitHub issue)실제
Code agent30K실제 (Stack Overflow/Exchange → terminal)합성
Search agent150K실제합성 (fact-graph 확장)
General agent50K합성합성

code agent 환경은 저장소 snapshot에서 컨테이너 이미지를 자동으로 만드는 파이프라인(8개 언어, 성공률 70%)과 동시 10,000개 이상의 Kubernetes pod로 돌린다. 도구는 bash, str_replace, finish 세 개뿐이다. web development agent는 렌더링 동영상을 보는 멀티모달 verifier가 보상을 준다(정적 스크린샷보다 시각적 환각이 적다).

V2.6의 RL 데이터. 도메인 비율이 agentic·경쟁 코딩 68%, 일반 tool use 12%, 디자인 13%, context following 3%, 사이버보안 4%다(V2.6 §5.1). 코드 과제는 GitHub PR, 사내 개발 요청, 명세 기반, 기존 코드 기능 역추출(CodeMidas), 장기 과제 등 다섯 경로로 합성하고, 보상이 정확한지를 두 방향으로 검사한다. 각 과제를 코딩 agent가 4번 풀게 한 뒤 감사(auditing) agent가 패치와 대화 로그를 보고 “통과했는데 틀린 것”(false positive)과 “실패했는데 맞는 것”(false negative)을 표시하고, reference patch 적용 전후의 F2P/P2P 결과가 8번 반복 실행에서 같은지 본다.

학습

사전학습 레시피 (V2-Flash §3.2)

  • 최적화. AdamW(β1=0.9\beta_1=0.9, β2=0.95\beta_2=0.95, weight decay 0.1), gradient clip 1.0. 학습률은 50B 토큰 동안 0 → 3.2×10−43.2\times10^{-4} warmup, 12T 토큰 일정, 10T 토큰 동안 cosine으로 1.0×10−41.0\times10^{-4}, Stage 2에서 4T 동안 3.0×10−53.0\times10^{-5}까지. batch는 처음 500B 토큰 동안 2,048까지 늘린다.
  • MoE 균형. 시퀀스 aux loss 계수 10−510^{-5}와 expert bias 업데이트(계수 0.001, DeepSeek-V3식 auxiliary-loss-free 균형)를 함께 쓴다.
  • RoPE와 확장. 32K에서 GA는 base 640,000, SWA는 10,000. 256K 확장 때 GA만 5,000,000으로 올린다. SWA는 window가 128이라 위치 범위가 바뀌지 않는다. 확장 단계는 batch 256, LR 3×10−5→10−53\times10^{-5}\to10^{-5}.
  • 정밀도. FP8 mixed precision. attention 출력 projection·embedding·출력 head는 BF16, MoE router는 FP32로 남긴다.

사후학습: SFT → 도메인 교사 → MOPD

V2-Flash의 사후학습은 세 단계다. (1) 일반 SFT, (2) 수학·추론·안전·검색·코딩·tool use 등 도메인별로 독립 RL(또는 SFT)해서 교사들을 만들고, (3) 학생 하나가 자기 분포에서 샘플을 뽑고 그 도메인 교사에게 토큰 단위 감독을 받는 MOPD다. 모델 병합이나 교사 출력으로 만든 정적 데이터셋 대신 on-policy RL로 합친다는 점이 핵심이다.

SFT에서 보고서가 강조하는 진단 지표가 흥미롭다. **gradient가 0인 파라미터 수(num-zeros)**가 늘면 expert 부하가 무너지고 있다는 신호이고, 줄면 과적합 신호라는 것이다. 이를 안정시키려고 expert bias 업데이트율 10−410^{-4}, AdamW ϵ=10−8\epsilon=10^{-8}, aux loss 10−610^{-6}, LR 5×10−5→5×10−65\times10^{-5}\to5\times10^{-6}, batch 128을 썼다.

MOPD의 식. 학습 엔진의 학생을 πθ\pi_\theta, 추론 엔진의 샘플링 정책을 μθ\mu_\theta, 프롬프트 xx의 도메인 교사를 πdom(x)\pi_{\text{dom}(x)}라 하자. 학생 분포에서 뽑은 토큰 위의 reverse KL은

LRKL(θ)=− Eyt∼πθ[log⁡πdom(x)(yt∣x,y<t)πθ(yt∣x,y<t)]\mathcal{L}_{\text{RKL}}(\theta) = -\,\mathbb{E}_{y_t\sim\pi_\theta}\left[\log\frac{\pi_{\text{dom}(x)}(y_t\mid x,y_{<t})}{\pi_\theta(y_t\mid x,y_{<t})}\right]

이고, 그 gradient는 log⁡πdomπθ\log\frac{\pi_{\text{dom}}}{\pi_\theta}를 advantage로 둔 policy gradient와 같다(아래 코드에서 확인한다). 여기에 학습–추론 불일치를 보정하는 importance weight와 마스크(Zhao et al. 2025를 따름)를 붙인 surrogate가 보고서 Eq. 7–9다.

LMOPD(θ)=− Ey∼μθ[1∣y∣∑t=1∣y∣wt A^tlog⁡πθ(yt∣x,y<t)],\mathcal{L}_{\text{MOPD}}(\theta) = -\,\mathbb{E}_{y\sim\mu_\theta}\left[\frac{1}{|y|}\sum_{t=1}^{|y|} w_t\, \hat A_t \log\pi_\theta(y_t\mid x,y_{<t})\right],wt={sg⁡ ⁣[πθ(yt)μθ(yt)]ϵlow≤πθμθ≤ϵhigh0그 밖,A^t=sg⁡ ⁣[log⁡πdom(x)(yt)πθ(yt)]+α A^ORM.w_t = \begin{cases}\operatorname{sg}\!\left[\dfrac{\pi_\theta(y_t)}{\mu_\theta(y_t)}\right] & \epsilon_{\text{low}}\le \dfrac{\pi_\theta}{\mu_\theta}\le\epsilon_{\text{high}}\\[4pt] 0 & \text{그 밖}\end{cases},\qquad \hat A_t = \operatorname{sg}\!\left[\log\frac{\pi_{\text{dom}(x)}(y_t)}{\pi_\theta(y_t)}\right] + \alpha\,\hat A_{\text{ORM}} .

A^ORM\hat A_{\text{ORM}}은 결과 보상으로 계산한 GRPO식 advantage다. 교사가 RL 모델이든, 다른 SFT 모델이든, 학생 자신이든 상관없다는 점, 그리고 증류된 학생을 다시 도메인 RL에 넣어 더 강한 교사를 만드는 반복(co-evolution)이 가능하다는 점을 보고서는 장점으로 든다. 이 구조는 증류 레슨의 on-policy distillation에 “도메인별 교사 라우팅”과 “결과 보상”을 더한 것이다.

RL 인프라. SGLang(추론)과 Megatron-LM(학습)을 FP8로 돌리고, MoE의 학습·추론 라우팅 불일치를 R3(rollout 때 고른 expert를 학습 때 재사용)로 막는다. 멀티턴 agent에서는 이전 턴의 KV cache와 routed expert를 함께 보관하는 요청 단위 prefix cache를 쓴다. partial rollout에는 staleness를 고려한 truncated importance sampling을 쓴다(§4.6).

V2.6: RL을 키우는 데 필요했던 것들

V2.6 보고서의 RL 목적함수(Eq. 1)는 GRPO에 토큰 마스크를 붙인 형태다.

L(θ)=− E[1∑i∣oi∣∑i=1G∑t=1∣oi∣ri,t Mi,t Ailog⁡πθ(oi,t∣q,oi,<t)],ri,t=sg⁡ ⁣[πθ(oi,t)μθold(oi,t)].\mathcal{L}(\theta) = -\,\mathbb{E}\left[\frac{1}{\sum_i |o_i|}\sum_{i=1}^{G}\sum_{t=1}^{|o_i|} r_{i,t}\, M_{i,t}\, A_i \log\pi_\theta(o_{i,t}\mid q,o_{i,<t})\right],\qquad r_{i,t} = \operatorname{sg}\!\left[\frac{\pi_\theta(o_{i,t})}{\mu_{\theta_{\text{old}}}(o_{i,t})}\right].

세부 설정(§5.1)은 실무적으로 참고할 것이 많다.

  • mid-training에서 optimizer 교체. 사전학습은 AdamW였지만 큰 batch의 혼합 과제 RL에서 효율이 떨어져, mid-training부터 은닉 행렬에 Muon 변형인 Muown(행 norm 제어 추가)을 쓴다. embedding·LM head·router는 AdamW로 남긴다. Adam으로 사전학습한 모델을 Muon으로 바꾸면 성능이 떨어진다는 선행 보고가 있지만 loss spike는 없었다고 한다. RL LR은 3×10−63\times10^{-6}, warmup·weight decay 없음.
  • 비대칭·적응형 clip. IS 비율의 clip 경계를 양의 advantage용 [ϵ+l,ϵ+h][\epsilon^l_+,\epsilon^h_+], 음의 advantage용 [ϵ−l,ϵ−h][\epsilon^l_-,\epsilon^h_-]로 따로 두고, 둘 다 [0.2,5.0][0.2, 5.0]에서 시작해 entropy를 보고 런타임에 조정한다. entropy가 너무 낮으면 양의 경계를 넓히고 음의 경계를 좁힌다.
  • prompt-mean 집계. 응답 토큰 전체 평균 대신 프롬프트 단위로 평균해 응답 길이가 너무 빨리 늘지 않게 한다. 비동기 partial rollout(staleness 4), all-pass·all-fail 그룹을 거르는 dynamic sampler, top-p 후보 집합까지 재생하는 학습–추론 정렬을 함께 쓴다.
  • router freezing. 아래 실험 결과 절 참고.

→ 더 깊이: 안정화 플레이북 — 지표로 RL 실패를 읽는 법과 다른 lab이 대규모 RL을 안정시킨 방법.

핵심 method 깊게 보기 1 — groupwise agentic grading

코드 agent RL의 기본 보상은 “테스트를 통과했나”라는 이진값이다. 같은 그룹에서 통과한 패치 넷이 모두 같은 보상을 받으면, 테스트만 통과시키려고 예외를 삼키거나 검증을 느슨하게 하거나 평가 전용 설정을 바꾸는 패치도 깔끔한 패치와 똑같이 강화된다. V2.6 보고서는 실제로 그런 행동이 늘었다고 보고한다(§4.3.2). 해결책은 grader에 컴퓨트를 쓰는 것이고, 두 갈래다.

GRS(Groupwise Reward Synthesis, 오프라인 rubric). 통과율이 높은 과제 일부에 대해, 오프라인 rollout 여러 개를 agent가 비교해 과제별 solution rubric과 behavior rubric을 만든다. 학습 중에는 grader agent가 각 rollout의 실행 환경에 들어가 rubric 점수 Sisol,SibehS^{\text{sol}}_i, S^{\text{beh}}_i를 매기고 보상을 곱으로 합친다(Eq. 2).

Ri=Ritest⋅Sisol⋅Sibeh.R_i = R^{\text{test}}_i\cdot S^{\text{sol}}_i\cdot S^{\text{beh}}_i .

곱이라서 실패한 궤적은 여전히 0이고, 모두 통과한 그룹에서도 품질 차이만으로 신호가 생긴다.

GAR(Groupwise Advantage Redistribution, 온라인). 나머지 과제는 통과·실패가 섞인 그룹마다 SFT로 학습한 grader agent가 모든 궤적을 한 작업공간에서 비교한다. 접근법의 적절성, 구현의 정밀성, 변경의 최소성, 범위 밖 부작용, 코드베이스 관례 다섯 축으로 통과 패치의 순위를 매기고, 외부 정답을 베낀 것이 확인되면 보상을 0으로 바꾼다. 해킹 보정 후 이진 보상 RiR_i, 그룹 평균 Rˉ\bar R, Ai=Ri−RˉA_i = R_i-\bar R, 통과 집합 P\mathcal{P}, 품질 계수 fi∈(0,1]f_i\in(0,1]에 대해 (Eq. 3)

λ=∑j∈PAj∑j∈PfjAj,Ai′={λfiAii∈PAii∉P\lambda = \frac{\sum_{j\in\mathcal{P}} A_j}{\sum_{j\in\mathcal{P}} f_j A_j},\qquad A'_i = \begin{cases}\lambda f_i A_i & i\in\mathcal{P}\\ A_i & i\notin\mathcal{P}\end{cases}

이다. 이 갱신은 ∑i∈PAi′=∑i∈PAi\sum_{i\in\mathcal{P}}A'_i = \sum_{i\in\mathcal{P}}A_i를 보존한다. 즉 통과 궤적 전체가 받는 양의 질량은 그대로 두고, 그 질량을 품질 비례로 다시 나눈다. 단순히 낮은 품질의 양의 advantage를 깎기만 하면 음의 질량이 상대적으로 커져 entropy가 불어나는데, 재정규화가 그 균형을 지켜 준다는 것이 보고서의 설명이다. 실제로는 λ\lambda에 상한을 두고, 마지막에 그룹 평균을 빼서 평균 0의 시퀀스 advantage를 만든 뒤 모든 응답 토큰에 broadcast한다.

R̄ – λ – ΣPA 전→후before→after – ΣAnew –
Each row is one rollout. Click the circle to toggle test pass (green) / fail (red); drag the middle bar to set the grader's quality fi∈(0,1] (it only matters for passing rollouts). Press ⚑ to mark a rollout as a confirmed hack (copied an external answer) — its reward becomes 0. The grey outline on the right is the binary-reward advantage; the coloured bar is the final advantage of the chosen method. Under GAR, positive advantage moves only among passing rollouts, in proportion to quality (the total is conserved), and failed rollouts are untouched. Lowering the λ cap breaks conservation, and the final re-centring step then reduces the penalty on failed rollouts. With "all pass" both binary reward and GAR give zero signal, while GRS still creates a signal from quality differences alone. 한 줄이 rollout 하나다. 원을 클릭하면 테스트 통과(초록)/실패(빨강)가 바뀌고, 가운데 막대를 끌면 grader가 매긴 품질 fi∈(0,1]이 바뀐다(통과 궤적에만 의미가 있다). ⚑를 누르면 "외부 정답을 베꼈다"고 판정된 해킹 궤적이 되어 보상이 0으로 바뀐다. 오른쪽 회색 테두리는 이진 보상의 advantage, 색 막대는 선택한 방법의 최종 advantage다. GAR에서는 통과 궤적끼리만 양의 advantage가 품질 비례로 옮겨 가고(합 보존), 실패 궤적은 그대로다. λ 상한을 낮추면 보존이 깨지고 평균을 다시 빼는 단계가 실패 궤적의 벌점을 줄인다. "모두 통과"에서는 이진 보상과 GAR 모두 신호가 0이지만 GRS는 품질 차이만으로 신호를 만든다.

Length regularisation, also group-relative. The group-relative length penalty in the same section (Eq. 4) applies only to groups whose pass rate exceeds a threshold AA, and cuts the reward of long passing trajectories relative to ℓq⋆\ell^\star_q, the BB-th percentile of passing lengths:

R~i=Ri−1[i∈Pq]  X⋅clip⁡ ⁣(ℓi/ℓq⋆−1−δs−δ, 0, 1)γ.\tilde R_i = R_i - \mathbb{1}[i\in\mathcal{P}_q]\; X \cdot \operatorname{clip}\!\left(\frac{\ell_i/\ell^\star_q - 1 - \delta}{s-\delta},\,0,\,1\right)^{\gamma}.

Hard prompts (groups with low pass rates) are left alone to preserve room for exploration. The report does not disclose X,δ,s,γ,A,BX,\delta,s,\gamma,A,B, so the code below uses example values.

NumPy GAR, GRS, group-relative length penalty
import numpy as np

def gar(R_test, f, hack, cap=np.inf):
    """MiMo-V2.6 Eq.(3): Groupwise Advantage Redistribution."""
    R = np.where(hack, 0.0, R_test)              # confirmed hack -> reward 0
    A = R - R.mean()                             # A_i = R_i - R̄
    P = R == 1
    if P.any() and not P.all():                  # only for mixed-outcome groups
        lam = min(A[P].sum() / (f[P] * A[P]).sum(), cap)
        A = np.where(P, lam * f * A, A)          # A'_i = λ f_i A_i (i ∈ P)
    return A - A.mean()                          # zero group mean

R_test = np.array([1, 1, 1, 0, 0, 0, 0, 0.])
f      = np.array([1, .55, .25, .8, .6, .4, .7, .5])   # grader quality (matters for passes only)
none   = np.zeros(8, bool)

A0 = R_test - R_test.mean()
A1 = gar(R_test, f, none)
print("binary :", A0.round(3))
print("GAR    :", A1.round(3))
print("  Σ_P A preserved:", np.isclose(A0[:3].sum(), A1[:3].sum()),
      "| failed unchanged:", np.allclose(A0[3:], A1[3:]))
A2 = gar(R_test, f, none, cap=1.2)
print("GAR λ≤1.2:", A2.round(3), " sum =", round(A2.sum(), 9))
print("one hack:", gar(R_test, f, np.arange(8) == 2).round(3))
print("all pass, GAR:", gar(np.ones(8), f, none).round(3))
R = np.ones(8) * f                                # GRS: R = R_test · S_sol · S_beh
print("all pass, GRS:", (R - R.mean()).round(3) + 0.0)

# Eq.(4). The report does not disclose X, δ, s, γ, A, B -> example values.
def length_penalty(R, ell, X=0.5, delta=0.1, s=1.0, gamma=2.0, A_gate=0.25, B=50):
    R = R.astype(float).copy()
    P = R > 0
    if P.mean() <= A_gate:                       # leave hard prompts alone
        return R
    ref = np.percentile(ell[P], B)               # ℓ*_q: B-th percentile of passing lengths
    x = np.clip((ell / ref - 1 - delta) / (s - delta), 0, 1)
    return R - P * X * x ** gamma

ell = np.array([40e3, 55e3, 120e3, 90e3, 30e3, 60e3, 150e3, 80e3])
Rt = length_penalty(R_test, ell)
print("\nlength(k):", (ell / 1e3).astype(int), "\nR̃       :", Rt.round(3))
print("A = R̃ - mean:", (Rt - Rt.mean()).round(3))
 

Check three things in the output. GAR preserves the passing trajectories’ total advantage (1.875) while giving 1.04 to the quality-1.0 trajectory and 0.26 to the 0.25 one. Capping λ\lambda breaks conservation, and the re-centring step reduces the failed trajectories’ penalty from −0.375 to −0.309. In an all-pass group, binary reward and GAR give zero signal while GRS creates one from quality alone. The 120K-token passing trajectory is more than twice the reference length (55K), so its reward is cut to 0.5.

확인 문제Check yourself

After GAR's uncapped update, does subtracting the group mean again change anything?

Uncapped, ∑i∈PAi′=∑i∈PAi\sum_{i\in\mathcal{P}}A'_i=\sum_{i\in\mathcal{P}}A_i and failed trajectories are unchanged, so ∑iAi′=∑iAi=0\sum_i A'_i = \sum_i A_i = 0. The mean is already 0 and subtracting it does nothing. If λ\lambda hits the cap, the passing sum shrinks, the overall mean becomes negative, and the re-centring step lifts every trajectory by the same amount (the failed trajectories’ penalty shrinks).

Deep dive 2 — MOPD’s token advantage

Let us check at a single position (vocabulary of 6) why MOPD’s advantage A^t=log⁡πT(yt)−log⁡πθ(yt)\hat A_t=\log\pi_T(y_t)-\log\pi_\theta(y_t) yields the reverse-KL gradient. For student logits zz,

∇z(−KL(πθ∥πT))k=πk(A^k+KL)=∑yπyA^y (ey−π)k.\nabla_z\big(-\mathrm{KL}(\pi_\theta\|\pi_T)\big)_k = \pi_k\big(\hat A_k + \mathrm{KL}\big) = \sum_y \pi_y \hat A_y\,(e_y-\pi)_k .

The right-hand side is the expectation of “REINFORCE with A^\hat A as the advantage”. The term from differentiating the log⁡πθ\log\pi_\theta inside the KL has zero expectation and drops out. So MOPD needs no separate distillation loss: you swap the advantage in the RL code path.

NumPy MOPD: reverse-KL advantage mixed with an ORM
import numpy as np

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

rng = np.random.default_rng(1)
V = 6
z = rng.normal(size=V)                                # student logits (one position)
T = softmax(np.array([3.0, 1.0, 0.5, 0, -1, -2]))     # domain-teacher distribution
pi = softmax(z)

A = np.log(T) - np.log(pi)                            # Eq.(8) token advantage
kl = np.sum(pi * (np.log(pi) - np.log(T)))
print("E_{y~π_θ}[Â] =", round(np.sum(pi * A), 6), "  -KL(π_θ‖π_T) =", round(-kl, 6))

pg = pi * A - pi * np.sum(pi * A)                     # Σ_y π_y Â_y (e_y - π)
eps = 1e-6
def negkl(zz):
    p = softmax(zz); return -np.sum(p * (np.log(p) - np.log(T)))
num = np.array([(negkl(z + eps * np.eye(V)[k]) - negkl(z)) / eps for k in range(V)])
print("policy-gradient form == ∇(-KL) (finite differences):", np.allclose(pg, num, atol=1e-4))

y = rng.choice(V, size=200_000, p=pi)                 # sample-based estimate
mc = np.zeros(V); np.add.at(mc, y, A[y])
mc = mc / len(y) - pi * np.mean(A[y])
print("MC estimate error max|Δ| =", np.abs(mc - pg).max().round(4))

def train(kind, steps=40, lr=1.0, alpha=1.0):         # 40 steps with the expected gradient
    zz = np.zeros(V)
    for _ in range(steps):
        p = softmax(zz)
        r = (np.arange(V) == 0).astype(float)         # ORM: only token 0 is correct
        A_orm = r - np.sum(p * r)
        A_kd = np.log(T) - np.log(p)
        Adv = {"ORM": A_orm, "MOPD": A_kd, "MOPD+ORM": A_kd + alpha * A_orm}[kind]
        zz += lr * (p * Adv - p * np.sum(p * Adv))
    p = softmax(zz)
    return p[0], np.sum(p * (np.log(p) - np.log(T)))
for k in ["ORM", "MOPD", "MOPD+ORM"]:
    p0, d = train(k)
    print(f"{k:9s}: p(correct)={p0:.3f}  KL(π_θ‖π_T)={d:.4f}")
print("teacher's p(correct) =", T[0].round(3))
 

Pure MOPD copies the teacher’s distribution (KL → 0.003, p(correct) equal to the teacher’s 0.774). Pure ORM follows only the reward and becomes sharper than the teacher. Adding the two as in Eq. 9 lands in between. That the student slightly exceeds its teachers on math and code after MOPD in Table 7 (AIME 2025 93.9 → 94.1) can be read as the effect of the ORM term. Conversely, some domains fall short of the teacher (BrowseComp 51.7 → 45.4).

Real training code works on token tensors and masks. Below are the GAR advantage and the MOPD loss in PyTorch. The IS mask bounds are examples because the report gives no values.

PyTorch PyTorch: GAR advantage and the MOPD surrogate 로컬에서 실행run locally (pip install torch)
import torch

def gar_advantages(r_test, quality, hacked, cap=float("inf")):
    """r_test, quality, hacked: (B, G). Returns (B, G) sequence-level advantages."""
    r = torch.where(hacked, torch.zeros_like(r_test), r_test)
    adv = r - r.mean(dim=1, keepdim=True)
    passed = r == 1
    mixed = passed.any(1, keepdim=True) & ~passed.all(1, keepdim=True)
    num = (adv * passed).sum(1, keepdim=True)
    den = (quality * adv * passed).sum(1, keepdim=True).clamp_min(1e-8)
    lam = (num / den).clamp(max=cap)
    adv = torch.where(passed & mixed, lam * quality * adv, adv)
    return adv - adv.mean(1, keepdim=True)          # broadcast to tokens when used

def mopd_loss(logp, logp_rollout, logp_teacher, mask, adv_orm=None, alpha=1.0, lo=0.5, hi=2.0):
    """(N, T) token tensors. Only logp has grad. logp_rollout = log μ_θ, logp_teacher = log π_dom."""
    ratio = torch.exp(logp.detach() - logp_rollout)                 # π_θ / μ_θ
    w = torch.where((ratio >= lo) & (ratio <= hi), ratio, torch.zeros_like(ratio))
    adv = logp_teacher - logp.detach()                              # sg[log π_T/π_θ]
    if adv_orm is not None:
        adv = adv + alpha * adv_orm[:, None]                        # Eq.(9)
    per_tok = w * adv * logp * mask
    return -(per_tok.sum(1) / mask.sum(1).clamp_min(1)).mean()      # 1/|y| mean (Eq.7)
 

Results

Architecture. The attention ablations (Tables 2–4) and the MTP results (Table 10) above justify the design. At long context the base model keeps NIAH-Multi at 96.7–99.9 from 32K to 256K, and GSM-Infinite Hard declines gently from 37.7 at 16K to 29.0 at 128K (Table 6). In the same table DeepSeek-V3.2-Exp Base is highest at 16K (50.4) but drops to 25.7 at 128K. The report reads this as a weakness of sparse attention, but base-model few-shot format-following problems (the asterisks in the table) are mixed in, so it is hard to take at face value.

MOPD (Table 7). Compared with right after SFT, the student reached the best teacher’s level on every math and code metric.

BenchmarkBefore MOPDBest teacherAfter MOPDΔ (student − teacher)
AIME 202589.393.9 (RL)94.1+0.2
HMMT Feb. 202576.982.6 (RL)84.4+1.8
LiveCodeBench77.582.6 (RL)83.2+0.6
SWE-Bench Verified67.874.2 (RL)73.4−0.8
Arena-Hard (Hard Prompt)50.050.0 (self)54.1+4.1
Arena-Hard (Creative Writing)90.190.1 (self)86.2−3.9
BrowseComp42.551.7 (SFT)45.4−6.3

V2.6 RL scaling. During RL, DeepSWE v1.1 (avg@3) rose from 58.4 to 72.6 for Pro and from 48.7 to 65.7 for Flash (Figure 3). For Pro, rollout takes 43.8% of the cost, training 43.5%, and the grader 12.7%. Apart from the four mini-harnesses used in training, the mean pass@1 of three held-out harnesses — codex, claude code, mini-swe-agent — also rose from about 50% to 66%, presented as evidence against overfitting to a harness (Figure 10). Thirty steps took 123.1 hours for Pro and 81.8 hours for Flash (Figure 12).

Router freezing (§5.4). In a Pro RL run with a trainable router, decoder layer 9 (384 experts) saw its load coefficient of variation rise from 0.78 to 2.0 over the first 20 steps, the max/mean load from 6× to 16×, and the share of “cold” experts (below 0.1× the mean) from 0.5% to 22%. Restoring only the router parameters of the step-20 checkpoint to their pre-RL values brought the load almost back to its initial state with unchanged benchmark scores — the collapse came from router drift, not from the expert weights. The frozen-router run stayed flat (CV ≈ 0.7, max load ≈ 5.5×, cold experts ≈ 1%).

길이 정규화도 그룹 상대적으로. 같은 절의 group-relative length penalty(Eq. 4)는 통과율이 문턱 AA보다 높은 그룹에서만, 통과 궤적 길이의 BB 분위수 ℓq⋆\ell^\star_q를 기준으로 긴 통과 궤적의 보상을 깎는다.

R~i=Ri−1[i∈Pq]  X⋅clip⁡ ⁣(ℓi/ℓq⋆−1−δs−δ, 0, 1)γ.\tilde R_i = R_i - \mathbb{1}[i\in\mathcal{P}_q]\; X \cdot \operatorname{clip}\!\left(\frac{\ell_i/\ell^\star_q - 1 - \delta}{s-\delta},\,0,\,1\right)^{\gamma}.

어려운 프롬프트(통과율이 낮은 그룹)는 건드리지 않아 탐색 여지를 남긴다. 보고서는 X,δ,s,γ,A,BX,\delta,s,\gamma,A,B의 값을 공개하지 않았으므로 아래 코드는 예시 값을 쓴다.

NumPy GAR, GRS, group-relative length penalty
import numpy as np

def gar(R_test, f, hack, cap=np.inf):
    """MiMo-V2.6 Eq.(3): Groupwise Advantage Redistribution."""
    R = np.where(hack, 0.0, R_test)              # 해킹 확정 → 보상 0
    A = R - R.mean()                             # A_i = R_i - R̄
    P = R == 1
    if P.any() and not P.all():                  # 혼합 그룹에서만
        lam = min(A[P].sum() / (f[P] * A[P]).sum(), cap)
        A = np.where(P, lam * f * A, A)          # A'_i = λ f_i A_i (i ∈ P)
    return A - A.mean()                          # 그룹 평균 0

R_test = np.array([1, 1, 1, 0, 0, 0, 0, 0.])
f      = np.array([1, .55, .25, .8, .6, .4, .7, .5])   # grader 품질 (통과 궤적에만 의미)
none   = np.zeros(8, bool)

A0 = R_test - R_test.mean()
A1 = gar(R_test, f, none)
print("binary :", A0.round(3))
print("GAR    :", A1.round(3))
print("  Σ_P A 보존:", np.isclose(A0[:3].sum(), A1[:3].sum()),
      "| 실패 궤적 불변:", np.allclose(A0[3:], A1[3:]))
A2 = gar(R_test, f, none, cap=1.2)
print("GAR λ≤1.2:", A2.round(3), " 합 =", round(A2.sum(), 9))
print("해킹 1개:", gar(R_test, f, np.arange(8) == 2).round(3))
print("모두 통과 GAR:", gar(np.ones(8), f, none).round(3))
R = np.ones(8) * f                                # GRS: R = R_test · S_sol · S_beh
print("모두 통과 GRS:", (R - R.mean()).round(3) + 0.0)

# Eq.(4). 보고서는 X, δ, s, γ, A, B 값을 공개하지 않았다 → 예시 값.
def length_penalty(R, ell, X=0.5, delta=0.1, s=1.0, gamma=2.0, A_gate=0.25, B=50):
    R = R.astype(float).copy()
    P = R > 0
    if P.mean() <= A_gate:                       # 어려운 문제는 그대로 둔다
        return R
    ref = np.percentile(ell[P], B)               # ℓ*_q: 통과 궤적 길이의 B-분위
    x = np.clip((ell / ref - 1 - delta) / (s - delta), 0, 1)
    return R - P * X * x ** gamma

ell = np.array([40e3, 55e3, 120e3, 90e3, 30e3, 60e3, 150e3, 80e3])
Rt = length_penalty(R_test, ell)
print("\n길이(k):", (ell / 1e3).astype(int), "\nR̃     :", Rt.round(3))
print("A = R̃ - mean:", (Rt - Rt.mean()).round(3))
 

출력에서 세 가지를 확인한다. GAR은 통과 궤적의 advantage 합(1.875)을 보존하면서 품질 1.0인 궤적에 1.04, 0.25인 궤적에 0.26을 준다. λ\lambda에 상한을 걸면 보존이 깨지고, 평균을 다시 빼는 단계가 실패 궤적의 벌점을 −0.375에서 −0.309로 줄인다. 모두 통과한 그룹에서 이진 보상과 GAR은 신호가 0이지만 GRS는 품질만으로 신호를 만든다. 길이 120K의 통과 궤적은 기준 길이(55K)의 두 배가 넘어 보상이 0.5로 깎인다.

확인 문제Check yourself

GAR의 uncapped 갱신 뒤 다시 그룹 평균을 빼는 단계는 결과를 바꾸는가?

uncapped이면 ∑i∈PAi′=∑i∈PAi\sum_{i\in\mathcal{P}}A'_i=\sum_{i\in\mathcal{P}}A_i이고 실패 궤적은 그대로이므로 ∑iAi′=∑iAi=0\sum_i A'_i = \sum_i A_i = 0이다. 평균이 이미 0이라 빼도 변화가 없다. λ\lambda가 상한에 걸리면 통과 궤적의 합이 줄어 전체 평균이 음수가 되고, 평균을 빼는 단계가 모든 궤적을 같은 양만큼 올린다(실패 궤적 벌점이 줄어든다).

핵심 method 깊게 보기 2 — MOPD의 토큰 advantage

MOPD의 advantage A^t=log⁡πT(yt)−log⁡πθ(yt)\hat A_t=\log\pi_T(y_t)-\log\pi_\theta(y_t)가 왜 reverse KL의 gradient가 되는지 한 위치(vocab 6개)에서 확인하자. 학생 로짓 zz에 대해

∇z(−KL(πθ∥πT))k=πk(A^k+KL)=∑yπyA^y (ey−π)k\nabla_z\big(-\mathrm{KL}(\pi_\theta\|\pi_T)\big)_k = \pi_k\big(\hat A_k + \mathrm{KL}\big) = \sum_y \pi_y \hat A_y\,(e_y-\pi)_k

이다. 오른쪽은 “A^\hat A를 advantage로 둔 REINFORCE”의 기대값이다. log⁡πθ\log\pi_\theta 안쪽을 미분한 항은 기대값이 0이라 사라진다. 그래서 MOPD는 별도의 증류 손실 없이 RL 코드 경로에 advantage만 바꿔 끼우면 된다.

NumPy MOPD: reverse-KL advantage와 ORM 혼합
import numpy as np

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

rng = np.random.default_rng(1)
V = 6
z = rng.normal(size=V)                                # 학생 로짓 (한 위치)
T = softmax(np.array([3.0, 1.0, 0.5, 0, -1, -2]))     # 도메인 교사 분포
pi = softmax(z)

A = np.log(T) - np.log(pi)                            # Eq.(8) 토큰 advantage
kl = np.sum(pi * (np.log(pi) - np.log(T)))
print("E_{y~π_θ}[Â] =", round(np.sum(pi * A), 6), "  -KL(π_θ‖π_T) =", round(-kl, 6))

pg = pi * A - pi * np.sum(pi * A)                     # Σ_y π_y Â_y (e_y - π)
eps = 1e-6
def negkl(zz):
    p = softmax(zz); return -np.sum(p * (np.log(p) - np.log(T)))
num = np.array([(negkl(z + eps * np.eye(V)[k]) - negkl(z)) / eps for k in range(V)])
print("policy-gradient 형태 == ∇(-KL) (유한차분):", np.allclose(pg, num, atol=1e-4))

y = rng.choice(V, size=200_000, p=pi)                 # 샘플 기반 추정
mc = np.zeros(V); np.add.at(mc, y, A[y])
mc = mc / len(y) - pi * np.mean(A[y])
print("MC 추정 오차 max|Δ| =", np.abs(mc - pg).max().round(4))

def train(kind, steps=40, lr=1.0, alpha=1.0):         # 기대 gradient로 40 step
    zz = np.zeros(V)
    for _ in range(steps):
        p = softmax(zz)
        r = (np.arange(V) == 0).astype(float)         # ORM: 0번 토큰만 정답
        A_orm = r - np.sum(p * r)
        A_kd = np.log(T) - np.log(p)
        Adv = {"ORM": A_orm, "MOPD": A_kd, "MOPD+ORM": A_kd + alpha * A_orm}[kind]
        zz += lr * (p * Adv - p * np.sum(p * Adv))
    p = softmax(zz)
    return p[0], np.sum(p * (np.log(p) - np.log(T)))
for k in ["ORM", "MOPD", "MOPD+ORM"]:
    p0, d = train(k)
    print(f"{k:9s}: p(정답)={p0:.3f}  KL(π_θ‖π_T)={d:.4f}")
print("교사의 p(정답) =", T[0].round(3))
 

순수 MOPD는 교사 분포를 그대로 복사한다(KL → 0.003, p(정답)이 교사와 같은 0.774). 순수 ORM은 보상만 따라가 교사보다 더 뾰족해진다. Eq. 9처럼 둘을 더하면 그 사이에 놓인다. 보고서 Table 7에서 MOPD 뒤 학생이 수학·코드에서 교사를 약간 넘는(AIME 2025 93.9 → 94.1) 것은 ORM 항이 함께 있기 때문으로 읽을 수 있다. 반대로 교사를 못 따라간 도메인(BrowseComp 51.7 → 45.4)도 있다.

실제 학습 코드는 토큰 텐서와 마스크를 다룬다. 아래는 GAR advantage와 MOPD 손실을 PyTorch로 쓴 것이다. IS 마스크 경계는 보고서에 값이 없어 예시다.

PyTorch PyTorch: GAR advantage와 MOPD surrogate 로컬에서 실행run locally (pip install torch)
import torch

def gar_advantages(r_test, quality, hacked, cap=float("inf")):
    """r_test, quality, hacked: (B, G). 반환: (B, G) 시퀀스 단위 advantage."""
    r = torch.where(hacked, torch.zeros_like(r_test), r_test)
    adv = r - r.mean(dim=1, keepdim=True)
    passed = r == 1
    mixed = passed.any(1, keepdim=True) & ~passed.all(1, keepdim=True)
    num = (adv * passed).sum(1, keepdim=True)
    den = (quality * adv * passed).sum(1, keepdim=True).clamp_min(1e-8)
    lam = (num / den).clamp(max=cap)
    adv = torch.where(passed & mixed, lam * quality * adv, adv)
    return adv - adv.mean(1, keepdim=True)          # 토큰에는 broadcast해서 쓴다

def mopd_loss(logp, logp_rollout, logp_teacher, mask, adv_orm=None, alpha=1.0, lo=0.5, hi=2.0):
    """(N, T) 토큰 텐서. logp만 grad를 가진다. logp_rollout = log μ_θ, logp_teacher = log π_dom."""
    ratio = torch.exp(logp.detach() - logp_rollout)                 # π_θ / μ_θ
    w = torch.where((ratio >= lo) & (ratio <= hi), ratio, torch.zeros_like(ratio))
    adv = logp_teacher - logp.detach()                              # sg[log π_T/π_θ]
    if adv_orm is not None:
        adv = adv + alpha * adv_orm[:, None]                        # Eq.(9)
    per_tok = w * adv * logp * mask
    return -(per_tok.sum(1) / mask.sum(1).clamp_min(1)).mean()      # 1/|y| 평균 (Eq.7)
 

실험 결과

아키텍처. 위의 attention ablation(Table 2–4)과 MTP 결과(Table 10)가 설계를 정당화한다. 긴 문맥에서 Base 모델은 NIAH-Multi 32K–256K에서 96.7–99.9를 유지하고, GSM-Infinite Hard는 16K 37.7에서 128K 29.0으로 완만히 떨어진다(Table 6). 같은 표에서 DeepSeek-V3.2-Exp Base는 16K 50.4로 가장 높지만 128K에서 25.7로 떨어진다. 보고서는 이를 sparse attention의 약점으로 해석하는데, base 모델의 few-shot 형식 준수 문제(표의 별표)가 섞여 있어 그대로 받아들이기는 어렵다.

MOPD(Table 7). 학생은 SFT 직후 대비 모든 수학·코드 지표에서 최고 교사 수준에 도달했다.

벤치마크MOPD 전최고 교사MOPD 후Δ(학생−교사)
AIME 202589.393.9 (RL)94.1+0.2
HMMT Feb. 202576.982.6 (RL)84.4+1.8
LiveCodeBench77.582.6 (RL)83.2+0.6
SWE-Bench Verified67.874.2 (RL)73.4−0.8
Arena-Hard (Hard Prompt)50.050.0 (자기 자신)54.1+4.1
Arena-Hard (Creative Writing)90.190.1 (자기 자신)86.2−3.9
BrowseComp42.551.7 (SFT)45.4−6.3

V2.6의 RL 스케일링. DeepSWE v1.1(avg@3)은 RL 동안 Pro가 58.4 → 72.6, Flash가 48.7 → 65.7로 올랐다(Figure 3). 비용 비중은 Pro 기준 rollout 43.8%, 학습 43.5%, grader 12.7%다. 학습에 쓴 4개 mini-harness와 별개로 codex, claude code, mini-swe-agent 세 held-out harness의 평균 pass@1도 약 50%에서 66%로 올라, 특정 harness에 과적합하지 않았다는 증거로 제시된다(Figure 10). 30 step을 도는 데 Pro는 123.1시간, Flash는 81.8시간이 걸렸다(Figure 12).

router freezing(§5.4). router를 학습 가능하게 둔 Pro RL에서 9번째 decoder 층(expert 384개)의 부하 변동계수(CV)가 처음 20 step 동안 0.78 → 2.0, 최대/평균 부하가 6배 → 16배, 평균의 0.1배 미만인 “식은 expert” 비율이 0.5% → 22%로 치솟았다. step 20 체크포인트에서 router 파라미터만 RL 이전 값으로 되돌리자 부하가 거의 원래대로 돌아왔고 벤치마크 점수는 그대로였다. 즉 붕괴는 expert 가중치가 아니라 router drift 때문이었다. router를 얼린 run은 CV ≈ 0.7, 최대 부하 ≈ 5.5배, 식은 expert ≈ 1%로 평평했다.

점 위에 마우스를 올리면 값이 나온다.Hover over a dot to read its value.
Switch tables and click the legend to toggle models. The large dot is this report's model. All values are copied from the report's tables (missing = not reported).표를 바꾸고 범례를 눌러 모델을 켜고 끈다. 큰 점이 이 보고서의 모델이다. 값은 모두 보고서 표에서 옮겼다(빈 값은 보고되지 않음).

The base comparison (Table 5) captures the character of a 15B-active model. On reasoning-type metrics (MMLU-Pro, GPQA, AIME) it beats models 3–4× larger, but it clearly trails on knowledge-heavy SimpleQA (20.6 vs Kimi-K2’s 35.3) and C-SimpleQA. The report itself acknowledges “lower knowledge capacity due to the limited parameter count”.

Reading critically

  • The SWA conclusion comes from one scale. The claim that a W=128 hybrid with sink beats all-GA comes from a 32B dense model pre-trained on 250B tokens. There is no all-GA control for the 309B MoE itself. In the same year MiniMax tested hybrid SWA at M2 scale up to trillions of tokens and gave up because it was clearly worse than full attention beyond 32K. The two conclusions differ in window size, sink design, ratio and evaluation sets, so they are less a contradiction than evidence that “the outcome is sensitive to the configuration”.
  • Comparison conditions. Table 9 does not state for each competitor whether scores were re-measured or quoted. τ²-Bench used DeepSeek-V3.2 as the user agent, and BrowseComp’s 58.3 relies on aggressive context resets (Appendix C). Three of the benchmarks in V2.6 Table 3 (MiMo Code/Cyber Bench, Visual Coding) are in-house, and CyberGym is a version with “corrected flawed evaluation environments”.
  • Reward hacking is not only a training problem. Appendix B of V2-Flash reports that official SWE-Bench images still contained the ground-truth commits, so commands like git log --all could peek at future commits. V2.6 says the confirmed hacking rate stayed below 2% during training even after repeatedly screening environments with a hack agent. Remember that it is not zero, and that the 2% counts only what was detected.
  • The grader is a new attack surface. GAR’s quality ranking comes from an SFT-trained grader agent. Whether the policy learns the grader’s taste (e.g. a particular style of short patch), the grader’s consistency, and how ties are handled are not quantified. The grader’s cost (12.7%) is disclosed; its accuracy is not.
  • Not disclosed. Pre-training data mixture ratios; MOPD’s α\alpha and IS bounds; the list of teachers and their RL recipes; the length-penalty values and the GAR λ\lambda cap; the number of V2.6 mid-training tokens.
  • MOPD does not always win. In Table 7, BrowseComp (−6.3) and creative writing (−3.9) end below the teacher. How the capacity cost of merging many teachers shows up in a 15B-active model is an open question.
확인 문제Check yourself

With MiMo-V2-Flash's configuration (48 layers, 39 SWA and 9 GA, W=128, 8 KV heads for SWA and 4 for GA), what does the KV-cache saving versus an all-GA model of the same depth (4 KV heads) converge to as the context grows very long?

For L≫WL\gg W, the SWA layers’ KV is constant at W⋅8⋅dW\cdot 8\cdot d and only the GA layers grow as L⋅4⋅dL\cdot 4\cdot d. The ratio is 48⋅4Ld9⋅4Ld+const→48/9≈5.33\frac{48\cdot 4 L d}{9\cdot 4 L d + \text{const}} \to 48/9 \approx 5.33. The report’s “about 6×” is a rounding from the 5:1 SWA/GA ratio; the actual limit is set by the number of GA layers.

Summary

  • MiMo-V2-Flash mixes 128-token SWA and GA at 5:1 in a 309B/15B MoE, with a learnable attention sink bias that lets a head express “nothing to see in this window”. At long context the KV cache shrinks by 48/9 ≈ 5.3×.
  • In 32B experiments W=128 with sink beat both all-GA and W=512, while MiniMax reached the opposite conclusion in a different setting at the same time. Which hybrid attention wins is configuration-sensitive.
  • Three light MTP blocks of 0.33B each act as the draft model, giving accept length up to 3.6 and up to 2.6× faster decoding. Accept length is almost entirely determined by next-token cross-entropy.
  • MOPD is on-policy distillation with the domain teacher’s log⁡πT/πθ\log\pi_T/\pi_\theta as the token advantage, plus an ORM advantage. Mathematically it is the reverse-KL gradient, so it runs through the RL code path unchanged.
  • V2.6 scaled RL to billions of tokens per step and introduced GRS (multiplicative rubric rewards), GAR (advantage redistribution among passing trajectories), a group-relative length penalty, router freezing, and environment hardening with a hack agent.

Base 비교(Table 5)는 15B 활성 모델의 성격을 잘 보여 준다. 추론형 지표(MMLU-Pro, GPQA, AIME)는 3–4배 큰 모델을 넘지만, 지식량을 재는 SimpleQA(20.6 vs Kimi-K2 35.3)와 C-SimpleQA에서는 분명히 뒤진다. 보고서도 “제한된 파라미터 수 때문에 지식 용량이 낮다”고 인정한다.

비판적으로 읽기

  • SWA 결론은 한 규모의 결과다. sink 있는 W=128 하이브리드가 all-GA를 이긴다는 주장은 32B dense, 250B 토큰 사전학습 실험에서 나왔다. 309B MoE 본 모델을 all-GA로 학습한 대조군은 없다. 같은 해 MiniMax는 M2 규모에서 hybrid SWA를 수조 토큰까지 시험한 끝에 32K 이상에서 full attention보다 확실히 나쁘다며 포기했다. 두 결론은 window 크기, sink 유무, 비율, 평가셋이 다르므로 모순이라기보다 “설정에 민감하다”는 증거다.
  • 비교 조건. Table 9의 경쟁 모델 점수가 자체 재측정인지 공개값 인용인지 표마다 명시되어 있지 않다. τ²-Bench는 DeepSeek-V3.2를 user agent로 썼고, BrowseComp의 58.3은 공격적인 문맥 초기화(부록 C)를 쓴 값이다. V2.6 Table 3의 세 벤치(MiMo Code/Cyber Bench, Visual Coding)는 사내 벤치이고, CyberGym은 “결함 있는 평가 환경을 고친” 버전이다.
  • reward hacking은 학습만의 문제가 아니다. V2-Flash 부록 B는 공식 SWE-Bench 이미지에 정답 commit이 남아 있어 git log --all 같은 명령으로 미래 commit을 엿볼 수 있었다고 보고한다. V2.6은 hack agent로 환경을 반복 점검하고도 학습 중 확인된 해킹 비율이 2% 미만이라고 말한다. 0이 아니라는 점, 그리고 그 2%가 탐지된 것만이라는 점을 기억해야 한다.
  • grader가 새로운 공격 표면이다. GAR의 품질 순위는 SFT로 학습한 grader agent가 매긴다. policy가 grader의 취향(예: 특정 스타일의 짧은 패치)을 학습할 가능성, grader 자체의 일관성, 순위가 동률일 때의 처리 등은 정량적으로 보고되지 않았다. grader 비용(12.7%)은 공개했지만 grader 정확도는 공개하지 않았다.
  • 공개되지 않은 것. 사전학습 데이터 혼합 비율, MOPD의 α\alpha와 IS 경계, 교사 목록과 각 교사의 RL 레시피, length penalty와 GAR λ\lambda 상한의 값, V2.6 mid-training 토큰 수.
  • MOPD가 항상 이기지는 않는다. Table 7에서 BrowseComp(−6.3)와 창작 글쓰기(−3.9)는 교사보다 낮다. 여러 교사를 하나로 합치는 데 드는 용량 비용이 15B 활성 모델에서 어떻게 나타나는지는 열린 질문이다.
확인 문제Check yourself

MiMo-V2-Flash 설정(48층, SWA 39 · GA 9, W=128, SWA 8 KV heads · GA 4 KV heads)에서 문맥이 매우 길어질 때 같은 깊이의 all-GA(4 KV heads) 모델 대비 KV cache 절감 배율은 어디에 수렴하는가?

L≫WL\gg W이면 SWA 층의 KV는 W⋅8⋅dW\cdot 8\cdot d로 상수이고 GA 층만 L⋅4⋅dL\cdot 4\cdot d로 자란다. 비율은 48⋅4Ld9⋅4Ld+상수→48/9≈5.33\frac{48\cdot 4 L d}{9\cdot 4 L d + \text{상수}} \to 48/9 \approx 5.33이다. 보고서의 “약 6배”는 SWA/GA 비율 5:1에서 나온 어림이다. 실제 수렴값은 GA 층 수가 결정한다.

정리

  • MiMo-V2-Flash는 309B/15B MoE에 128-token SWA와 GA를 5:1로 섞고, learnable attention sink bias로 “window 안에 볼 것이 없음”을 표현하게 했다. KV cache는 긴 문맥에서 48/9 ≈ 5.3배 줄어든다.
  • 32B 실험에서는 sink 있는 W=128이 all-GA와 W=512보다 나았지만, 같은 시기 MiniMax는 다른 설정에서 반대 결론을 냈다. 하이브리드 attention의 우열은 설정에 민감하다.
  • 층당 0.33B의 경량 MTP 3개가 draft 모델 역할을 해 accept length 최대 3.6, 디코딩 최대 2.6배를 얻는다. accept length는 다음 토큰 cross-entropy로 거의 결정된다.
  • MOPD는 도메인 교사의 log⁡πT/πθ\log\pi_T/\pi_\theta를 토큰 advantage로 쓰는 on-policy 증류에 ORM advantage를 더한 것이다. 수식상 reverse-KL gradient와 같아 RL 코드 경로를 그대로 쓴다.
  • V2.6은 RL을 step당 수십억 토큰 규모로 키우며 GRS(곱셈 rubric 보상)와 GAR(통과 궤적 내부 advantage 재분배), group-relative length penalty, router freezing, hack agent를 이용한 환경 정화를 도입했다.

더 읽을거리Further reading