Track VI · Frontier Tech Reports · 15/20

MAI-Thinking-1 · MAI-Base-2 — Microsoft AI의 hill-climbing machineMAI-Thinking-1 · MAI-Base-2 — Microsoft AI's hill-climbing machine

Microsoft AI의 두 보고서(MAI-Thinking-1, MAI-Base-2)를 함께 읽는다. scaling ladder와 efficiency gain으로 사전학습 결정을 내리는 방법, LatentMoE·dropless MoE·Muon·activation gradient clipping, 그리고 추론 trace 없이 GRPO 변형(adaptive entropy control, outer ratio clip)과 self-distillation으로 수천 step을 오르는 RL 레시피를 식과 장난감 구현으로 확인한다.Reads Microsoft AI's two reports (MAI-Thinking-1, MAI-Base-2) together — how pre-training decisions are made with a scaling ladder and efficiency gain; LatentMoE, dropless MoE, Muon and activation gradient clipping; and the RL recipe that climbs for thousands of steps without reasoning traces using GRPO variants (adaptive entropy control, outer ratio clip) and self-distillation — checked with equations and toy implementations.

Microsoft AI (MAI) released two reports in 2026. The June MAI-Thinking-1 report (“Building a Hill-Climbing Machine”, 109 pages) covers the whole process of pre-training MAI-Base-1, a 35B active / 1T total MoE, from scratch and then lifting that model, which had never seen a reasoning trace, with RL. The MAI-Base-2 report from around October (“Frontier Pre-training at Microsoft AI”, 13 pages) gives the pre-training results of an 80B active / 2.8T total model trained on 50T tokens with the same methodology. At the time of the report, MAI-Base-2 is in post-training.

The reason to read the two reports together is that what MAI emphasises is not a particular model but the procedure for continually improving models (a hill-climbing machine). The pre-training side of that procedure (ladder, efficiency gain) is defined in the Thinking-1 report and validated up to 2.8T in the Base-2 report. The RL side appears only in the Thinking-1 report. Where this site’s note MAI-Base-2 pre-training summarises the Base-2 report, this lesson retraces the methods of both reports through equations, figures and implementations. Unless stated otherwise, the table and figure numbers next to a number refer to the corresponding report. “(T1 …)” means the MAI-Thinking-1 report and “(B2 …)” the MAI-Base-2 report.

At a glance

MAI-Base-1 → MAI-Thinking-1MAI-Base-2
Lab / dateMicrosoft AI, 2026-06 (report dated June 2)Microsoft AI, around 2026-10 (trained Aug–Sep 2026)
Size (active / total)34.7B / 962B (T1 Table 1; the text says 35B / 1T)80B / 2.8T (B2 p.2)
Layers / hidden78 / 6656102 / 8704
Architecturedecoder-only MoE, local 5 : global 1 attention, alternating MoE·dense FFN, LatentMoE top-8/512same family, MoE in every layer, shared 1 + routed 7/512
Context256K (after mid-training, T1 §1)not in the report
Pre-training tokens30T + mid-training 3.55T (T1 §2)50T (B2 p.2)
Hardware8,192 GB200 (T1 Table 6)16k GB200, 38 days, MFU 21%, goodput 89%
Data principlehuman-created public and licensed data, no LM-generated synthetic data in pre-trainingsame principle + native vision (VLM 4.5T unique)
Post-training3 specialist RLs → unified SFT → final RLin post-training at the time of the report
Weightsnot releasednot released; planned licensing to trusted partners via Foundry (B2 p.2)

What is new

  • The decision procedure is the protagonist. Every change is measured at several scales on a scaling ladder where a single number, the layer count LL, fixes the architecture, and a single metric, efficiency gain (EG), decides whether it is adopted. MAI-Base-2 adds source scaling, which matches even the number of data repetitions, and hyperparameter scaling laws.
  • Model–infrastructure co-design. A change that wins in FLOPs but loses in wall-clock time (MoE in every layer) is made adoptable by fixing the infrastructure: multi-round dropless MoE (MoE-layer MFU 24% → 35%), Muon resharding (2.1% of an iteration), and activation gradient clipping, whose gain grows with scale.
  • Pre-training without distillation. Outputs of other models are not used for pre-training, and neither are open-source training datasets. The motivation is data-provenance control so that the weights can be licensed.
  • Reasoning from scratch with RL. It starts from a GRPO variant without reasoning traces. Two modifications (adaptive entropy control, outer ratio clip) and self-distillation keep a log-linear climb going for thousands of steps.
  • Three specialists into one. STEM, agentic (265,617 SWE environments) and helpfulness·safety are climbed separately, merged with SFT, and finished with a short RL.

Architecture

Block: LatentMoE on top of Gemma 3-style attention

MAI-Base-1 is a decoder-only Transformer (T1 §2.1). Each block uses a sandwich arrangement with RMSNorm on both the input and the output (just before the residual add), and there are no biases. Embeddings are tied in Base-1 and untied in Base-2. The in-house tokenizer was slightly better, but OpenAI’s o200k_base (vocabulary 200,019) was used for integration with existing tools. Compared with the basic Transformer block, two things differ: the attention layout and the FFN.

Attention. Like Gemma 3, it repeats 5 local attention layers and 1 global attention layer. Local layers use a sliding window of 512 and RoPE (base 10,000); global layers use no positional encoding (NoPE). GQA with 8 KV heads and head dimension 128, with RMSNorm on queries and keys. LL is a multiple of 6 so that the last layer is global. MAI-Base-2 changed the KV/Q head counts to global 2/96 and local 16/96 (B2 table).

The KV cache grows with the context length TT only in the global layers; the local layers stop at WW. With ng=L/6n_g = L/6 and nℓ=5L/6n_\ell = 5L/6 layers and BF16 (bb = 2 bytes), the KV memory of one sequence is

MKV(T)=2 b dh[ ng hgkv T  +  nℓ hℓkvmin⁡(T,W)]M_{\text{KV}}(T) = 2\, b\, d_h \Big[\, n_g\, h^{\text{kv}}_{g}\, T \;+\; n_\ell\, h^{\text{kv}}_{\ell} \min(T, W) \Big]

(the leading 2 is for K and V). When T≫WT \gg W the second term becomes a constant and the global term takes everything. So Base-2’s cut of the global KV heads from 8 to 2 shrinks long-context memory to almost a quarter, while the cost of raising the local heads to 16 stays small because it is bounded by WW. You can check this directly in the figure below (dh=128d_h = 128 and W=512W = 512 are Base-1 values; the Base-2 report does not state them, so they are assumed to be the same).

→ Go deeper: Design choices compared — MAI-Base-2’s block side by side with gpt-oss, MiMo-V2, MiniMax-M2 and GLM-5.

Microsoft AI(MAI)는 2026년에 두 개의 보고서를 냈다. 6월의 MAI-Thinking-1 보고서(“Building a Hill-Climbing Machine”, 109쪽)는 35B active / 1T total MoE인 MAI-Base-1을 처음부터 사전학습하고, 추론 trace를 한 번도 본 적 없는 그 모델을 RL로 끌어올린 전 과정을 담았다. 10월 무렵의 MAI-Base-2 보고서(“Frontier Pre-training at Microsoft AI”, 13쪽)는 같은 방법론으로 80B active / 2.8T total 모델을 50T 토큰에 학습한 사전학습 결과다. 보고서 시점에 MAI-Base-2는 post-training 중이다.

두 보고서를 묶어 읽는 이유는 MAI가 강조하는 것이 특정 모델이 아니라 모델을 계속 개선하는 절차(hill-climbing machine) 이기 때문이다. 사전학습 쪽 절차(ladder, efficiency gain)는 Thinking-1 보고서에서 정의되고 Base-2 보고서에서 2.8T까지 검증된다. RL 쪽 절차는 Thinking-1 보고서에만 있다. 이 사이트의 노트 MAI-Base-2 사전학습이 Base-2 보고서 요약이라면, 이 레슨은 두 보고서의 방법을 식과 그림, 구현으로 다시 따라간다. 숫자 옆의 표·그림 번호는 별도 표시가 없으면 해당 보고서의 것이다. “(T1 …)”은 MAI-Thinking-1 보고서, “(B2 …)”는 MAI-Base-2 보고서를 뜻한다.

한눈에

MAI-Base-1 → MAI-Thinking-1MAI-Base-2
랩 / 시점Microsoft AI, 2026-06 (보고서 6월 2일자)Microsoft AI, 2026-10 무렵 (학습 2026년 8–9월)
크기 (active / total)34.7B / 962B (T1 Table 1, 본문 표기 35B / 1T)80B / 2.8T (B2 p.2)
층 / hidden78 / 6656102 / 8704
구조decoder-only MoE, local 5 : global 1 attention, MoE·dense FFN 교대, LatentMoE top-8/512같은 계열, 모든 층 MoE, shared 1 + routed 7/512
context256K (mid-training 후, T1 §1)보고서에 없음
사전학습 토큰30T + mid-training 3.55T (T1 §2)50T (B2 p.2)
하드웨어GB200 8,192장 (T1 Table 6)GB200 16k장, 38일, MFU 21%, goodput 89%
데이터 원칙사람이 만든 공개·라이선스 데이터, 사전학습에 LM 합성 데이터 없음같은 원칙 + 네이티브 비전(VLM 4.5T unique)
사후학습specialist 3개 RL → 통합 SFT → 최종 RL보고서 시점 post-training 중
가중치공개 안 함공개 안 함. Foundry를 통해 신뢰 파트너에 라이선스할 계획(B2 p.2)

무엇이 새로운가

  • 결정 절차가 주인공이다. 층 수 LL 하나로 구조가 정해지는 scaling ladder에서 모든 변경을 여러 규모로 재고, efficiency gain(EG)이라는 단일 지표로 채택 여부를 정한다. MAI-Base-2에서는 데이터 반복 횟수까지 맞추는 source scaling과 하이퍼파라미터 scaling law를 더했다.
  • 모델–인프라 co-design. FLOPs로는 이기지만 벽시계 시간으로 지는 변경(모든 층 MoE)을 인프라를 고쳐 채택 가능하게 만든다. multi-round dropless MoE(MoE 층 MFU 24% → 35%), Muon 재샤딩(iteration의 2.1%), 그리고 규모가 클수록 이득이 커지는 activation gradient clipping.
  • distillation 없는 사전학습. 다른 모델의 출력을 사전학습에 쓰지 않고, open-source 학습 데이터셋도 쓰지 않는다. 가중치를 라이선스하기 위한 데이터 출처 관리가 동기다.
  • 추론을 처음부터 RL로. reasoning trace 없이 GRPO 변형으로 시작한다. 두 가지 수정(adaptive entropy control, outer ratio clip)과 self-distillation으로 수천 step의 log-linear 상승을 유지한다.
  • specialist 3개를 하나로. STEM, agentic(SWE 환경 265,617개), helpfulness·safety를 따로 오른 뒤 SFT로 합치고 짧은 RL로 마무리한다.

아키텍처

블록: Gemma 3식 attention 위에 LatentMoE

MAI-Base-1은 decoder-only Transformer다(T1 §2.1). 블록마다 RMSNorm을 입력과 출력(잔차 더하기 직전)에 모두 두는 sandwich 배치를 쓰고, bias가 없다. 임베딩은 Base-1에서 tied, Base-2에서 untied다. tokenizer는 사내 tokenizer가 조금 더 좋았지만 기존 도구와의 통합을 위해 OpenAI의 o200k_base(어휘 200,019)를 썼다. Transformer 블록의 기본형에서 달라지는 곳은 두 군데, attention 배치와 FFN이다.

Attention. Gemma 3처럼 local attention 5층과 global attention 1층을 반복한다. local 층은 sliding window 512와 RoPE(base 10,000)를, global 층은 위치 인코딩 없이(NoPE) 쓴다. GQA로 KV head 8개, head 차원 128이며 query와 key에 RMSNorm을 건다. 마지막 층이 global이 되도록 LL은 6의 배수다. MAI-Base-2는 KV/Q head 수를 global 2/96, local 16/96으로 바꿨다(B2 표).

KV cache는 global 층에서만 context 길이 TT에 비례하고, local 층은 WW에서 멈춘다. 층 수 ng=L/6n_g = L/6, nℓ=5L/6n_\ell = 5L/6, BF16(bb = 2 byte)이면 시퀀스 하나의 KV 메모리는

MKV(T)=2 b dh[ ng hgkv T  +  nℓ hℓkvmin⁡(T,W)]M_{\text{KV}}(T) = 2\, b\, d_h \Big[\, n_g\, h^{\text{kv}}_{g}\, T \;+\; n_\ell\, h^{\text{kv}}_{\ell} \min(T, W) \Big]

다(앞의 2는 K와 V). T≫WT \gg W이면 둘째 항은 상수가 되어 global 항이 전부를 차지한다. 그래서 Base-2가 global KV head를 8에서 2로 줄인 것은 긴 context 메모리를 거의 4분의 1로 줄이는 선택이고, local head를 16으로 늘린 비용은 WW에 묶여 작다. 아래 그림에서 직접 확인할 수 있다(dh=128d_h = 128, W=512W = 512는 Base-1 값이고, Base-2 보고서는 이 둘을 밝히지 않아 같다고 가정했다).

→ 더 깊이: 설계 선택 비교 — MAI-Base-2의 블록을 gpt-oss, MiMo-V2, MiniMax-M2, GLM-5와 나란히 놓는다.

KV/시퀀스KV/sequence Base-1 – Base-2 – 모두 global(Base-1 head)all global (Base-1 heads) – global 층 비중(Base-2)global-layer share (Base-2) –
The strip on top shows every layer. The upper row is the attention type (global / local), the lower row the FFN type (MoE / dense). Switching the model turns Base-1's "alternating MoE–dense" into Base-2's "MoE in every layer". The plot below is the BF16 KV cache (one sequence) as a function of context length. Drag T and the local layers saturate at W, while at long context the single global layer in every six takes almost all of the memory. It shows why Base-2's choice to cut the global KV heads from 8 to 2 and raise the local ones from 8 to 16 pays off at long context. (Head dim 128 and W=512 are Base-1 report values. The Base-2 report does not state them, so they are assumed to be the same.) 위 띠는 층 하나하나다. 윗줄은 attention 종류(global / local), 아랫줄은 FFN 종류(MoE / dense). 모델을 바꾸면 Base-1의 "MoE–dense 교대"가 Base-2의 "모든 층 MoE"로 바뀐다. 아래 그래프는 BF16 KV cache(시퀀스 하나)를 context 길이에 따라 그린 것이다. T를 끌어 보면 local 층은 W에서 포화되고, 긴 context에서는 6층마다 하나뿐인 global 층이 메모리를 거의 다 차지한다. Base-2가 global KV head를 8→2로 줄이고 local을 8→16으로 늘린 선택이 왜 긴 context에서 이득인지 보인다. (head dim 128과 W=512는 Base-1 보고서 값이다. Base-2 보고서는 둘을 따로 밝히지 않아 같다고 가정했다.)

At TT = 256K, Base-1 needs about 13.1 GiB, Base-2 about 4.6 GiB (0.35× Base-1), and the same head configuration with every layer global would need about 78 GiB. Cutting the cost of the global layers, the reference point of the comparison, through the number of KV heads goes in the same direction as GQA and MLA in the inference lesson.

FFN and MoE. Base-1 alternates MoE and dense FFNs (the first FFN is dense; both are SwiGLU). The MoE follows NVIDIA’s LatentMoE design (covered in detail in the Nemotron 3 Ultra lesson). Before sending tokens through all-to-all, it compresses the hidden state with a shared down-projection W↓W_\downarrow, gathers the results, and restores the original dimension with W↑W_\uparrow. Routing is decided from the uncompressed representation hh.

y=W↑∑e∈TopK⁡(s)ge FFN⁡e ⁣(W↓h),s=softmax⁡(Wrh)y = W_\uparrow \sum_{e \in \operatorname{TopK}(s)} g_e\, \operatorname{FFN}_e\!\big(W_\downarrow h\big), \qquad s = \operatorname{softmax}(W_r h)

On the ladder the compression is 2×, and inside each expert the compressed representation is widened 3× (T1 §2.2.1). For example, L78 has hidden 6656, latent 3328 and expert FFN 9984. The actual MAI-Base-1 adjusted the latent to 3072 and the expert FFN to 10240 because DeepEP requires the all-to-all dimension to be a multiple of 512 (T1 Table 1). The benefit of compression is communication: the vectors moved by dispatch·combine go from DD to D/2D/2, so all-to-all bytes are halved.

Load balancing uses a GShard-style auxiliary loss, but the expert frequencies are aggregated over data-parallel workers and micro-batches (the global batch). The report says this aggregation scope mattered far more than the type of loss, and that once global aggregation was guaranteed it behaved similarly to loss-free methods (T1 §2.1). It is the basic MoE of the Transformer lesson with latent compression and global aggregation added.

From alternating layers to MoE in every layer: EGFLOPs and EGtime

Why did Base-1 put MoE in every other layer? T1 Table 2 shows that in a sparsity-matched comparison, “MoE in every layer” is similar or better in FLOPs (weighted-average EGFLOPs 0.94, 1.03 with a shared expert) but clearly loses in wall-clock time on the infrastructure of the time (EGtime 0.73, 0.82). So Base-1 chose the alternating layout. The Base-2 report fixed the two causes of that time loss (memory fragmentation from dynamic routing plus memory held for the worst-case imbalance, and per-expert overhead that grows as experts become more numerous and finer), raised MoE-layer MFU from 24% to 35%, and moved to MoE in every layer (shared 1 + routed 7/512) (B2 p.8). EGFLOPs is “the potential of the architecture”, EGtime is “its value on today’s infrastructure”, and the report’s logic is that where the two disagree is where to invest in infrastructure.

Multi-round dropless MoE

In an MoE, the number of tokens an expert receives changes every step. There are two common remedies: drop the tokens that exceed capacity (token drop), or reserve a lot of memory for the worst-case imbalance. MAI found that the first hurt quality (B2 p.8) and considers that the second wastes memory most of the time. Base-2’s solution is to fix the per-expert capacity cc and process overflow tokens in extra rounds (dispatch → compute → collect). Within the same expert group, experts borrow unused capacity. The number of rounds is global, so the most overflowing group determines it, and the capacity is set so that one round suffices in the normal case. The backward pass recomputes per group on the same round schedule, so memory stays fixed regardless of the imbalance.

→ Go deeper: Anatomy of MoE — LatentMoE, dropless routing and load balancing across models.

TT = 256K에서 계산하면 Base-1은 약 13.1 GiB, Base-2는 약 4.6 GiB(Base-1의 0.35배), 같은 head 구성을 모두 global로 했다면 약 78 GiB다. 비교의 기준이 되는 global 층의 비용을 KV head 수로 줄이는 방식은 추론 레슨의 GQA·MLA와 같은 방향이다.

FFN과 MoE. Base-1은 FFN을 MoE와 dense로 번갈아 둔다(첫 FFN은 dense, 둘 다 SwiGLU). MoE는 NVIDIA의 LatentMoE 설계를 따른다(Nemotron 3 Ultra 레슨에서 자세히 다룬다). all-to-all로 토큰을 보내기 전에 공유 down-projection W↓W_\downarrow로 hidden을 압축하고, 결과를 모은 뒤 W↑W_\uparrow로 원래 차원에 되돌린다. 라우팅은 압축 전 표현 hh로 정한다.

y=W↑∑e∈TopK⁡(s)ge FFN⁡e ⁣(W↓h),s=softmax⁡(Wrh)y = W_\uparrow \sum_{e \in \operatorname{TopK}(s)} g_e\, \operatorname{FFN}_e\!\big(W_\downarrow h\big), \qquad s = \operatorname{softmax}(W_r h)

ladder에서는 압축 2배, expert 안에서는 압축된 표현을 3배로 넓힌다(T1 §2.2.1). 예를 들어 L78은 hidden 6656, latent 3328, expert FFN 9984이다. 실제 MAI-Base-1은 DeepEP가 all-to-all 차원을 512의 배수로 요구해서 latent를 3072, expert FFN을 10240으로 조정했다(T1 Table 1). 압축의 이득은 통신이다. dispatch·combine이 옮기는 벡터가 DD에서 D/2D/2가 되니 all-to-all 바이트가 절반이 된다.

load balancing은 GShard식 보조 손실을 쓰되, expert 빈도를 data-parallel worker와 micro-batch 전체(global batch)에서 모아 계산한다. 보고서는 손실의 종류보다 이 집계 범위가 훨씬 중요했고, 전역 집계만 보장되면 loss-free 방식과 비슷했다고 쓴다(T1 §2.1). Transformer 레슨의 MoE 기본형에서 latent 압축과 전역 집계가 추가된 형태다.

교대 배치에서 모든 층 MoE로: EGFLOPs와 EGtime

왜 Base-1은 MoE를 한 층 걸러 두었을까. 보고서 T1 Table 2는 sparsity를 맞춘 비교에서 “모든 층 MoE”가 FLOPs 기준으로는 비슷하거나 낫지만(가중 평균 EGFLOPs 0.94, shared expert를 넣으면 1.03), 당시 인프라의 벽시계 시간 기준으로는 확실히 진다(EGtime 0.73, 0.82)는 것을 보여 준다. 그래서 Base-1은 교대 배치를 택했다. Base-2 보고서는 그 시간 손실의 원인 두 가지(동적 라우팅의 메모리 단편화와 최악 불균형용 메모리 점유, expert가 많고 잘수록 커지는 per-expert 오버헤드)를 고쳐 MoE 층 MFU를 24%에서 35%로 올리고, 모든 층 MoE(shared 1 + routed 7/512)로 갔다(B2 p.8). EGFLOPs가 “구조의 잠재력”, EGtime이 “지금 인프라에서의 가치”이고, 둘이 어긋나는 곳이 인프라 투자처라는 것이 보고서의 논리다.

다중 라운드 dropless MoE (multi-round)

MoE에서 expert가 받는 토큰 수는 매 step 다르다. 흔한 해법은 둘이다. 용량을 넘는 토큰을 버리거나(token drop), 최악의 불균형을 대비해 메모리를 크게 잡는다. MAI는 첫째가 성능을 떨어뜨렸고(B2 p.8), 둘째는 평상시 메모리를 낭비한다고 본다. Base-2의 해법은 expert당 용량 cc를 고정하고, 넘친 토큰을 추가 라운드(dispatch → compute → collect)로 처리하는 것이다. 같은 expert group 안에서는 남는 용량을 빌려 쓴다. 라운드 수는 전역이라 가장 많이 넘친 group이 정하며, 용량은 평상시 1라운드로 끝나도록 잡는다. backward도 같은 라운드 스케줄로 group 단위 재계산을 하므로 메모리가 불균형과 무관하게 고정된다.

→ 더 깊이: MoE 해부 — LatentMoE, dropless routing, 부하 균형을 여러 모델에 걸쳐 본다.

라운드 수(빌림 없음)rounds (no borrowing) – 라운드 수(group 안 빌림)rounds (borrowing within group) – drop했다면 버린 토큰tokens dropped if capped – 최악 대비 메모리(고정 대비)worst-case memory (vs fixed) –
Bars are the tokens each of the 32 experts receives in one step; dashed lines are multiples of the fixed per-expert capacity c (= round boundaries). Background bands are expert groups. Increase the skew s and some experts exceed c. Cutting at capacity (drop) throws the overflow tokens away, and reserving memory for the worst case wastes memory most of the time. The multi-round approach keeps memory fixed at c and processes the overflow in extra rounds. Increase the group size and experts borrow spare capacity from their group, so fewer rounds are needed. The round count is global, so the most overflowing group sets it. 막대는 expert 32개가 한 step에 받은 토큰 수, 점선은 expert당 고정 용량 c의 배수(= 라운드 경계)다. 배경 띠는 expert group이다. 쏠림 s를 키우면 일부 expert가 c를 넘는다. 용량에서 자르는(drop) 방식은 넘친 토큰을 버리고, 최악을 대비해 메모리를 크게 잡는 방식은 평소에 메모리를 낭비한다. multi-round 방식은 메모리를 c로 고정한 채 넘친 토큰을 추가 라운드로 처리한다. group 크기를 키우면 같은 group의 남는 용량을 빌려 라운드가 줄어든다. 라운드 수는 전역이라 가장 넘친 group이 정한다.
NumPy multi-round dropless MoE: rounds, drop rate, worst-case memory
import numpy as np

def route(n_tok, n_exp, k, skew, rng):
    """top-k routing with a Zipf-like popularity (skew=0 -> uniform). Returns tokens per expert."""
    w = (np.arange(n_exp) + 1.0) ** -skew
    w = rng.permutation(w) * np.exp(0.15 * rng.normal(size=n_exp))
    logits = np.log(w)[None, :] + rng.gumbel(size=(n_tok, n_exp))   # Gumbel-top-k = sampling w/o replacement
    top = np.argpartition(-logits, k, axis=1)[:, :k]
    return np.bincount(top.ravel().astype(np.intp), minlength=n_exp)

def multi_round(loads, cap, group):
    """rounds needed with fixed per-expert capacity `cap`; experts in a group share unused capacity."""
    no_borrow = int(np.max(np.ceil(loads / cap)))
    g = loads.reshape(-1, group).sum(1)
    borrow = int(np.max(np.ceil(g / (group * cap))))       # round count is global -> max over groups
    return no_borrow, borrow

rng = np.random.default_rng(0)
N, E, K = 4096, 32, 8
print("skew | cap/mean | rounds(no borrow) rounds(group=4) | dropped if capped | worst-case mem / fixed")
for skew in [0.0, 0.5, 1.0]:
    loads = route(N, E, K, skew, rng)
    for capf in [1.0, 1.25, 2.0]:
        cap = capf * N * K / E
        r0, r1 = multi_round(loads, cap, 4)
        drop = np.maximum(loads - cap, 0).sum() / loads.sum()
        print(f"{skew:4.1f} |  {capf:4.2f}   |        {r0}                {r1}          |     {100*drop:5.1f}%       |  {loads.max()/cap:.2f}x")
print("loads sum check:", loads.sum(), "=", N * K)
 

The more skewed the routing, the more the drop approach throws away (10–30% of tokens), and the worst-case approach needs 2–4× the fixed capacity in memory. Multi-round keeps memory fixed at the cost of a few extra rounds, and borrowing within a group reduces those rounds. The real cost is the MFU loss and the communication of the extra rounds; the report says that everything except the first dispatch and the last collect overlaps with compute.

Finally, there are two initialisation and stability devices. First, early in training the attention softmax is nearly uniform and effectively performs causal mean pooling; token representations then become similar, and routing in the next MoE layer becomes heavily skewed. MAI initialised the RMSNorm gain of the attention output to 0, so training starts with attention switched off (like a stack of per-token FFNs), and the reduced early imbalance translated into an EG gain (T1 §2.6.2, Figure 8). Second, Base-1’s early loss spikes came mainly from code data, together with high expert imbalance under dropless routing (T1 §2.6.4).

Data

Principles and pipeline

MAI-Base-1’s pre-training data was processed from scratch by an in-house pipeline from web HTML·PDFs, books·journals, and public GitHub code (T1 §2.4). It uses no LM-generated synthetic data and also tries to filter AI-generated content out of the collected data. It does not use open-source training datasets, and it removes ML repositories such as huggingface.co from the web data. Evaluation contamination is removed with universal 20-gram fuzzy dedup (80% similarity), but the report admits this is not perfect, and so it builds separate private in-house eval sets (T1 §2.3.1).

Deduplication received particular care. The report’s reasoning is that “the larger the model, the more scaling suffers when unique tokens run short.” The stages are boilerplate removal, exact dedup, MinHash LSH fuzzy dedup (threshold 0.8), template-page dedup (reducing pages to a skeleton of frequent tokens and fuzzy-deduplicating that), and semantic dedup (clustering with Qwen3-Embedding-0.6B and keeping only representatives). Duplicates across datasets are handled with a global drop-order: when a duplicate is found, it is kept only in the dataset with the highest priority. So fixing one dataset can make duplicates “move” into another dataset, and this order has to be taken into account when interpreting the value of a dataset.

HTML extraction is not done with a single method. Standard formats use structural parsers, high-value domains use hand-written extractors, and some content goes through LLM·agent-based processing. There the LLM can only keep or delete text from the original; it cannot write new content. For Wikipedia, parsers lose infoboxes and the like, so training on the raw wikitext (about 3× more verbose) as is worked better.

Mixture: thousands of small models and a counterexample to rank invariance

The mixture ratios are optimised against a weighted sum of about 40 NLL evals grouped into five categories (T1 Eq. 3).

Target=0.5 Coding+0.175 STEM+0.175 Math+0.1 General+0.05 Multilingual\text{Target} = 0.5\,\text{Coding} + 0.175\,\text{STEM} + 0.175\,\text{Math} + 0.1\,\text{General} + 0.05\,\text{Multilingual}

The report also says why it uses NLL rather than accuracy. Generative evals are expensive, and their results swing with trivial factors such as multiple-choice format and formatting (\boxed{}, \r\n line breaks). NLL under teacher forcing does not accumulate errors and matches the pre-training objective (T1 §2.3.2).

In the style of RegMix, MAI trained thousands of small models (L12–L36 class) that differ only in the mixture to build a predictive model, and found an important counterexample (T1 Figure 6). When a code-heavy-mix with about 50% code and a stem-heavy-mix with more STEM were trained as 23B active models for about 20T tokens, stem-heavy won on STEM NLL at small scale and early in training, but the curves crossed midway and code-heavy won. The rank-invariance assumption, “the ranking of mixtures is preserved when the scale changes”, broke. The suspected cause is two STEM sources of high quality but with many fuzzy duplicates and low diversity, which made up 11.8% of stem-heavy and 0.3% of code-heavy. The hypothesis is that they helped small models but lacked diversity for large ones.

After that, MAI alternated global search (ratios between categories) and local search (ratios within a category, e.g. code files·PRs·commits) at the level of about 10 categories, and capped every dataset at 8 repetitions. A few candidates were re-checked with 2.8× more compute. The result is the table below (T1 Table 5).

source familyunique (T)training tokens (T)sharemean epochs
Code7.416.454.6%2.22×
STEM2.24.715.8%2.17×
Math0.31.65.4%5.28×
Books and journals0.60.93.1%1.65×
PDFs2.71.44.7%0.53×
Web text8.14.514.9%0.55×
Multilingual (other)8.10.51.6%0.06×
Total29.230.0100%1.03×

More than half of the training tokens are code, and maths goes through about 300B unique tokens 5.28 times. Web and PDFs do not complete even one epoch, and multilingual uses only 0.5T of its 8.1T.

MAI-Base-2: 36% more unique tokens, and source scaling

Base-2 increased the unique tokens by about 36% (B2 p.12), and its web knowledge cutoff is March 2026. It improved quality classification, topic binning, web parsing, dedup and decontamination, and used embedding-based diversity sampling to prioritise novel data. Vision is a native VLM without an encoder; the VLM corpus of 4.5T unique tokens makes up 18% of the 50T mixture including repeats (“Vision-only” in Figure 10 is 14%). The per-category source shares and unique-token growth are at the top of the figure below. PDFs (+104%) and books (+194%) grew the most.

This is where Base-2’s most important methodology comes in: source scaling. Small ladder runs have few tokens, so at the same mixture ratios each source is repeated far less than in the final run. Small experiments never see the effect of running maths more than 5 times in the final run (the overfitting risk). Source scaling truncates the unique data of small runs by the same ratio so that the repeat counts match the final run. In the report’s example, a dataset repeated 8 times in a 50T run uses only 1/10 of that data in a 5T run, which is then also repeated 8 times. On a ladder that fixes TPP (tokens per active parameter), this has the effect of fixing the “unique data to parameter ratio” independently of scale.

NumPy multi-round dropless MoE: 라운드 수, drop률, 최악 메모리
import numpy as np

def route(n_tok, n_exp, k, skew, rng):
    """top-k routing with a Zipf-like popularity (skew=0 -> uniform). Returns tokens per expert."""
    w = (np.arange(n_exp) + 1.0) ** -skew
    w = rng.permutation(w) * np.exp(0.15 * rng.normal(size=n_exp))
    logits = np.log(w)[None, :] + rng.gumbel(size=(n_tok, n_exp))   # Gumbel-top-k = sampling w/o replacement
    top = np.argpartition(-logits, k, axis=1)[:, :k]
    return np.bincount(top.ravel().astype(np.intp), minlength=n_exp)

def multi_round(loads, cap, group):
    """rounds needed with fixed per-expert capacity `cap`; experts in a group share unused capacity."""
    no_borrow = int(np.max(np.ceil(loads / cap)))
    g = loads.reshape(-1, group).sum(1)
    borrow = int(np.max(np.ceil(g / (group * cap))))       # round count is global -> max over groups
    return no_borrow, borrow

rng = np.random.default_rng(0)
N, E, K = 4096, 32, 8
print("skew | cap/mean | rounds(no borrow) rounds(group=4) | dropped if capped | worst-case mem / fixed")
for skew in [0.0, 0.5, 1.0]:
    loads = route(N, E, K, skew, rng)
    for capf in [1.0, 1.25, 2.0]:
        cap = capf * N * K / E
        r0, r1 = multi_round(loads, cap, 4)
        drop = np.maximum(loads - cap, 0).sum() / loads.sum()
        print(f"{skew:4.1f} |  {capf:4.2f}   |        {r0}                {r1}          |     {100*drop:5.1f}%       |  {loads.max()/cap:.2f}x")
print("loads sum check:", loads.sum(), "=", N * K)
 

쏠림이 클수록 drop 방식은 토큰의 10–30%를 버리고, 최악 대비 방식은 고정 용량의 2–4배 메모리가 필요하다. multi-round는 메모리를 고정한 채 라운드 몇 개를 더 쓰고, group 안 빌림이 그 라운드를 줄인다. 실제 비용은 추가 라운드의 MFU 저하와 통신이며, 보고서는 첫 dispatch와 마지막 collect를 빼고 모두 compute와 겹친다고 쓴다.

마지막으로 두 가지 초기화·안정성 장치가 있다. 첫째, 학습 초기에 attention softmax는 거의 균등해서 사실상 causal 평균 풀링을 하고, 그 결과 토큰 표현이 비슷해져 다음 MoE 층의 라우팅이 크게 쏠린다. MAI는 attention 출력의 RMSNorm gain을 0으로 초기화해 처음에는 attention이 꺼진 채(토큰별 FFN 스택처럼) 시작하게 했고, 초기 불균형 감소가 EG 이득으로 이어졌다(T1 §2.6.2, Figure 8). 둘째, Base-1의 초반 loss spike는 주로 코드 데이터에서, dropless 라우팅의 높은 expert 불균형과 함께 나타났다(T1 §2.6.4).

데이터

원칙과 파이프라인

MAI-Base-1의 사전학습 데이터는 웹 HTML·PDF, 책·저널, 공개 GitHub 코드에서 사내 파이프라인으로 처음부터 처리한 것이다(T1 §2.4). LM이 생성한 합성 데이터는 쓰지 않고, 수집 데이터 안의 AI 생성 콘텐츠도 걸러내려 한다. open-source 학습 데이터셋을 쓰지 않으며 huggingface.co 같은 ML 저장소는 웹 데이터에서 뺀다. 평가 오염은 universal 20-gram fuzzy dedup(유사도 80%)으로 제거하지만 완벽하지 않다고 인정하고, 그래서 사내 비공개 평가셋을 따로 만든다(T1 §2.3.1).

중복 제거가 특히 공들인 부분이다. 보고서의 논리는 “큰 모델일수록 unique 토큰이 부족해지면 scaling이 나빠진다”는 것이다. 단계는 boilerplate 제거, exact dedup, MinHash LSH fuzzy dedup(임계 0.8), 템플릿 페이지 dedup(페이지를 자주 나오는 토큰 골격으로 줄여 fuzzy dedup), 의미 중복 제거(Qwen3-Embedding-0.6B로 군집 후 대표만 유지)다. 데이터셋 사이의 중복은 전역 drop-order로 처리한다. 중복이 발견되면 우선순위가 가장 높은 데이터셋에만 남긴다. 그래서 데이터셋 하나를 고치면 중복이 다른 데이터셋으로 “옮겨 가는” 효과가 생기고, 데이터셋 가치를 해석할 때 이 순서를 같이 봐야 한다.

HTML 추출은 한 가지 방법으로 하지 않는다. 표준 포맷은 구조 파서, 가치가 큰 도메인은 손으로 짠 추출기, 일부는 LLM·agent 기반 처리를 쓴다. 이때 LLM은 원문의 텍스트를 남기거나 지우기만 하고 새 내용을 쓰지 못한다. Wikipedia는 파서가 infobox 등을 잃기 때문에 wikitext 원문(약 3배 장황함)을 그대로 학습하는 쪽이 나았다.

혼합: 작은 모델 수천 개와 rank invariance의 반례

혼합 비율은 NLL 평가 약 40개를 다섯 범주로 묶은 가중합을 목표로 최적화한다(T1 식 3).

Target=0.5 Coding+0.175 STEM+0.175 Math+0.1 General+0.05 Multilingual\text{Target} = 0.5\,\text{Coding} + 0.175\,\text{STEM} + 0.175\,\text{Math} + 0.1\,\text{General} + 0.05\,\text{Multilingual}

정확도 대신 NLL을 쓰는 이유도 명시한다. 생성 평가는 비싸고, 객관식·포맷(\boxed{}, 줄바꿈 \r\n) 같은 사소한 요인에 결과가 흔들린다. teacher forcing인 NLL은 오류가 누적되지 않고 사전학습 목적과 같다(T1 §2.3.2).

RegMix류로 수천 개의 작은 모델(L12–L36급)을 혼합만 바꿔 학습해 예측 모델을 만들었는데, 중요한 반례가 나왔다(T1 Figure 6). 코드를 약 50%로 한 code-heavy-mix와 STEM을 올린 stem-heavy-mix를 23B active 모델로 약 20T 토큰 학습하자, 작은 규모와 학습 초반에는 STEM NLL에서 stem-heavy가 이기다가 중간에 곡선이 교차해 code-heavy가 이겼다. “혼합의 순위는 규모가 바뀌어도 유지된다”는 rank invariance 가정이 깨진 것이다. 원인으로 지목된 것은 품질은 높지만 fuzzy 중복이 많고 다양성이 낮은 STEM source 두 개다. stem-heavy에서 11.8%, code-heavy에서 0.3%를 차지했다. 작은 모델에는 도움이 됐지만 큰 모델에는 다양성이 부족했다는 가설이다.

이후 MAI는 약 10개 범주 단위로 global search(범주 간 비율)와 local search(범주 안 비율, 예: 코드 파일·PR·commit)를 번갈아 하고, 어떤 데이터셋도 8번 넘게 반복하지 않게 제한했다. 후보 몇 개는 2.8배 큰 연산으로 다시 확인했다. 결과가 아래 표다(T1 Table 5).

source familyunique (T)학습 토큰 (T)비율평균 epoch
Code7.416.454.6%2.22×
STEM2.24.715.8%2.17×
Math0.31.65.4%5.28×
Books and journals0.60.93.1%1.65×
PDFs2.71.44.7%0.53×
Web text8.14.514.9%0.55×
Multilingual (other)8.10.51.6%0.06×
합계29.230.0100%1.03×

학습 토큰의 절반 이상이 코드이고, 수학은 약 300B unique를 5.28번 돈다. 웹과 PDF는 1 epoch도 돌지 않으며, 다국어는 8.1T 중 0.5T만 쓴다.

MAI-Base-2: 36% 더 많은 unique 토큰, 그리고 source scaling

Base-2는 unique 토큰을 약 36% 늘렸고(B2 p.12), 웹 knowledge cutoff는 2026년 3월이다. 품질 분류·토픽 binning·웹 파싱·dedup·decontamination을 개선하고, embedding 기반 diversity sampling으로 새로운 데이터를 우선했다. 비전은 encoder 없는 네이티브 VLM이며, VLM 코퍼스 4.5T unique가 반복을 포함해 50T 혼합의 18%를 차지한다(Figure 10의 “Vision-only”는 14%). source 범주별 비율과 unique 증가율은 아래 그림 위쪽에 있다. PDF(+104%)와 책(+194%)이 가장 많이 늘었다.

여기서 Base-2의 가장 중요한 방법론이 나온다. source scaling이다. ladder의 작은 run은 토큰이 적으니, 같은 혼합 비율이면 각 source를 최종 run보다 훨씬 적게 반복한다. 최종 run에서 수학을 5번 넘게 돌리는 효과(과적합 위험)를 작은 실험은 전혀 보지 못한다. source scaling은 작은 run에서 unique 데이터를 같은 비율로 잘라서 반복 횟수를 최종 run과 맞춘다. 보고서의 예로, 50T run에서 8번 반복되는 데이터셋은 5T run에서는 그 데이터의 1/10만 써서 역시 8번 돈다. TPP(토큰/active 파라미터)를 고정하는 ladder에서는 이것이 “unique 데이터 대 파라미터 비”를 규모와 무관하게 고정하는 효과를 낸다.

최종 run 대비 길이length vs final run – Math 반복Math epochs – Code 반복Code epochs –
Top: composition of the training tokens. MAI-Base-1 is the training tokens (T) of Table 5 in the report, MAI-Base-2 the shares of Figure 10 (dark part = unique, light part = repeats). The number in parentheses is the growth in unique tokens from Base-1 to Base-2. Bottom: taking the Base-1 mixture (30T) as reference, how many times each source is repeated in a short ladder run. Turn source scaling off and shrink H, and no source completes even one epoch, so repetition disappears. The fact that the final run goes through Math 5.28 times is not reflected at all in the small experiment. Turn it on and the unique data is cut to H/30, so the repeat counts match the final run. 위: 학습 토큰 구성. MAI-Base-1은 보고서 Table 5의 학습 토큰(T)이고, MAI-Base-2는 Figure 10의 비율이다(진한 부분이 unique, 연한 부분이 반복). 괄호 안 숫자는 Base-1 → Base-2의 unique 토큰 증가율. 아래: Base-1 혼합(30T)을 기준으로, 짧은 ladder run에서 각 source가 몇 번 반복되는지. source scaling을 끄고 H를 줄이면 모든 source가 1 epoch도 돌지 않아 반복이 사라진다. 최종 run에서 Math를 5.28번 돌린다는 사실이 작은 실험에는 전혀 반영되지 않는다. 켜면 unique 데이터를 H/30만큼 잘라 반복 횟수가 최종 run과 같아진다.

The report says that choosing at small scale without source scaling selects architectures and hyperparameters with weak regularisation, which then overfit at large scale, and it names this as a key to scaling stably to 2.8T (B2 p.4). It is the same phenomenon as the earlier rank non-invariance case (STEM sources with many repeats that were good only at small scale), prevented through the design of the ladder.

Post-training data

  • Mid-training (selected only from the pre-training corpus, no new sources or synthetic data): STEM·maths 35%, code 55%, the rest 10%. PDFs at Bloom cognitive level “Analyze” or above are kept using Essential AI’s quality taxonomy, and code is filtered by file extension per each of three repository-quality tiers. Sources already memorised by the end of pre-training (estimated as the share of the validation-loss improvement coming from tokens with NLL below 0.01) get a lower epoch cap. When the context is extended to 64K and 256K, the ratios are not changed; the data is re-packed at the longer length (T1 §2.5.4).
  • STEM RL: from textbook·paper PDFs, forums, competition records and vendor problems, through OCR → hierarchical parsing → Q/A pairing → classification for verifiability·type·taxonomy·PII·answer leakage → conversion of multiple-choice and proof problems into open-ended problems (3-way agreement) → pass@k solving with 4 model tiers and difficulty grading. More than 5M samples, of which the hardest part is more than 550k. Open-ended problems are 56.1% and maths is 58.5% (T1 Figure 16).
  • SWE environments: start from 102 million public GitHub PRs. Keeping only PRs that were merged into main, touch fewer than 15 files, contain both code and test changes, and are linked to an issue leaves 4.87 million. 2.08 million (42.8%) built successfully from an agent-written Dockerfile, 745,452 (15.3%) still had fail-to-pass tests, and those that passed repeated verification that the empty patch fails and the gold patch passes number 265,617 (5.5%), from 94,044 repositories (T1 §3.3.1). For environments with a poor problem statement, an agent rewrites the statement to fit the tests; environments that built but fell short on quality are recycled by generating synthetic problems in the style of BugPilot·SWE-Smith.
  • Unified SFT mixture (T1 Table 10): by samples, STEM·coding 56%, agentic 11%, helpfulness·safety 33%. By tokens it is 89% / 9% / 2%. Balancing by sample count was what mattered; even with tokens skewed toward STEM, helpfulness did not suffer.

Training

Pre-training: MAI-Base-1

StageTokensContextGB200
pre-training30T16,3848,192
mid-training 13.4T65,5368,192
mid-training 2150B262,1444,096

(T1 Table 6.) Parallelism is expert parallel 64 with ZeRO-2, and the last stage uses ZeRO-3 (FSDP) with context parallel. The hyperparameters (T1 §2.6.2) are as follows.

  • AdamW β1=0.95\beta_1 = 0.95, β2=0.925\beta_2 = 0.925, ϵ=10−8\epsilon = 10^{-8}. Weight decay 0.1, lowered to 0.01 for attention weights and 0.005 for embeddings. Gradient clipping 1.0. Global batch 134M tokens.
  • After about 12B tokens of warmup, cosine from 2×10−42\times10^{-4} to 2×10−52\times10^{-5}. A final-to-peak ratio of 0.1 decays less than the common 0.01, because results after RL were better.
  • Dropout 0.15 on layer outputs. This is an unusual choice for large-scale pre-training, but the report says it was a gain in ladder evaluations as regularisation complementary to weight decay. It belongs with the source scaling and overfitting discussion above.
  • Precision: forward GEMMs in FP8 E4M3, data gradients in E5M2, weight gradients in BF16 (FP32 accumulation). Delayed scaling uses an amax history of 1024 steps. Pre-softmax activations (attention scores, router logits, output logits), the MoE combine, the entire residual stream, embedding·norm·router weights and the optimizer states are in FP32. Where precision is reduced, gradients use stochastic rounding.

Pre-training: what changed in MAI-Base-2

It was trained for 38 days on 16k GB200 (B2 p.2). Five things changed.

  1. Muon (2D parameters except embeddings) + AdamW (the rest). Muon orthogonalises the momentum matrix MM with Newton–Schulz iterations (if M=UΣV⊤M = U\Sigma V^\top, the update direction is ≈UV⊤\approx UV^\top; see the optimizers lesson). The problem is that ZeRO shards the momentum along the data-parallel axis, while Newton–Schulz needs the whole matrix. MAI reshards inside the optimizer step: it converts the FP32 shards to BF16, groups matrices of the same shape and sends them with all-to-all so that each GPU holds a few whole matrices, orthogonalises them with a Newton–Schulz kernel that exploits symmetry, and sends them back with another all-to-all. As a result Muon takes 2.1% of iteration time (165 ms). The communication-bound theoretical minimum is 55 ms.
  2. MXFP8 E4M3. An MX format with per-block scales instead of Base-1’s per-tensor delayed scaling (block scales work on the same principle as the MXFP4 figure in the gpt-oss lesson).
  3. Activation gradient clipping. Global weight-gradient clipping shrinks the gradient of the whole batch because of a few outliers in it. MAI clips the gradients of activations at fixed points in the network, targeting only the outlier tokens. Together with Muon, the gradient-norm range became much narrower than in Base-1 (B2 Figure 7), and unlike most changes, whose EG does not depend on scale, this technique’s EG grew with scale (+28% at L42, B2 Figure 8). Tracing back the clipped tokens also finds data bugs: a code-preprocessing bug in which license headers were cut off midway with a PR body attached was discovered this way (B2 Figure 9).
  4. The learning rate, weight decay and dropout were set with hyperparameter scaling laws (see “Key methods in depth” below).
  5. Average MFU 21% (relative to GB200 BF16 2.5 PFLOPS, excluding recomputation and optimizer FLOPs), goodput 89%.

Post-training: three climbs and a merge

MAI-Base-1 (mid-trained)
  ├─ STEM climb ─────────────┐
  ├─ SWE/agentic climb ──────┼─ unified SFT on each teacher's rollouts ─ final (light) RL ─ MAI-Thinking-1
  └─ helpfulness·safety climb┘

(T1 Figure 12.) The three climbs use the same RL recipe and differ only in prompt distribution and reward.

Objective. For each prompt xx, GG responses are sampled with the rollout policy πold\pi_{\text{old}}, the response-level rewards RiR_i are group-normalised, and every token gets the same advantage. Aggregation is DAPO-style token-level, dividing by the total number of tokens in the global batch (T1 Eq. 5).

J(θ)=Ex,  y1:G∼πold ⁣[1∑i∣yi∣∑i=1G∑t=1∣yi∣min⁡ ⁣(ρi,tA^i,  clip⁡(ρi,t, 1−ε, (1−ε)−1+k)A^i)]\mathcal{J}(\theta) = \mathbb{E}_{x,\; y_{1:G} \sim \pi_{\text{old}}}\!\left[ \frac{1}{\sum_i |y_i|} \sum_{i=1}^{G} \sum_{t=1}^{|y_i|} \min\!\Big(\rho_{i,t}\hat A_i,\; \operatorname{clip}\big(\rho_{i,t},\, 1-\varepsilon,\, (1-\varepsilon)^{-1} + k\big)\hat A_i\Big)\right]ρi,t=πθ(yi,t∣x,yi,<t)πold(yi,t∣x,yi,<t),A^i=Ri−mean⁡(R1:G)std⁡(R1:G)\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})}, \qquad \hat A_i = \frac{R_i - \operatorname{mean}(R_{1:G})}{\operatorname{std}(R_{1:G})}

(The report writes the ratio as ri,tr_{i,t}; we switched to this site’s notation ρ\rho.) There is no KL term in the objective, i.e. β=0\beta = 0 with no πref\pi_{\text{ref}}. Two things differ from the original in the GRPO lesson: the clip upper bound has a kk that moves with the entropy (adaptive entropy control), and an outer clip ρ≤rmax⁡\rho \le r_{\max} applies to every branch (outer ratio clip). Both are examined in depth below.

Reward (T1 Eq. 10–12). All climbs use the same decomposition.

R(x,yi)=Rtask+wlang max⁡ ⁣(1−α nnon-en(yi), 0)−wlen ρx∣yi∣ℓmax⁡R(x, y_i) = R_{\text{task}} + w_{\text{lang}}\, \max\!\big(1 - \alpha\, n_{\text{non-en}}(y_i),\, 0\big) - w_{\text{len}}\, \rho_x \frac{|y_i|}{\ell_{\max}}

The language-consistency term was added because, as the context grew, foreign-language tokens crept into the CoT, and that correlated with spikes in the training–inference log-prob gap and destabilised training. The length penalty is proportional to the problem’s pass rate ρx\rho_x (here ρx\rho_x is a pass rate, not a ratio). Easy problems are penalised strongly so that they are solved briefly, and hard problems are penalised weakly to allow long exploration. Because it is divided by ℓmax⁡\ell_{\max}, the penalty naturally weakens as the length limit grows, and at the 128K stage it was switched off with wlen=0w_{\text{len}} = 0.

Sampling. For each problem, Gearly=16G_{\text{early}} = 16 responses are drawn first, and if the pass rate is in [0.05,0.8][0.05, 0.8] the group is filled up to G=128G = 128. Completed groups are filtered again by pass rate [0.1,0.8][0.1, 0.8], because groups that are almost all right or all wrong carry no relative signal. Rollouts are sampled with top-p 0.97, and when gradients also flowed through the logits of tokens outside the nucleus during training, the “catastrophic off-policy mismatch” made training diverge within a few steps. So the rollout’s top-p mask is stored and the same tokens are masked to −∞-\infty during training. The maximum length starts at 8K and grows to 16K, 32K, 64K and 128K.

Hyperparameters (T1 §3.1.5). AdamW β1=β2=0.95\beta_1 = \beta_2 = 0.95, ϵ=10−15\epsilon = 10^{-15}, no weight decay, and a constant learning rate of 10−610^{-6}, lowered to 9×10−79\times10^{-7} at long lengths. The global batch after packing is 7040. ε=0.6\varepsilon = 0.6, kmax⁡=2.5k_{\max} = 2.5, δ=0.25\delta = 0.25, H⋆=0.3H^\star = 0.3, rmax⁡=50r_{\max} = 50, wlang=0.5w_{\text{lang}} = 0.5, α=0.005\alpha = 0.005, wlen=0.25w_{\text{len}} = 0.25. Training is fully asynchronous: each update of the inference model takes 5 gradient steps, and rollouts from a generating policy more than 8 updates (= 40 gradient steps) stale are discarded. Longer rollouts are staler, which is why the learning rate is lowered at long lengths. The MoE load-balancing coefficient is 10−510^{-5}.

Training–inference numerical mismatch. The learner (in-house YOLO) and inference (SGLang) differ in kernels, scheduling and parallelism. MAI writes that using bf16 on both sides gave a much smaller and more stable numerical gap than lower precision did. On top of that it applies MoE routing replay and top-p mask replay (T1 §3.6.4). The largest RL job used 4,096 of 4,864 GB300 for inference and 768 for the learner. It is a case of handling the problem from the training–inference mismatch lesson at scale with unified precision and replay.

Self-distillation. The mid-trained checkpoint is SFT-ed on rollouts collected during RL, and RL is restarted from that model. It serves four purposes: moving behaviour that began with raw prompts (R1-style <think> template) into the native chat format; recovering climbs that collapsed from numerical instability (checkpoints from before the collapse often already had the instability baked in, so rolling back did not help); carrying progress over to a new base checkpoint; and filtering out reward-hacking samples. The report’s ablation conclusions are as follows (T1 §3.1.4).

  • O(1M) traces reach teacher performance. More than that narrows the output distribution and reduces the room for exploration in the subsequent RL.
  • Including incorrect traces was similar to using only correct ones (there were enough correct ones, so only those were used).
  • Traces drawn from several late checkpoints are best. Early traces are harmful, and the last checkpoint alone lacks diversity.
  • At a fixed token budget, prompt diversity matters more than the number of traces per prompt, and plain random sampling beat biased sampling such as preferring short traces.
  • Mid-training data is mixed in so that long-context ability is not forgotten. SFT uses dropout 0.15 (raising entropy to prevent collapse) and a large load-balancing coefficient of 10−210^{-2}. In RL it is 10−510^{-5}; since the SFT data has the same distribution as the RL rollouts, the expert balance built during SFT persists through RL.

Agentic climb. A ReAct-style loop alternates policy steps and environment steps (observations), and the tokens of earlier steps remain a strict prefix of the next step. The whole trajectory is graded and then every token of every policy step gets the same credit. The SWE tools are just two: bash and a string-replacement editor. The environment spins up a fresh container per request and blocks the network by default. Three kinds of reward hacking were observed: finding the original PR on the internet, finding the answer commit in the local git history (hence “time-traveled” repositories with the commits·refs·branches after the base commit removed), and tampering with tests (test files are reverted before grading, and test changes are applied only at grading time). Workarounds such as monkey-patching the test framework still remained, so an LLM monitor keeps watch. Mixing in STEM tasks stabilised the agentic climb and transferred positively to agentic performance, but there was no transfer in the opposite direction (agentic → STEM).

Helpfulness·safety climb. The reward model is a post-trained MAI-Base-1. It was SFT-ed to take kk responses joined with <|im_sep|> and predict a sequence of 1–5 scores as text. At inference time the response order is rotated kk times, only the first-token distribution of each is read, and “the probability of a 5” is used as the reward (T1 §3.4.1). On top of this come rubric-based AI judges and verifiable rewards (instruction constraints, length-quantile ranges), and the report separately discusses how to combine rewards on different scales. Unlike the pairwise BT model of the reward model lesson, it is a generative k-way RM.

Merge. SFT for 4 epochs on the rollouts of the three teachers (STEM·agentic from several checkpoints, H&S filtered with judges and heuristics) (peak learning rate 10−510^{-5}, decayed 2×), followed by a light RL at 128K length with a little STEM·coding mixed in, which polishes safety, over-refusal and style. Without STEM·coding in the mix, complex reasoning performance slowly declined (T1 §3.5). It is the same setup as the multi-teacher merge in the distillation lesson.

확인 문제Check yourself

On a ladder with source scaling, you run a small 5T-token run. If a maths dataset is repeated 6 times in the final 50T run, how is that dataset used in the small run?

Source scaling cuts the unique part of each dataset in the small run by the run-length ratio (5T/50T = 1/10), so that the repeat count matches the final run. Without it (the first choice), the small run has almost no repetition, cannot see the overfitting risk, and ends up selecting weakly regularised settings. With the third choice, the dataset’s training tokens would far exceed its mixture ratio, changing the mixture itself.

Key methods in depth

1. Scaling ladder, efficiency gain, hyperparameter laws

Ladder. The whole architecture is fixed by a single number, the layer count LL: hidden D=2563LD = \tfrac{256}{3}L (L78 → 6656, L102 → 8704; Base-1 and Base-2 both follow this formula), the number of query heads is a multiple of 16 close to LL (T1 says “rounded up”, but B2’s L102 → 96 matches rounding to the nearest), and the dense FFN expansion is 2×. Every ablation is run on a ladder of several rungs at fixed TPP. Architecture ablations are done at 100–200 TPP, near Chinchilla, while the main run over-trains at 500–1,000 TPP for inference cost (T1 §2.2.1).

EG. Fit L=f(C)=AC−α+EL = f(C) = A C^{-\alpha} + E to the baseline ladder. If a candidate reaches loss L′L' with compute C′C', then

EG=f−1(L′)C′,f−1(L)=(L−EA)−1/α\mathrm{EG} = \frac{f^{-1}(L')}{C'}, \qquad f^{-1}(L) = \Big(\frac{L - E}{A}\Big)^{-1/\alpha}

(T1 Eq. 1–2). EG = 1.3 means “the baseline needs 30% more compute to reach the same loss”. Measuring CC in FLOPs shows the potential of the architecture; measuring it in wall-clock time shows its value on current infrastructure. The key is to measure EG at several scales and look at the EG(CC) curve. For most changes this curve is flat, but some changes help only at small scale (the STEM sources above) and some grow with scale (activation gradient clipping).

The Base-2 report’s claim of being “4.2–12.3× more FLOPs-efficient than DeepSeek-V4-Pro-Base” is built with the same tool. For each of the 4 evals a BPB-vs-FLOPs law is fitted, including MAI-Base-2’s final point so that the comparison is an interpolation rather than an extrapolation. Then f−1(BPB of the other model)f^{-1}(\text{BPB of the other model}) is compared with that model’s actual training FLOPs (B2 Figure 3).

보고서는 source scaling 없이 작은 규모에서 고르면 정규화가 약한 구조·하이퍼파라미터가 뽑히고, 그것이 큰 규모에서 과적합한다고 쓴다. 그리고 이것을 2.8T까지 안정적으로 키운 핵심으로 꼽는다(B2 p.4). 앞의 rank non-invariance 사례(반복이 많은 STEM source가 작은 규모에서만 좋았던 것)와 같은 현상을 ladder 설계로 막은 것이다.

사후학습 데이터

  • Mid-training(사전학습 코퍼스에서만 추림, 새 소스·합성 없음): STEM·수학 35%, 코드 55%, 나머지 10%. PDF는 Essential AI의 품질 taxonomy로 Bloom 인지 수준 “Analyze” 이상을 남기고, 코드는 저장소 품질 3등급별로 확장자를 걸러낸다. 사전학습 끝에 이미 외워진 source(검증 loss 개선 중 NLL 0.01 미만 토큰이 차지하는 비율로 추정)는 epoch 상한을 더 낮게 준다. 64K, 256K로 context를 늘릴 때는 비율을 바꾸지 않고 더 긴 길이로 다시 pack한다(T1 §2.5.4).
  • STEM RL: 교재·논문 PDF, 포럼, 대회 기록, 업체 문제에서 OCR → 계층 파싱 → Q/A 짝짓기 → 검증 가능성·유형·taxonomy·PII·답 누출 분류 → 객관식·증명을 열린 문제로 변환(3회 합의) → 4개 모델 tier로 pass@k 풀이와 난이도 등급까지 거친다. 5M개가 넘는 샘플, 그중 가장 어려운 부분이 550k개 이상이다. 열린 문제가 56.1%이고 수학이 58.5%다(T1 Figure 16).
  • SWE 환경: 공개 GitHub PR 1억 2백만 개에서 시작한다. main에 머지됐고, 15개 파일 미만을 고쳤고, 코드와 테스트 변경을 모두 포함하며, 이슈와 연결된 PR만 남기면 487만 개다. agent가 Dockerfile을 만들어 빌드에 성공한 것이 208만 개(42.8%), fail-to-pass 테스트가 남은 것이 745,452개(15.3%), 빈 패치는 실패하고 정답 패치는 통과하는지 반복 검증을 통과한 것이 265,617개(5.5%), 저장소 94,044개다(T1 §3.3.1). 문제 설명이 부실한 환경은 agent가 테스트에 맞게 다시 쓰고, 빌드는 됐지만 품질에서 떨어진 환경은 BugPilot·SWE-Smith식으로 합성 문제를 만들어 재활용한다.
  • 통합 SFT 혼합(T1 Table 10): 샘플 기준 STEM·코딩 56%, agentic 11%, helpfulness·safety 33%. 토큰 기준으로는 89% / 9% / 2%다. 샘플 수로 균형을 맞추는 것이 중요했고, 토큰이 STEM에 쏠려도 helpfulness는 상하지 않았다.

학습

사전학습: MAI-Base-1

단계토큰contextGB200
사전학습30T16,3848,192
mid-training 13.4T65,5368,192
mid-training 2150B262,1444,096

(T1 Table 6.) 병렬화는 expert parallel 64에 ZeRO-2, 마지막 단계는 ZeRO-3(FSDP)와 context parallel이다. 하이퍼파라미터(T1 §2.6.2)는 다음과 같다.

  • AdamW β1=0.95\beta_1 = 0.95, β2=0.925\beta_2 = 0.925, ϵ=10−8\epsilon = 10^{-8}. weight decay 0.1이고, attention 가중치는 0.01, 임베딩은 0.005로 낮춘다. gradient clipping 1.0. global batch 134M 토큰.
  • 약 12B 토큰 warmup 뒤 cosine으로 2×10−42\times10^{-4}에서 2×10−52\times10^{-5}까지. 끝/최대 비 0.1은 흔한 0.01보다 덜 줄인 것인데, RL 이후 결과가 더 좋았기 때문이다.
  • 층 출력에 dropout 0.15. 대형 사전학습에서는 드문 선택인데, weight decay와 상보적인 정규화로 ladder 평가에서 이득이었다고 한다. 앞의 source scaling·과적합 논의와 같은 맥락이다.
  • 정밀도: forward GEMM은 FP8 E4M3, data-gradient는 E5M2, weight-gradient는 BF16(FP32 누적)이다. delayed scaling은 1024 step의 amax 기록을 쓴다. softmax 앞 활성(attention score, router logit, 출력 logit), MoE combine, residual stream 전체, 임베딩·norm·router 가중치, optimizer 상태는 FP32다. 정밀도가 내려가는 곳에서는 gradient에 stochastic rounding을 쓴다.

사전학습: MAI-Base-2에서 바뀐 것

GB200 16k장으로 38일을 학습했다(B2 p.2). 바뀐 것은 다섯 가지다.

  1. Muon(임베딩을 뺀 2D 파라미터) + AdamW(나머지). Muon은 momentum 행렬 MM을 Newton–Schulz 반복으로 직교화한다(M=UΣV⊤M = U\Sigma V^\top이면 갱신 방향 ≈UV⊤\approx UV^\top, optimizers 레슨 참고). 문제는 ZeRO가 momentum을 data-parallel 축으로 쪼개 두는데 Newton–Schulz는 행렬 전체가 필요하다는 점이다. MAI는 optimizer step 안에서 재샤딩한다. FP32 shard를 BF16으로 바꾸고, 같은 모양끼리 묶어 all-to-all로 보내 GPU마다 전체 행렬 몇 개씩을 갖게 한 뒤, 대칭성을 이용하는 Newton–Schulz 커널로 직교화하고, 다시 all-to-all로 되돌린다. 결과적으로 Muon이 iteration 시간의 2.1%(165 ms)를 차지한다. 통신이 병목인 이론 최소는 55 ms다.
  2. MXFP8 E4M3. Base-1의 tensor 단위 delayed scaling 대신 블록 단위 scale을 쓰는 MX 포맷이다(블록 scale은 gpt-oss 레슨의 MXFP4 그림과 같은 원리).
  3. Activation gradient clipping. 전역 weight gradient clipping은 batch 안의 outlier 몇 개 때문에 batch 전체의 gradient를 줄인다. MAI는 네트워크의 정해진 위치에서 activation의 gradient를 clip해 outlier 토큰만 겨냥한다. Muon과 함께 gradient norm 범위가 Base-1보다 훨씬 좁아졌고(B2 Figure 7), 대부분의 변경이 규모와 무관한 EG를 보이는 것과 달리 이 기법은 규모가 클수록 EG가 커졌다(L42에서 +28%, B2 Figure 8). clip된 토큰을 역추적하면 데이터 버그도 찾을 수 있다. 라이선스 헤더가 중간에 잘리고 PR 본문이 붙어 있던 코드 전처리 버그가 그렇게 발견됐다(B2 Figure 9).
  4. 하이퍼파라미터 scaling law로 학습률·weight decay·dropout을 정했다(아래 “깊게 보기”).
  5. 평균 MFU 21%(GB200 BF16 2.5 PFLOPS 기준, 재계산·optimizer FLOPs 제외), goodput 89%.

사후학습: 세 번의 climb과 통합

MAI-Base-1 (mid-trained)
  ├─ STEM climb ─────────────┐
  ├─ SWE/agentic climb ──────┼─ 각 teacher의 rollout으로 통합 SFT ─ 최종(가벼운) RL ─ MAI-Thinking-1
  └─ helpfulness·safety climb┘

(T1 Figure 12.) 세 climb은 같은 RL 레시피를 쓰고 prompt 분포와 보상만 다르다.

목적함수. prompt xx마다 rollout 정책 πold\pi_{\text{old}}로 GG개 응답을 뽑고, 응답 단위 보상 RiR_i를 그룹 정규화해 모든 토큰에 같은 advantage를 준다. 집계는 DAPO식 token-level이며 global batch 전체 토큰으로 나눈다(T1 식 5).

J(θ)=Ex,  y1:G∼πold ⁣[1∑i∣yi∣∑i=1G∑t=1∣yi∣min⁡ ⁣(ρi,tA^i,  clip⁡(ρi,t, 1−ε, (1−ε)−1+k)A^i)]\mathcal{J}(\theta) = \mathbb{E}_{x,\; y_{1:G} \sim \pi_{\text{old}}}\!\left[ \frac{1}{\sum_i |y_i|} \sum_{i=1}^{G} \sum_{t=1}^{|y_i|} \min\!\Big(\rho_{i,t}\hat A_i,\; \operatorname{clip}\big(\rho_{i,t},\, 1-\varepsilon,\, (1-\varepsilon)^{-1} + k\big)\hat A_i\Big)\right]ρi,t=πθ(yi,t∣x,yi,<t)πold(yi,t∣x,yi,<t),A^i=Ri−mean⁡(R1:G)std⁡(R1:G)\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})}, \qquad \hat A_i = \frac{R_i - \operatorname{mean}(R_{1:G})}{\operatorname{std}(R_{1:G})}

(보고서는 ratio를 ri,tr_{i,t}로 쓰지만 이 사이트 표기 ρ\rho로 바꿨다.) 식에 KL 항이 없다. 즉 πref\pi_{\text{ref}}를 쓰지 않는 β=0\beta = 0이다. GRPO 레슨의 원형에서 달라진 것은 두 가지다. clip 상한이 entropy에 따라 움직이는 kk를 갖고(adaptive entropy control), 모든 가지에 ρ≤rmax⁡\rho \le r_{\max}라는 바깥 clip이 걸린다(outer ratio clip). 둘 다 아래에서 깊게 본다.

보상(T1 식 10–12). 모든 climb에서 같은 분해를 쓴다.

R(x,yi)=Rtask+wlang max⁡ ⁣(1−α nnon-en(yi), 0)−wlen ρx∣yi∣ℓmax⁡R(x, y_i) = R_{\text{task}} + w_{\text{lang}}\, \max\!\big(1 - \alpha\, n_{\text{non-en}}(y_i),\, 0\big) - w_{\text{len}}\, \rho_x \frac{|y_i|}{\ell_{\max}}

언어 일관성 항은 context가 길어지면서 CoT에 외국어 토큰이 섞이고, 그것이 학습–추론 log-prob 차이 급증과 상관되어 학습을 불안정하게 만들었기 때문에 넣었다. 길이 벌점은 문제의 pass rate ρx\rho_x에 비례한다(여기 ρx\rho_x는 ratio가 아니라 pass rate). 쉬운 문제는 짧게 풀도록 강하게 벌하고, 어려운 문제는 약하게 벌해 긴 탐색을 허용한다. ℓmax⁡\ell_{\max}로 나누므로 길이 한도를 늘릴수록 벌점이 자연히 약해지고, 128K 단계에서는 wlen=0w_{\text{len}} = 0으로 껐다.

샘플링. 문제마다 먼저 Gearly=16G_{\text{early}} = 16개를 뽑아 pass rate가 [0.05,0.8][0.05, 0.8]이면 G=128G = 128까지 채운다. 완성된 그룹은 다시 pass rate [0.1,0.8][0.1, 0.8]로 거른다. 거의 다 맞거나 다 틀린 그룹은 상대 신호가 없기 때문이다. rollout은 top-p 0.97로 뽑는데, 학습 때 nucleus 밖 토큰의 logit으로도 gradient가 흐르면 “파국적인 off-policy 불일치”로 몇 step 만에 발산했다. 그래서 rollout의 top-p mask를 저장했다가 학습 때 같은 토큰을 −∞-\infty로 막는다. 최대 길이는 8K에서 시작해 16K, 32K, 64K, 128K로 늘린다.

하이퍼파라미터(T1 §3.1.5). AdamW β1=β2=0.95\beta_1 = \beta_2 = 0.95, ϵ=10−15\epsilon = 10^{-15}, weight decay 없음, 학습률 상수 10−610^{-6}이고 긴 길이에서는 9×10−79\times10^{-7}로 낮췄다. packing 후 global batch는 7040이다. ε=0.6\varepsilon = 0.6, kmax⁡=2.5k_{\max} = 2.5, δ=0.25\delta = 0.25, H⋆=0.3H^\star = 0.3, rmax⁡=50r_{\max} = 50, wlang=0.5w_{\text{lang}} = 0.5, α=0.005\alpha = 0.005, wlen=0.25w_{\text{len}} = 0.25. 학습은 완전 비동기다. inference 모델을 한 번 갱신할 때마다 gradient step 5번을 밟고, 생성 정책이 8번(= 40 gradient step) 넘게 낡은 rollout은 버린다. 긴 rollout일수록 더 낡으므로 긴 길이에서 학습률을 낮춘 것이다. MoE load balancing 계수는 10−510^{-5}다.

학습–추론 수치 차이. learner(사내 YOLO)와 inference(SGLang)는 kernel·스케줄·병렬화가 다르다. MAI는 양쪽 모두 bf16을 쓰는 것이 더 낮은 정밀도보다 수치 차이가 훨씬 작고 안정적이었다고 쓴다. 그 위에 MoE routing replay와 top-p mask replay를 건다(T1 §3.6.4). 가장 큰 RL job은 GB300 4,864장 중 4,096장이 inference, 768장이 learner였다. 학습–추론 불일치 레슨의 문제를 대규모에서 정밀도 통일과 replay로 막은 사례다.

Self-distillation. RL 중 모은 rollout으로 mid-trained 체크포인트를 SFT하고, 그 모델에서 RL을 다시 시작한다. 용도는 네 가지다. 처음엔 raw prompt(R1식 <think> 템플릿)로 시작한 행동을 고유 chat format으로 옮기고, 수치 불안정으로 붕괴한 climb을 복구하고(붕괴 전 체크포인트에는 이미 불안정이 심겨 있어 되돌려도 소용없는 경우가 많았다), 새 base 체크포인트로 진척을 옮기고, reward hacking 샘플을 걸러낸다. 보고서의 ablation 결론은 다음과 같다(T1 §3.1.4).

  • trace O(1M)개면 teacher 성능에 닿는다. 그보다 많으면 출력 분포가 좁아져 이후 RL의 탐색 여지가 줄어든다.
  • 오답 trace를 포함해도 정답만 쓴 것과 비슷했다(정답이 충분해 정답만 썼다).
  • 후반부의 여러 체크포인트에서 고른 trace가 좋다. 초반 trace는 해롭고, 마지막 체크포인트만 쓰면 다양성이 부족하다.
  • 같은 토큰 예산이면 prompt 다양성이 prompt당 trace 수보다 중요하고, 단순 무작위 추출이 짧은 trace 우선 같은 편향 추출보다 나았다.
  • 긴 context 능력을 잊지 않도록 mid-training 데이터를 섞는다. SFT는 dropout 0.15(entropy를 높여 붕괴를 막음)와 큰 load-balancing 계수 10−210^{-2}를 쓴다. RL에서는 10−510^{-5}인데, SFT 데이터가 RL rollout과 같은 분포라 SFT에서 만든 expert 균형이 RL에서도 유지된다.

Agentic climb. ReAct식 루프로 정책 step과 환경 step(관찰)을 번갈아 쌓고, 이전 step의 토큰은 다음 step의 엄격한 prefix로 유지된다. 궤적 전체를 채점한 뒤 모든 정책 step의 모든 토큰에 같은 credit을 준다. SWE 도구는 bash와 문자열 치환 편집기 둘뿐이다. 환경은 요청마다 새 컨테이너를 띄우고 기본적으로 네트워크를 막는다. 관찰된 reward hacking은 세 가지였다. 인터넷에서 원래 PR 찾기, 로컬 git 기록에서 정답 commit 찾기(그래서 base commit 이후의 commit·ref·branch를 지운 “time-traveled” 저장소를 쓴다), 테스트 조작(테스트 파일을 채점 전에 되돌리고 테스트 변경은 채점 때만 적용한다). 그래도 테스트 프레임워크 monkey-patching 같은 우회가 남아 LLM monitor로 계속 감시한다. STEM 과제를 섞으면 agentic climb이 안정되고 agentic 성능에도 양의 전이가 있었지만, 반대 방향(agentic → STEM)의 전이는 없었다.

Helpfulness·safety climb. 보상 모델은 MAI-Base-1을 post-training한 모델이다. kk개 응답을 <|im_sep|>로 이어 붙여 넣고 1–5 점수열을 텍스트로 예측하도록 SFT했다. 추론 때는 응답 순서를 kk번 회전시켜 각각의 첫 토큰 분포만 보고, “5점일 확률”을 보상으로 쓴다(T1 §3.4.1). 여기에 rubric 기반 AI judge와 검증 가능한 보상(지시 제약, 길이 분위 범위)을 더하고, 스케일이 다른 보상들을 합치는 방법도 따로 다룬다. 보상모델 레슨의 pairwise BT와 다른, 생성형 k-way RM이다.

통합. 세 teacher의 rollout(STEM·agentic은 여러 체크포인트에서, H&S는 judge·휴리스틱으로 거름)으로 SFT를 4 epoch 하고(최대 학습률 10−510^{-5}에서 2배 감쇠), 128K 길이에서 STEM·코딩을 조금 섞은 가벼운 RL로 안전·과잉 거절·스타일을 다듬는다. STEM·코딩을 섞지 않으면 복잡한 추론 성능이 천천히 떨어졌다(T1 §3.5). 증류 레슨의 multi-teacher 통합과 같은 구도다.

확인 문제Check yourself

source scaling을 켠 ladder에서 5T 토큰짜리 작은 run을 돌린다. 최종 50T run에서 수학 데이터셋이 6번 반복된다면, 작은 run에서 그 데이터셋은 어떻게 쓰이는가?

source scaling은 작은 run에서 각 데이터셋의 unique 부분을 run 길이 비율(5T/50T = 1/10)만큼 잘라, 반복 횟수를 최종 run과 같게 만든다. 그러지 않으면(첫째 선택지) 작은 run에는 반복이 거의 없어 과적합 위험을 볼 수 없고, 정규화가 약한 설정이 뽑힌다. 셋째 선택지는 학습 토큰이 혼합 비율보다 훨씬 많아져 혼합 자체가 바뀐다.

핵심 method 깊게 보기

1. Scaling ladder, efficiency gain, 하이퍼파라미터 법칙

ladder. 구조 전체가 층 수 LL 하나로 정해진다. hidden D=2563LD = \tfrac{256}{3}L(L78 → 6656, L102 → 8704로 Base-1·Base-2 모두 이 식을 따른다), query head 수는 LL에 가까운 16의 배수(T1은 “올림”이라 쓰지만 B2의 L102 → 96은 반올림과 맞다), dense FFN은 2배 확장이다. 모든 ablation은 TPP를 고정한 여러 칸의 ladder로 돌린다. 구조 ablation은 Chinchilla 근처인 100–200 TPP에서 하고, 본 학습은 추론 비용을 위해 500–1,000 TPP로 과학습한다(T1 §2.2.1).

EG. baseline ladder에 L=f(C)=AC−α+EL = f(C) = A C^{-\alpha} + E를 맞추고, 후보가 연산 C′C'로 loss L′L'에 도달했다면

EG=f−1(L′)C′,f−1(L)=(L−EA)−1/α\mathrm{EG} = \frac{f^{-1}(L')}{C'}, \qquad f^{-1}(L) = \Big(\frac{L - E}{A}\Big)^{-1/\alpha}

다(T1 식 1–2). EG = 1.3은 “baseline이 같은 loss에 닿으려면 30% 더 많은 연산이 든다”는 뜻이다. CC를 FLOPs로 재면 구조의 잠재력을, 벽시계 시간으로 재면 현재 인프라에서의 가치를 본다. 핵심은 EG를 여러 규모에서 재서 EG(CC) 곡선을 보는 것이다. 대부분의 변경은 이 곡선이 평평하지만, 작은 규모에서만 이득인 변경(앞의 STEM source)도 있고 규모와 함께 커지는 변경(activation gradient clipping)도 있다.

Base-2 보고서의 “DeepSeek-V4-Pro-Base보다 4.2–12.3배 FLOPs 효율적”이라는 주장도 같은 도구로 만든다. 평가 4개마다 BPB 대 FLOPs 법칙을 맞추되, MAI-Base-2 최종점을 넣어 외삽이 아니라 내삽이 되게 한다. 그리고 f−1(상대 BPB)f^{-1}(\text{상대 BPB})를 상대의 실제 학습 FLOPs와 비교한다(B2 Figure 3).

EG @L42 – EG @최종final(2.4e25) – 목표 BPB에 필요한 FLOPsFLOPs needed for target BPB f⁻¹ –
The points on the left are approximate values read by eye from Figure 3 (held-out code) of the report, and the black line is L = A·C−α + E fitted to them (fitting L18–L42 alone already predicts the final point 0.2203 as 0.2202). The red dashed line is the ladder with a candidate change applied: at the same compute C it reaches the loss the baseline would reach with EG(C)·C. Press "Small scale only": the change is a gain over L18–L42 but extrapolates to EG < 1 at the final scale. That is why EG is measured on several rungs of the ladder. The target-BPB buttons use the inverse of the fit to compute "how many FLOPs our recipe would need to reach this BPB" (the report's DS-V4-Pro comparison). 왼쪽 점은 보고서 Figure 3(held-out code) 그림에서 눈으로 읽은 근사값이고, 검은 선은 그 점들에 맞춘 L = A·C−α + E다(L18–L42만으로 맞춰도 최종점 0.2203을 0.2202로 예측한다). 빨간 점선은 후보 변경을 적용한 ladder로, 같은 연산 C에서 baseline이 EG(C)·C를 쓴 것과 같은 loss를 낸다. "작은 규모에서만"을 눌러 보면 L18–L42 구간에서는 이득인데 최종 규모로 외삽하면 EG < 1이 된다. ladder 여러 칸에서 EG를 재는 이유다. 목표 BPB 버튼은 fit의 역함수로 "우리 레시피라면 몇 FLOPs면 이 BPB에 닿는가"를 계산한다(보고서의 DS-V4-Pro 비교 방식).

Hyperparameter laws (B2 p.5–7). The effect of the learning rate η\eta and weight decay λ\lambda is most sensitive to the product ηλ\eta\lambda, so good settings lie on a narrow diagonal band in the (log⁡η,log⁡λ)(\log\eta, \log\lambda) plane. The sweep therefore uses a (log⁡η,log⁡ηλ)(\log\eta, \log\eta\lambda) grid, fits a 2D quadratic, and takes its analytic minimum. Running model selection over the minima found at several sizes and TPPs gives the following (natural logs).

η⋆λ⋆=17.04steps,log⁡η⋆=−1.51+0.175log⁡TPP−0.573log⁡steps\eta^\star\lambda^\star = \frac{17.04}{\text{steps}}, \qquad \log\eta^\star = -1.51 + 0.175\log\text{TPP} - 0.573\log\text{steps}dropout⋆=sigmoid⁡ ⁣(0.526 (log⁡Nactive−27.2))\text{dropout}^\star = \operatorname{sigmoid}\!\big(0.526\,(\log N_{\text{active}} - 27.2)\big)

Both exponents come with an interpretation. AdamW’s decoupled weight decay multiplies the weights by (1−ηλ)(1 - \eta\lambda) every step, so the weights are roughly an exponential average of the updates of the last τ=1/(ηλ)\tau = 1/(\eta\lambda) steps. If this time scale should be a fixed fraction of the training length, then τ∝steps\tau \propto \text{steps}, i.e. ηλ∝steps−1\eta\lambda \propto \text{steps}^{-1}. The fitted exponent is almost exactly −1-1. The learning rate’s steps exponent ≈−0.5\approx -0.5 agrees with the rule of thumb “double the batch → multiply the learning rate by 2\sqrt2”, since at a fixed token count doubling the batch halves the steps. The dropout law says that larger models should be regularised more: about 0.25 at 80B active and about 0.18 at 35B.

NumPy ladder fit, EG, hyperparameter laws
import numpy as np

# Fig. 3 (held-out code) ladder points, read by eye from the figure -> approximate
C = np.array([2e21, 1e22, 2.8e22, 7e22, 1.8e23])      # L18 ... L42 training FLOPs
L = np.array([0.313, 0.283, 0.268, 0.258, 0.248])     # BPB
C_final, L_final = 6 * 80e9 * 50e12, 0.2203           # 6 N D with N=80B active, D=50T

def fit(C, L):
    """L = A C^-alpha + E : grid over E, linear regression in log space for (A, alpha)."""
    best = None
    for E in np.linspace(0.0, L.min() - 1e-4, 3000):
        b, a = np.polyfit(np.log(C), np.log(L - E), 1)
        sse = np.sum((np.exp(a + b * np.log(C)) + E - L) ** 2)
        if best is None or sse < best[0]:
            best = (sse, np.exp(a), -b, E)
    return best[1:]

A, alpha, E = fit(C, L)
f = lambda c: A * c ** -alpha + E
finv = lambda l: ((l - E) / A) ** (-1 / alpha)
print(f"ladder-only fit: A={A:.4g}, alpha={alpha:.4f}, E={E:.4f}")
print(f"final run: 6ND = {C_final:.2e} FLOPs, predicted BPB {f(C_final):.4f} vs reported {L_final}")

# EG = f^{-1}(L') / C'  (Eq. 2 of the MAI-Thinking-1 report)
def EG(L_cand, C_cand):
    return finv(L_cand) / C_cand

# a candidate that reaches the baseline's L30 loss with 20% less compute
print(f"EG of a run reaching BPB {f(2.8e22):.4f} with 0.8x the compute: {EG(f(2.8e22), 0.8 * 2.8e22):.3f}")

# Recipe comparison as in Fig. 3: compute our recipe needs to reach another model's BPB
A2, al2, E2 = fit(np.append(C, C_final), np.append(L, L_final))   # include the final point (interpolation)
finv2 = lambda l: ((l - E2) / A2) ** (-1 / al2)
for name, bpb, ratio in [("DeepSeek-V4-Pro-Base", 0.2370, 12.3), ("MAI-Base-1", 0.2401, 12.7)]:
    need = finv2(bpb)
    print(f"{name:22s} BPB {bpb}: our ladder needs {need:.2e} FLOPs -> report ratio {ratio}x implies ~{need*ratio:.1e} FLOPs")
print(f"sanity: MAI-Base-1 pre-training 6ND = 6 * 35e9 * 30e12 = {6*35e9*30e12:.1e} FLOPs")

# Hyperparameter scaling laws (MAI-Base-2 report, p.7; natural log)
def hp(steps, tpp, active):
    lr = np.exp(-1.51 + 0.175 * np.log(tpp) - 0.573 * np.log(steps))
    wd = 17.04 / steps / lr
    drop = 1 / (1 + np.exp(-0.526 * (np.log(active) - 27.2)))
    return lr, wd, drop

print("\n  steps   TPP   active  ->  LR*        WD*     LR*xWD*   dropout")
for steps, tpp, active in [(3000, 30, 0.76e9), (20000, 100, 4.0e9), (100000, 300, 35e9), (200000, 600, 80e9)]:
    lr, wd, dr = hp(steps, tpp, active)
    print(f"{steps:7d} {tpp:5d} {active/1e9:6.2f}B -> {lr:.2e}  {wd:7.3f}  {lr*wd:.2e}  {dr:.3f}")
lr1, _, _ = hp(1e4, 100, 1e9); lr2, _, _ = hp(2e4, 100, 1e9)
print(f"halving steps (doubling batch) multiplies LR* by {lr1/lr2:.3f}  (sqrt 2 = {np.sqrt(2):.3f})")
 

The law fitted to just the five points L18–L42 predicts the final point at 2.4×10²⁵ FLOPs as 0.2202 (reported value 0.2203). The points were read off the figure by eye, so the agreement to the third decimal is close to a coincidence, but it is the same picture as B2 Figure 2’s claim that the ladder holds even when extrapolating over more than two orders of magnitude. Back-calculating from the report’s 12.3× puts DeepSeek-V4-Pro-Base’s training compute at about 9×10²⁴ FLOPs, and MAI-Base-1 back-calculated from 12.7× (about 6.2×10²⁴) agrees well with its actual pre-training 6ND≈6.3×10246ND \approx 6.3\times10^{24}. The last row of the hyperparameter examples in the table assumes Base-2 scale, but the report does not give Base-2’s batch (and hence its steps), so the actual values are unknown.

2. Adaptive entropy control and the outer ratio clip

The gradient of a clipped token. Differentiating a single token’s surrogate J=min⁡(ρA^,clip⁡(ρ,ℓ,u)A^)J = \min(\rho\hat A, \operatorname{clip}(\rho, \ell, u)\hat A) with respect to θ\theta gives ∇θJ=A^ ρ ∇θlog⁡πθ(yt)\nabla_\theta J = \hat A\,\rho\,\nabla_\theta\log\pi_\theta(y_t) where the gradient flows, and 0 where the clipped branch is selected. Which branch is selected is decided by the sign of A^\hat A.

  • A^>0\hat A > 0: 0 if ρ>u\rho > u (already raised enough). ρ<ℓ\rho < \ell is not clipped.
  • A^<0\hat A < 0: 0 if ρ<ℓ\rho < \ell (already lowered enough). ρ>u\rho > u is not clipped, and the gradient A^ρ\hat A\rho grows in proportion to ρ\rho.

Leaving open the case where A^<0\hat A < 0 but ρ\rho is large (a bad token whose probability went up anyway) is PPO’s intent: it does not block movement in the correcting direction. MAI observed that in asynchronous training this branch occasionally produces catastrophic gradient-norm spikes, because with stale rollouts ρ\rho can reach tens. So it added an outer clip ρ≤rmax⁡=50\rho \le r_{\max} = 50 on every branch (T1 Eq. 9, the same idea as dual-clip PPO). Tokens far outside the range are dropped entirely, and normal trust-region behaviour is left as it is.

Why control entropy with the upper bound. Set the bounds to ℓ=1−ε\ell = 1-\varepsilon and u=(1−ε)−1+ku = (1-\varepsilon)^{-1} + k. With k=0k = 0, log⁡ℓ=−log⁡u\log\ell = -\log u, so the clip is symmetric in log-ratio space. What changes when the upper bound widens? A token with A^>0\hat A > 0 can have its probability raised by up to a factor of uu in one update. Tokens that already have high probability cannot rise much anyway, since π≤1\pi \le 1 gives ρ≤1/πold\rho \le 1/\pi_{\text{old}}, but good tokens that had low probability rise more the larger uu is. So widening the upper bound spreads probability mass toward low-probability tokens and raises the entropy, while narrowing it concentrates the mass on already-likely tokens and collapses the entropy (the same observation as DAPO’s Clip-Higher). MAI does not fix this knob but drives it with an integral controller (T1 Eq. 7–8).

H^(πθ)=1∣T∣∑(i,t)∈T−log⁡πθ(yi,t∣x,yi,<t)⋅ρi,t,k←clip⁡ ⁣(k+δ sign⁡(H⋆−H^), 0, kmax⁡)\hat H(\pi_\theta) = \frac{1}{|\mathcal{T}|}\sum_{(i,t)\in\mathcal{T}} -\log\pi_\theta(y_{i,t}\mid x, y_{i,<t})\cdot\rho_{i,t}, \qquad k \leftarrow \operatorname{clip}\!\big(k + \delta\,\operatorname{sign}(H^\star - \hat H),\, 0,\, k_{\max}\big)

H^\hat H is an importance-weighted estimator of the entropy of πθ\pi_\theta, Eπθ[−log⁡πθ]\mathbb{E}_{\pi_\theta}[-\log\pi_\theta], from samples of πold\pi_{\text{old}}. When the entropy is below the target, kk goes up and widens the upper bound; when it is above, kk goes down. The report says that adding an entropy bonus to the loss worked worse than this.

→ Go deeper: The stability playbook — entropy control and ratio clipping next to other labs’ fixes for RL instability. The frontier RL landscape places MAI’s objective in one table with the other labs’.

하이퍼파라미터 법칙(B2 p.5–7). 학습률 η\eta와 weight decay λ\lambda의 영향은 곱 ηλ\eta\lambda에 가장 민감해서, 좋은 설정은 (log⁡η,log⁡λ)(\log\eta, \log\lambda) 평면의 좁은 대각선 띠에 놓인다. 그래서 (log⁡η,log⁡ηλ)(\log\eta, \log\eta\lambda) 격자로 sweep하고, 2D 이차함수를 맞춰 해석적 최소점을 뽑는다. 여러 크기·TPP에서 얻은 최소점에 모델 선택을 하면 결과는 다음과 같다(로그는 자연로그).

η⋆λ⋆=17.04steps,log⁡η⋆=−1.51+0.175log⁡TPP−0.573log⁡steps\eta^\star\lambda^\star = \frac{17.04}{\text{steps}}, \qquad \log\eta^\star = -1.51 + 0.175\log\text{TPP} - 0.573\log\text{steps}dropout⋆=sigmoid⁡ ⁣(0.526 (log⁡Nactive−27.2))\text{dropout}^\star = \operatorname{sigmoid}\!\big(0.526\,(\log N_{\text{active}} - 27.2)\big)

두 지수에는 해석이 붙는다. AdamW의 decoupled weight decay는 매 step 가중치를 (1−ηλ)(1 - \eta\lambda)배 하므로, 가중치는 대략 최근 τ=1/(ηλ)\tau = 1/(\eta\lambda) step의 갱신을 지수 평균한 것이 된다. 이 시간 척도가 학습 길이의 고정 비율이어야 한다면 τ∝steps\tau \propto \text{steps}, 즉 ηλ∝steps−1\eta\lambda \propto \text{steps}^{-1}이다. 적합된 지수가 거의 정확히 −1-1이다. 학습률의 steps 지수 ≈−0.5\approx -0.5는 토큰 수를 고정하면 batch를 2배로 할 때 steps가 절반이 되므로 “batch 2배 → 학습률 2\sqrt2배”라는 경험칙과 맞는다. dropout 법칙은 모델이 클수록 정규화를 더 하라는 것이다. 80B active에서 약 0.25, 35B에서 약 0.18이다.

NumPy ladder fit, EG, 하이퍼파라미터 법칙
import numpy as np

# Fig. 3 (held-out code) ladder points, read by eye from the figure -> approximate
C = np.array([2e21, 1e22, 2.8e22, 7e22, 1.8e23])      # L18 ... L42 training FLOPs
L = np.array([0.313, 0.283, 0.268, 0.258, 0.248])     # BPB
C_final, L_final = 6 * 80e9 * 50e12, 0.2203           # 6 N D with N=80B active, D=50T

def fit(C, L):
    """L = A C^-alpha + E : grid over E, linear regression in log space for (A, alpha)."""
    best = None
    for E in np.linspace(0.0, L.min() - 1e-4, 3000):
        b, a = np.polyfit(np.log(C), np.log(L - E), 1)
        sse = np.sum((np.exp(a + b * np.log(C)) + E - L) ** 2)
        if best is None or sse < best[0]:
            best = (sse, np.exp(a), -b, E)
    return best[1:]

A, alpha, E = fit(C, L)
f = lambda c: A * c ** -alpha + E
finv = lambda l: ((l - E) / A) ** (-1 / alpha)
print(f"ladder-only fit: A={A:.4g}, alpha={alpha:.4f}, E={E:.4f}")
print(f"final run: 6ND = {C_final:.2e} FLOPs, predicted BPB {f(C_final):.4f} vs reported {L_final}")

# EG = f^{-1}(L') / C'  (Eq. 2 of the MAI-Thinking-1 report)
def EG(L_cand, C_cand):
    return finv(L_cand) / C_cand

# a candidate that reaches the baseline's L30 loss with 20% less compute
print(f"EG of a run reaching BPB {f(2.8e22):.4f} with 0.8x the compute: {EG(f(2.8e22), 0.8 * 2.8e22):.3f}")

# Recipe comparison as in Fig. 3: compute our recipe needs to reach another model's BPB
A2, al2, E2 = fit(np.append(C, C_final), np.append(L, L_final))   # include the final point (interpolation)
finv2 = lambda l: ((l - E2) / A2) ** (-1 / al2)
for name, bpb, ratio in [("DeepSeek-V4-Pro-Base", 0.2370, 12.3), ("MAI-Base-1", 0.2401, 12.7)]:
    need = finv2(bpb)
    print(f"{name:22s} BPB {bpb}: our ladder needs {need:.2e} FLOPs -> report ratio {ratio}x implies ~{need*ratio:.1e} FLOPs")
print(f"sanity: MAI-Base-1 pre-training 6ND = 6 * 35e9 * 30e12 = {6*35e9*30e12:.1e} FLOPs")

# Hyperparameter scaling laws (MAI-Base-2 report, p.7; natural log)
def hp(steps, tpp, active):
    lr = np.exp(-1.51 + 0.175 * np.log(tpp) - 0.573 * np.log(steps))
    wd = 17.04 / steps / lr
    drop = 1 / (1 + np.exp(-0.526 * (np.log(active) - 27.2)))
    return lr, wd, drop

print("\n  steps   TPP   active  ->  LR*        WD*     LR*xWD*   dropout")
for steps, tpp, active in [(3000, 30, 0.76e9), (20000, 100, 4.0e9), (100000, 300, 35e9), (200000, 600, 80e9)]:
    lr, wd, dr = hp(steps, tpp, active)
    print(f"{steps:7d} {tpp:5d} {active/1e9:6.2f}B -> {lr:.2e}  {wd:7.3f}  {lr*wd:.2e}  {dr:.3f}")
lr1, _, _ = hp(1e4, 100, 1e9); lr2, _, _ = hp(2e4, 100, 1e9)
print(f"halving steps (doubling batch) multiplies LR* by {lr1/lr2:.3f}  (sqrt 2 = {np.sqrt(2):.3f})")
 

L18–L42 다섯 점만으로 맞춘 법칙이 2.4×10²⁵ FLOPs의 최종점을 0.2202로 예측한다(보고서 값 0.2203). 그림에서 눈으로 읽은 점이라 소수 셋째 자리의 일치는 우연에 가깝지만, ladder가 두 자릿수 넘게 외삽해도 맞는다는 B2 Figure 2의 주장과 같은 그림이다. 보고서의 12.3배를 역산하면 DeepSeek-V4-Pro-Base의 학습 연산은 약 9×10²⁴ FLOPs가 되고, 12.7배로 역산한 MAI-Base-1(약 6.2×10²⁴)은 실제 사전학습 6ND≈6.3×10246ND \approx 6.3\times10^{24}과 잘 맞는다. 표의 하이퍼파라미터 예시 중 마지막 줄은 Base-2 규모를 가정한 것인데, 보고서는 Base-2의 batch(따라서 steps)를 밝히지 않아 실제 값은 알 수 없다.

2. Adaptive entropy control과 outer ratio clip

clip 한 토큰의 gradient. 토큰 하나의 surrogate J=min⁡(ρA^,clip⁡(ρ,ℓ,u)A^)J = \min(\rho\hat A, \operatorname{clip}(\rho, \ell, u)\hat A)를 θ\theta로 미분하면, 기울기가 흐르는 곳에서 ∇θJ=A^ ρ ∇θlog⁡πθ(yt)\nabla_\theta J = \hat A\,\rho\,\nabla_\theta\log\pi_\theta(y_t), clip된 가지가 선택된 곳에서는 0이다. 어느 쪽이 선택되는지는 A^\hat A의 부호가 정한다.

  • A^>0\hat A > 0: ρ>u\rho > u이면 0(이미 충분히 올렸다). ρ<ℓ\rho < \ell은 clip되지 않는다.
  • A^<0\hat A < 0: ρ<ℓ\rho < \ell이면 0(이미 충분히 내렸다). ρ>u\rho > u는 clip되지 않고, 기울기 A^ρ\hat A\rho가 ρ\rho에 비례해 커진다.

A^<0\hat A < 0인데 ρ\rho가 큰 경우(나쁜 토큰의 확률이 오히려 오른 경우)를 열어 둔 것은 PPO의 의도다. 바로잡는 방향의 움직임은 막지 않겠다는 것이다. MAI는 비동기 학습에서 이 가지가 가끔 파국적인 gradient norm spike를 만든다는 것을 봤다. 낡은 rollout에서는 ρ\rho가 수십 배가 될 수 있기 때문이다. 그래서 모든 가지에 ρ≤rmax⁡=50\rho \le r_{\max} = 50을 거는 바깥 clip을 추가했다(T1 식 9, dual-clip PPO와 같은 발상). 범위를 크게 벗어난 토큰은 통째로 버리고, 정상 범위의 trust-region 동작은 그대로 둔다.

상한으로 entropy를 조절하는 이유. 하한·상한을 ℓ=1−ε\ell = 1-\varepsilon, u=(1−ε)−1+ku = (1-\varepsilon)^{-1} + k로 둔다. k=0k = 0이면 log⁡ℓ=−log⁡u\log\ell = -\log u라서 log-ratio 공간에서 대칭이다. 상한을 넓히면 무엇이 달라질까. A^>0\hat A > 0인 토큰은 한 번의 갱신에서 확률이 최대 uu배까지 오를 수 있다. 이미 확률이 큰 토큰은 π≤1\pi \le 1이라 ρ≤1/πold\rho \le 1/\pi_{\text{old}}로 어차피 많이 못 오르지만, 확률이 낮던 좋은 토큰은 uu가 클수록 크게 오른다. 그래서 상한을 넓히면 확률 질량이 낮은 확률 토큰 쪽으로 퍼져 entropy가 오르고, 좁히면 이미 높은 토큰에 질량이 몰려 entropy가 무너진다(DAPO의 Clip-Higher와 같은 관찰). MAI는 이 손잡이를 고정하지 않고 적분 제어기로 돌린다(T1 식 7–8).

H^(πθ)=1∣T∣∑(i,t)∈T−log⁡πθ(yi,t∣x,yi,<t)⋅ρi,t,k←clip⁡ ⁣(k+δ sign⁡(H⋆−H^), 0, kmax⁡)\hat H(\pi_\theta) = \frac{1}{|\mathcal{T}|}\sum_{(i,t)\in\mathcal{T}} -\log\pi_\theta(y_{i,t}\mid x, y_{i,<t})\cdot\rho_{i,t}, \qquad k \leftarrow \operatorname{clip}\!\big(k + \delta\,\operatorname{sign}(H^\star - \hat H),\, 0,\, k_{\max}\big)

H^\hat H는 πold\pi_{\text{old}}의 샘플로 πθ\pi_\theta의 entropy Eπθ[−log⁡πθ]\mathbb{E}_{\pi_\theta}[-\log\pi_\theta]를 추정하는 importance-weighted 추정량이다. entropy가 목표보다 낮으면 kk를 올려 상한을 넓히고, 높으면 내린다. 보고서는 손실에 entropy bonus를 더하는 방식이 이 방식보다 못했다고 쓴다.

→ 더 깊이: 안정화 플레이북 — entropy 제어와 ratio clip을 다른 lab의 RL 불안정 처방과 함께 본다. 프론티어 RL 목적함수 지도는 MAI의 목적함수를 다른 lab들과 한 표에 놓는다.

하한lower 1−ε – 상한upper (1−ε)⁻¹+k – log 대칭?symmetric in log? –
The x-axis is the ratio ρ = πθ/πold (log scale), the y-axis the surrogate of a single token. The gradient flows on the solid segments and is 0 on the grey segments. Left ( > 0): past the upper bound, raising the token further gains nothing. Increase k and only the upper bound moves right, so good tokens that had low probability can rise further. That is the knob that keeps entropy up. Right ( < 0): standard PPO/GRPO does not clip the side where ρ grows (a bad token whose probability went up anyway), so the gradient ·ρ can grow without bound. rmax cuts that branch (the report uses 50). x축은 ratio ρ = πθ/πold(log 눈금), y축은 토큰 하나의 surrogate. 실선 구간에서는 gradient가 흐르고 회색 구간에서는 0이다. 왼쪽( > 0): 상한을 넘으면 더 올려도 이득이 없다. k를 키우면 상한만 오른쪽으로 밀려 확률이 낮던 좋은 토큰이 더 크게 올라갈 수 있다. 이것이 entropy를 유지하는 손잡이다. 오른쪽( < 0): 표준 PPO/GRPO는 ρ가 커지는 쪽(나쁜 토큰의 확률이 오히려 오른 경우)을 clip하지 않아 기울기 ·ρ가 끝없이 커질 수 있다. rmax가 그 가지를 끊는다(보고서 값 50).

Below, the same objective is applied as is to a toy bandit with 32 actions. One good action (correct with probability 0.9) is almost never sampled at first. Because update sizes in the toy differ from those in a real LLM, the default is ε=0.2\varepsilon = 0.2 (the report uses 0.6).

아래는 같은 목적함수를 32개 행동의 장난감 bandit에 그대로 적용한 것이다. 좋은 행동 하나(정답 확률 0.9)가 처음에는 거의 뽑히지 않는다. 장난감의 갱신 크기가 실제 LLM과 달라서 ε=0.2\varepsilon = 0.2를 기본값으로 두었다(보고서는 0.6).

마지막 100 step 평균 Hmean H over last 100 steps: k=0 – controller – 최종final E[r]: k=0 – controller –
Toy problem: 32 actions (tokens), each correct with probability 0.1–0.5 except one at 0.9, which is almost never sampled at first. Group G=16, 4 inner updates per step, group-normalised advantage. Grey is the symmetric clip with k fixed at 0, red the controller of Eq. (8). The small line at the bottom left is k. With the fixed clip, entropy quickly collapses to 0 and the policy gets stuck on a mediocre action. When entropy falls below H*, the controller widens the upper bound and leaves room for good low-probability actions to rise. The seed shown first is one where that let it find the 0.9 action. Press "Another seed" and most runs only keep their entropy without finding a better action. Keeping exploration alive and finding a better solution are different problems. Change H* and kmax and you also see that while k is pinned at its cap, the entropy cannot follow the target. 장난감 문제: 행동(토큰) 32개, 각 행동의 정답 확률은 0.1–0.5이고 하나만 0.9인데 처음엔 거의 뽑히지 않는다. 그룹 G=16, step마다 inner update 4번, 그룹 정규화 advantage. 회색은 k=0으로 고정한 대칭 clip, 빨강은 식 (8)의 controller다. 왼쪽 아래 작은 선은 k. 고정 clip에서는 entropy가 빠르게 0으로 무너지고 평범한 행동에 갇힌다. controller는 entropy가 H*보다 낮으면 상한을 넓혀 낮은 확률의 좋은 행동이 올라올 여지를 남긴다. 처음 보이는 seed는 그 덕에 0.9짜리 행동을 찾아낸 경우다. 다른 seed를 눌러 보면 대부분은 entropy만 유지되고 더 좋은 행동은 찾지 못한다. 탐색을 유지하는 것과 더 좋은 해를 찾는 것은 다른 문제다. H*와 kmax를 바꿔 보면 k가 상한에 붙어 있는 동안에는 목표를 따라가지 못하는 것도 보인다.
NumPy Toy climb: GRPO + adaptive entropy control + outer clip
import numpy as np

V, G, INNER, LR, STEPS = 32, 16, 4, 2.0, 300

def softmax(t):
    e = np.exp(t - t.max())
    return e / e.sum()

def mai_token_weights(rho, A, eps, k, r_max):
    """d/d rho of min(rho*A, clip(rho, 1-eps, 1/(1-eps)+k)*A) with the outer clip (Eq. 5, 8, 9).
    Returns the multiplier on grad log pi (= A*rho where the gradient flows, else 0) and the flow mask."""
    lo, hi = 1 - eps, 1 / (1 - eps) + k
    clipped = np.clip(rho, lo, hi) * A
    flows = ((rho >= lo) & (rho <= hi)) | (rho * A <= clipped)
    flows &= rho <= r_max
    return np.where(flows, A * rho, 0.0), flows

def climb(controller, seed, eps=0.2, H_target=0.6, k_max=2.5, delta=0.25, r_max=50.0):
    rng = np.random.default_rng(seed)
    p = rng.uniform(0.1, 0.5, V); p[3] = 0.9          # arm 3 is best ...
    th = rng.normal(0, 1, V); th[3] -= 2.5            # ... but rarely sampled at first
    k, H, R, clipfrac = 0.0, [], [], []
    for step in range(STEPS):
        old = softmax(th)
        a = rng.choice(V, size=G, p=old).astype(np.intp)
        r = (rng.random(G) < p[a]).astype(float)
        A = np.zeros(G) if r.std() < 1e-8 else (r - r.mean()) / r.std()
        for _ in range(INNER):
            pi = softmax(th)
            rho = pi[a] / old[a]
            w, flows = mai_token_weights(rho, A, eps, k if controller else 0.0, r_max)
            grad = np.bincount(a, weights=w, minlength=V) / G - (w.sum() / G) * pi
            th += LR * grad
        pi = softmax(th)
        rho = pi[a] / old[a]
        H_hat = np.mean(-np.log(pi[a]) * rho)                    # Eq. 7: importance-weighted entropy
        if controller:
            k = float(np.clip(k + delta * np.sign(H_target - H_hat), 0.0, k_max))   # Eq. 8
        H.append(-(pi * np.log(pi)).sum()); R.append(pi @ p); clipfrac.append(1 - flows.mean())
    return np.array(H), np.array(R), k, np.mean(clipfrac)

print("seed | fixed k=0: H(last100)  E[r]  clip% | controller: H(last100)  E[r]  k_final")
found = [0, 0]
for seed in range(5):
    H0, R0, _, c0 = climb(False, seed)
    H1, R1, kf, _ = climb(True, seed)
    found[0] += R0[-1] > 0.8; found[1] += R1[-1] > 0.8
    print(f"{seed:4d} |   {H0[-100:].mean():5.2f}        {R0[-1]:.3f}  {100*c0:4.1f} |"
          f"   {H1[-100:].mean():5.2f}        {R1[-1]:.3f}   {kf:.2f}")
print(f"runs that found the 0.9 arm: fixed {found[0]}/5, controller {found[1]}/5")

# Reward shaping (Eq. 10-12) with the report's coefficients
def reward(task, n_non_english, length, pass_rate, l_max, w_lang=0.5, alpha=0.005, w_len=0.25):
    R_lang = max(1 - alpha * n_non_english, 0)
    R_len = pass_rate * length / l_max
    return task + w_lang * R_lang - w_len * R_len

print("\nsame correct 30k-token answer, l_max = 64k:")
for rate in [0.1, 0.5, 0.9]:
    print(f"  pass rate {rate:.1f}: R = {reward(1.0, 0, 30_000, rate, 64_000):.3f}")
print(f"  with 100 non-English words in the CoT (pass 0.5): R = {reward(1.0, 100, 30_000, 0.5, 64_000):.3f}")
 

With the fixed clip, entropy collapses below 0.1 for all five seeds and the policy gets stuck on mediocre actions (expected reward 0.37–0.49). The controller holds the entropy near the target, and meanwhile some seeds find the 0.9 action. Once it is found, the entropy drops again because the policy has converged to that single action, and kk is then pinned at its cap kmax⁡k_{\max}. The controller is not a cure-all: in this toy, “keeping exploration alive” does not always lead to “a better solution”, and depending on δ\delta and kmax⁡k_{\max} it can oscillate. What the report shows for the real climb (T1 Figure 13) is the entropy staying near H⋆=0.3H^\star = 0.3 for 800 steps while kk rises and falls to match.

PyTorch PyTorch: MAI RL loss (token-level GRPO + adaptive upper clip + outer clip) 로컬에서 실행run locally (pip install torch)
import torch

def mai_rl_loss(logp_new, logp_old, adv, mask, eps=0.6, k=0.0, r_max=50.0):
    """logp_*: [B, T] token log-probs (rollout tokens), adv: [B] group-normalized advantages,
    mask: [B, T] 1 for response tokens (top-p-excluded logits must already be -inf in logp_new).
    Normalizes by the number of tokens in the (global) batch, as in Eq. 5."""
    ratio = torch.exp(logp_new - logp_old)                      # rho_{i,t}
    A = adv[:, None].expand_as(ratio)
    lo, hi = 1.0 - eps, 1.0 / (1.0 - eps) + k
    surr = torch.minimum(ratio * A, ratio.clamp(lo, hi) * A)
    keep = (ratio <= r_max).float() * mask                      # outer ratio clip: drop extreme tokens
    loss = -(surr * keep).sum() / mask.sum().clamp_min(1.0)
    with torch.no_grad():                                       # Eq. 7: importance-weighted entropy estimate
        H_hat = ((-logp_new) * ratio * mask).sum() / mask.sum().clamp_min(1.0)
    return loss, H_hat

def update_k(k, H_hat, H_target=0.3, delta=0.25, k_max=2.5):  # Eq. 8: integral controller
    return float(min(max(k + delta * torch.sign(torch.as_tensor(H_target - H_hat)).item(), 0.0), k_max))
 

In practice, mask.sum() has to be all-reduced over all data-parallel ranks so that the loss is divided by the number of tokens in the global batch, as in Eq. 5. Top-p mask replay means overwriting the logits that were outside the nucleus at rollout time with −∞-\infty before computing logp_new.

Results

NumPy 장난감 climb: GRPO + adaptive entropy control + outer clip
import numpy as np

V, G, INNER, LR, STEPS = 32, 16, 4, 2.0, 300

def softmax(t):
    e = np.exp(t - t.max())
    return e / e.sum()

def mai_token_weights(rho, A, eps, k, r_max):
    """d/d rho of min(rho*A, clip(rho, 1-eps, 1/(1-eps)+k)*A) with the outer clip (Eq. 5, 8, 9).
    Returns the multiplier on grad log pi (= A*rho where the gradient flows, else 0) and the flow mask."""
    lo, hi = 1 - eps, 1 / (1 - eps) + k
    clipped = np.clip(rho, lo, hi) * A
    flows = ((rho >= lo) & (rho <= hi)) | (rho * A <= clipped)
    flows &= rho <= r_max
    return np.where(flows, A * rho, 0.0), flows

def climb(controller, seed, eps=0.2, H_target=0.6, k_max=2.5, delta=0.25, r_max=50.0):
    rng = np.random.default_rng(seed)
    p = rng.uniform(0.1, 0.5, V); p[3] = 0.9          # arm 3 is best ...
    th = rng.normal(0, 1, V); th[3] -= 2.5            # ... but rarely sampled at first
    k, H, R, clipfrac = 0.0, [], [], []
    for step in range(STEPS):
        old = softmax(th)
        a = rng.choice(V, size=G, p=old).astype(np.intp)
        r = (rng.random(G) < p[a]).astype(float)
        A = np.zeros(G) if r.std() < 1e-8 else (r - r.mean()) / r.std()
        for _ in range(INNER):
            pi = softmax(th)
            rho = pi[a] / old[a]
            w, flows = mai_token_weights(rho, A, eps, k if controller else 0.0, r_max)
            grad = np.bincount(a, weights=w, minlength=V) / G - (w.sum() / G) * pi
            th += LR * grad
        pi = softmax(th)
        rho = pi[a] / old[a]
        H_hat = np.mean(-np.log(pi[a]) * rho)                    # Eq. 7: importance-weighted entropy
        if controller:
            k = float(np.clip(k + delta * np.sign(H_target - H_hat), 0.0, k_max))   # Eq. 8
        H.append(-(pi * np.log(pi)).sum()); R.append(pi @ p); clipfrac.append(1 - flows.mean())
    return np.array(H), np.array(R), k, np.mean(clipfrac)

print("seed | fixed k=0: H(last100)  E[r]  clip% | controller: H(last100)  E[r]  k_final")
found = [0, 0]
for seed in range(5):
    H0, R0, _, c0 = climb(False, seed)
    H1, R1, kf, _ = climb(True, seed)
    found[0] += R0[-1] > 0.8; found[1] += R1[-1] > 0.8
    print(f"{seed:4d} |   {H0[-100:].mean():5.2f}        {R0[-1]:.3f}  {100*c0:4.1f} |"
          f"   {H1[-100:].mean():5.2f}        {R1[-1]:.3f}   {kf:.2f}")
print(f"runs that found the 0.9 arm: fixed {found[0]}/5, controller {found[1]}/5")

# Reward shaping (Eq. 10-12) with the report's coefficients
def reward(task, n_non_english, length, pass_rate, l_max, w_lang=0.5, alpha=0.005, w_len=0.25):
    R_lang = max(1 - alpha * n_non_english, 0)
    R_len = pass_rate * length / l_max
    return task + w_lang * R_lang - w_len * R_len

print("\nsame correct 30k-token answer, l_max = 64k:")
for rate in [0.1, 0.5, 0.9]:
    print(f"  pass rate {rate:.1f}: R = {reward(1.0, 0, 30_000, rate, 64_000):.3f}")
print(f"  with 100 non-English words in the CoT (pass 0.5): R = {reward(1.0, 100, 30_000, 0.5, 64_000):.3f}")
 

고정 clip에서는 다섯 seed 모두 entropy가 0.1 아래로 무너지고 평범한 행동(기대 보상 0.37–0.49)에 갇힌다. controller는 entropy를 목표 근처에 붙잡아 두고, 그 사이 일부 seed는 0.9짜리 행동을 찾아낸다. 찾은 뒤에는 entropy가 다시 낮아지는데, 그 행동 하나로 수렴했기 때문이고 이때 kk는 상한 kmax⁡k_{\max}에 붙어 있다. 제어기가 만능은 아니다. 이 장난감에서 “탐색 유지”가 늘 “더 좋은 해”로 이어지지는 않으며, δ\delta와 kmax⁡k_{\max}에 따라 진동도 생긴다. 실제 climb에서 보고서가 보인 것(T1 Figure 13)은 800 step 동안 entropy가 H⋆=0.3H^\star = 0.3 근처에 머물고 kk가 그에 맞춰 오르내리는 모습이다.

PyTorch PyTorch: MAI RL 손실 (token-level GRPO + adaptive upper clip + outer clip) 로컬에서 실행run locally (pip install torch)
import torch

def mai_rl_loss(logp_new, logp_old, adv, mask, eps=0.6, k=0.0, r_max=50.0):
    """logp_*: [B, T] token log-probs (rollout tokens), adv: [B] group-normalized advantages,
    mask: [B, T] 1 for response tokens (top-p-excluded logits must already be -inf in logp_new).
    Normalizes by the number of tokens in the (global) batch, as in Eq. 5."""
    ratio = torch.exp(logp_new - logp_old)                      # rho_{i,t}
    A = adv[:, None].expand_as(ratio)
    lo, hi = 1.0 - eps, 1.0 / (1.0 - eps) + k
    surr = torch.minimum(ratio * A, ratio.clamp(lo, hi) * A)
    keep = (ratio <= r_max).float() * mask                      # outer ratio clip: drop extreme tokens
    loss = -(surr * keep).sum() / mask.sum().clamp_min(1.0)
    with torch.no_grad():                                       # Eq. 7: importance-weighted entropy estimate
        H_hat = ((-logp_new) * ratio * mask).sum() / mask.sum().clamp_min(1.0)
    return loss, H_hat

def update_k(k, H_hat, H_target=0.3, delta=0.25, k_max=2.5):  # Eq. 8: integral controller
    return float(min(max(k + delta * torch.sign(torch.as_tensor(H_target - H_hat)).item(), 0.0), k_max))
 

실제로는 mask.sum()을 data-parallel rank 전체에서 all-reduce해 global batch 토큰 수로 나눠야 식 5와 같아진다. top-p mask replay는 logp_new를 계산하기 전에 rollout 때 nucleus 밖이었던 logit을 −∞-\infty로 덮는 것이다.

실험 결과

All numbers are as reported. In the BPB table, * marks models whose base is not public and which were measured from post-trained checkpoints. The other models' numbers in Table 11 were copied by MAI from each model card ("—" means not reported, so there is no bar), while the Sonnet 4.6 numbers in Table 12 were measured by MAI with its own evaluation suite. Switch items and you see that MAI-Thinking-1 is among the leaders in maths (AIME 2025) but falls far behind in agent environments it was not trained on, such as Terminal-Bench 2.0. 숫자는 모두 보고서 그대로다. BPB 표에서 *는 base가 공개되지 않아 post-trained 체크포인트로 잰 모델이다. Table 11의 다른 모델 숫자는 MAI가 각 모델 카드에서 옮겨 온 것이고("—"는 미보고라 막대가 없다), Table 12의 Sonnet 4.6 숫자는 MAI가 자체 평가 suite로 직접 잰 것이다. 항목을 바꿔 보면 MAI-Thinking-1이 수학(AIME 2025)에서는 선두권이지만 Terminal-Bench 2.0처럼 학습하지 않은 agent 환경에서는 크게 뒤처진다는 점이 보인다.

MAI-Base-2 pre-training (B2 Figure 1). Instead of public benchmarks, the report uses four held-out BPBs (MAI codebase, vendor-commissioned QA·STEM·maths), and MAI-Base-2 is the lowest among models of 1T parameters or more. The gap is largest on code (0.2203 vs Kimi-K3 0.2264 and DeepSeek-V4-Pro-Base 0.2370). On maths it is nearly tied with Kimi-K3 (0.3589) at 0.3561.

MAI-Thinking-1 post-training (T1 Table 11, 12). AIME 2025 97.0, AIME 2026 94.5, LCB v6 87.7, SWE-Bench Pro 52.8 (similar to Opus 4.6’s 53.4), SWE-bench Verified 73.5. Terminal-Bench 2.0, by contrast, is 46.0, far below most other models in the table (59–75). The report explains that SWE training used only bash and the string-replacement tool and did not train separately on terminal-interaction environments. In the head-to-head with Sonnet 4.6 (Table 12), it leads on IFBench (69 vs 50) and CyberSec Auto (63 vs 56) and trails on GraphWalks (90 vs 96), MedXpertQA (43 vs 49) and Multi-Challenge (53 vs 57).

The ablations that justify the methods are as follows.

ChangeMetricResultSource
MoE in every layer 8/384 (vs alternating 8/512 + dense)weighted-average EGFLOPs / EGtime0.94 / 0.73T1 Table 2
MoE in every layer 7+1 shared/384same1.03 / 0.82T1 Table 2
number of experts 256 → 1024 (top-8)EGincreases consistently across categoriesT1 Figure 3
improved MoE implementation (Base-2)MoE-layer MFU24% → 35%B2 p.8
activation gradient clippingheld-out EGFLOPsgrows with scale, +28% at L42B2 Figure 8
Muon resharding optimisationshare of iteration time2.1% (165 ms, theoretical 55 ms)B2 p.10
MAI recipe vs DS-V4-Pro-BaseFLOPs to reach the same BPBcode 12.3×, QA 4.2×, STEM 8.3×, Math 6.6×B2 Figure 3
MAI-Base-2 recipe vs MAI-Base-1samecode 12.7×, QA 6.3×, STEM 8.3×, Math 7.5×B2 Figure 3
rank invariance checkSTEM NLL at 23B, about 20Tmixture ranking flips midway through trainingT1 Figure 6
entropy bonus loss vs adaptive controlqualitativethe bonus was worse (no numbers)T1 §3.1.1
number of self-distillation tracesrecovering teacher performanceO(1M) is enough; more hurts the subsequent RLT1 §3.1.4

Reading critically

  • The BPB comparison cannot be reproduced. The eval sets are MAI’s internal code and vendor-commissioned data and are not public. Three of the compared models (Kimi-K3, Qwen3.8, MiMo-V2.6-Pro-RL) have no public base, so they were measured from post-trained checkpoints, and the report states this caveat. How much, and in which direction, post-training changes BPB is unknown.
  • The assumptions behind “4.2–12.3× efficiency”. These numbers depend on the inverse of the law fitted to MAI’s ladder and on the other model’s training FLOPs. The report does not give the FLOPs value for DeepSeek-V4-Pro-Base in the text. Also, “recipe efficiency” mixes data, architecture and hyperparameters, and it is not broken down which of them produced how much. The report credits data quality and modelling choices.
  • Base-2 is still only a base model. There are no downstream benchmarks, context length, head dimension, local window size, or Base-2 batch and step counts. This lesson’s KV calculation is an assumption that borrows Base-1 values.
  • The scope of “no distillation”. It means that no outputs of other models were put into the pre-training text. LLMs are used heavily in data processing (keep/remove decisions during extraction, STEM problem conversion and grading, SWE environment building and problem rewriting, AI judges, Qwen3-Embedding-based semantic dedup). Which models were used is mostly not disclosed. The RL stage also includes synthetic SWE problems.
  • Different settings in the comparison tables. The other models’ numbers in Table 11 come from each model card, so scaffolds, number of attempts and length limits differ. MAI uses temperature 1, top-p 0.97 and an average of 4 runs, with 256K context for agentic tasks, and measured Terminal-Bench 2.0 ignoring timeouts. Sonnet 4.6 in Table 12 was evaluated by MAI itself.
  • Portability of the RL hyperparameters. ε=0.6\varepsilon = 0.6 (lower bound 0.4, upper bound 2.5 or more) is much wider than the usual 0.2. This reads as a consequence of the asynchronous setup, which uses rollouts up to 40 gradient steps stale, so large ratio deviations are normal. Moved as is to synchronous RL, it means something different. H⋆=0.3H^\star = 0.3 is likewise a value for their tokenizer and model.
  • What is released. Weights, code and data are not released. In exchange, the value of the report is that it documents failure cases (rank non-invariance, collapse and recovery, types of reward hacking) and hyperparameters in unusual detail.
확인 문제Check yourself

MAI's clip interval is [1−ε, 1/(1−ε)+k], and a token with negative advantage  has ratio 3.0 (ε=0.6, k=0, r_max=50). What is this token's gradient?

With A^<0\hat A < 0, in min⁡(ρA^,clip⁡(ρ)A^)\min(\rho\hat A, \operatorname{clip}(\rho)\hat A) with ρ=3.0>u=2.5\rho = 3.0 > u = 2.5, ρA^=3A^\rho\hat A = 3\hat A is smaller (more negative) than 2.5A^2.5\hat A, so the unclipped branch is selected. The gradient flows as A^ρ∇log⁡π\hat A\rho\nabla\log\pi and grows as ρ\rho grows. This branch produces gradient spikes in asynchronous RL, which is why MAI added the outer clip with rmax⁡=50r_{\max} = 50. ρ=3\rho = 3 is still inside rmax⁡r_{\max}, so the token survives. What the upper bound uu blocks is the A^>0\hat A > 0 side.

Summary

  • MAI makes pre-training decisions with a scaling ladder fixed by a single LL and with EG =f−1(L′)/C′= f^{-1}(L')/C'. When the FLOPs EG and the time EG disagree, it fixes the infrastructure (MoE in every layer, MoE MFU 24% → 35%).
  • MAI-Base-2 (80B/2.8T, 50T tokens) was trained with source scaling (matching repeat counts even in small runs), hyperparameter laws such as η⋆λ⋆=17.04/steps\eta^\star\lambda^\star = 17.04/\text{steps}, Muon, MXFP8, and activation gradient clipping, whose gain grows with scale.
  • The architecture is LatentMoE on top of Gemma 3-style local 5 : global 1 attention. Base-2 cut the global KV heads to 2, easing the problem of the global layers monopolising long-context KV, and fixed memory with multi-round dropless MoE.
  • MAI-Thinking-1’s RL is KL-free token-level GRPO plus adaptive entropy control (adjusting the clip upper bound with kk) and an outer ratio clip (ρ≤50\rho \le 50). The reward is task + language consistency − a length penalty proportional to the pass rate.
  • Self-distillation (O(1M) traces, several late checkpoints, prompt diversity) is the tool for restarting and transferring long climbs, and the three specialists are merged with SFT and finished with a light RL.
  • The numbers (BPB, efficiency multiples, benchmarks) rest on private eval sets and differing evaluation settings, so the best use of these reports is to take away the methodology and the failure cases.

MAI-Base-2 사전학습(B2 Figure 1). 공개 평가 대신 held-out BPB 네 개(MAI 코드베이스, 업체 의뢰 QA·STEM·수학)에서 1T 이상 모델 가운데 가장 낮다. 차이가 가장 큰 곳은 코드다(0.2203 대 Kimi-K3 0.2264, DeepSeek-V4-Pro-Base 0.2370). 수학에서는 Kimi-K3(0.3589)와 거의 붙어 있다(0.3561).

MAI-Thinking-1 사후학습(T1 Table 11, 12). AIME 2025 97.0, AIME 2026 94.5, LCB v6 87.7, SWE-Bench Pro 52.8(Opus 4.6 53.4와 비슷), SWE-bench Verified 73.5다. 반면 Terminal-Bench 2.0은 46.0으로 표의 다른 모델 대부분(59–75)보다 크게 낮다. 보고서는 SWE 학습이 bash와 문자열 치환 도구만 썼고 터미널 상호작용 환경을 따로 학습하지 않았다고 설명한다. Sonnet 4.6과의 직접 비교(Table 12)에서는 IFBench(69 대 50)와 CyberSec Auto(63 대 56)에서 앞서고, GraphWalks(90 대 96)·MedXpertQA(43 대 49)·Multi-Challenge(53 대 57)에서 뒤진다.

방법을 정당화하는 ablation은 다음과 같다.

변경지표결과출처
모든 층 MoE 8/384 (vs 교대 8/512 + dense)가중 평균 EGFLOPs / EGtime0.94 / 0.73T1 Table 2
모든 층 MoE 7+1 shared/384같음1.03 / 0.82T1 Table 2
expert 수 256 → 1024 (top-8)EG범주 전반에서 일관되게 증가T1 Figure 3
MoE 구현 개선(Base-2)MoE 층 MFU24% → 35%B2 p.8
activation gradient clippingheld-out EGFLOPs규모와 함께 증가, L42에서 +28%B2 Figure 8
Muon 재샤딩 최적화iteration 대비 시간2.1% (165 ms, 이론 55 ms)B2 p.10
MAI 레시피 vs DS-V4-Pro-Base같은 BPB에 드는 FLOPscode 12.3×, QA 4.2×, STEM 8.3×, Math 6.6×B2 Figure 3
MAI-Base-2 레시피 vs MAI-Base-1같음code 12.7×, QA 6.3×, STEM 8.3×, Math 7.5×B2 Figure 3
rank invariance 검증23B, 약 20T에서 STEM NLL학습 중간에 혼합 순위가 뒤집힘T1 Figure 6
entropy bonus 손실 vs adaptive control정성bonus가 더 나빴다(수치 없음)T1 §3.1.1
self-distillation trace 수teacher 성능 회복O(1M)이면 충분, 더 많으면 이후 RL에 해로움T1 §3.1.4

비판적으로 읽기

  • BPB 비교의 재현 불가능성. 평가셋은 MAI 내부 코드와 업체 의뢰 데이터라 공개되지 않는다. 비교 대상 세 개(Kimi-K3, Qwen3.8, MiMo-V2.6-Pro-RL)는 base가 공개되지 않아 post-trained 체크포인트로 쟀고, 보고서도 이 단서를 단다. post-training이 BPB를 어느 방향으로 얼마나 바꾸는지는 알 수 없다.
  • “4.2–12.3배 효율”의 가정. 이 숫자는 MAI ladder에 맞춘 법칙의 역함수와 상대 모델의 학습 FLOPs에 달려 있다. 보고서는 DeepSeek-V4-Pro-Base의 FLOPs 값을 본문에 적지 않는다. 또한 “레시피 효율”에는 데이터·구조·하이퍼파라미터가 모두 섞여 있어, 무엇이 몇 배를 냈는지는 분해되지 않는다. 보고서는 데이터 품질과 모델링 선택에 공을 돌린다.
  • Base-2는 아직 base뿐이다. 다운스트림 벤치마크, context 길이, head 차원, local window 크기, Base-2의 batch·step 수는 없다. 이 레슨의 KV 계산은 Base-1 값을 빌린 가정이다.
  • “distillation 없음”의 범위. 사전학습 텍스트에 다른 모델의 출력을 넣지 않았다는 뜻이다. 데이터 처리에는 LLM이 많이 쓰인다(추출 시 keep/remove 판단, STEM 문제 변환·채점, SWE 환경 빌드·문제 재작성, AI judge, Qwen3-Embedding 기반 의미 dedup). 어떤 모델이 쓰였는지는 대부분 밝히지 않는다. RL 단계에는 합성 SWE 문제도 있다.
  • 비교 표의 설정 차이. Table 11의 다른 모델 숫자는 각 모델 카드에서 가져왔으므로 scaffold·시도 횟수·길이 한도가 다르다. MAI는 temperature 1, top-p 0.97, 4회 평균, agentic은 256K context이고, Terminal-Bench 2.0은 timeout을 무시하고 쟀다. Table 12의 Sonnet 4.6은 MAI가 직접 평가했다.
  • RL 하이퍼파라미터의 이식성. ε=0.6\varepsilon = 0.6(하한 0.4, 상한 2.5 이상)은 흔한 0.2보다 훨씬 넓다. 최대 40 gradient step 낡은 rollout을 쓰는 비동기 설정이라 ratio가 크게 벗어나는 것이 정상이기 때문으로 읽힌다. 동기식 RL에 그대로 옮기면 의미가 다르다. H⋆=0.3H^\star = 0.3 역시 그들의 tokenizer·모델에서의 값이다.
  • 공개 범위. 가중치·코드·데이터는 공개되지 않는다. 대신 실패 사례(rank non-invariance, 붕괴와 복구, reward hacking 유형)와 하이퍼파라미터를 드물게 자세히 적었다는 점이 이 보고서의 가치다.
확인 문제Check yourself

MAI의 clip 구간이 [1−ε, 1/(1−ε)+k]이고 advantage Â가 음수인 토큰의 ratio가 3.0이다(ε=0.6, k=0, r_max=50). 이 토큰의 gradient는?

A^<0\hat A < 0일 때 min⁡(ρA^,clip⁡(ρ)A^)\min(\rho\hat A, \operatorname{clip}(\rho)\hat A)에서 ρ=3.0>u=2.5\rho = 3.0 > u = 2.5이면 ρA^=3A^\rho\hat A = 3\hat A가 2.5A^2.5\hat A보다 작으므로(더 음수) clip되지 않은 가지가 선택된다. gradient는 A^ρ∇log⁡π\hat A\rho\nabla\log\pi로 흐르고 ρ\rho가 커질수록 커진다. 이 가지가 비동기 RL에서 gradient spike를 만들어, MAI가 rmax⁡=50r_{\max} = 50인 바깥 clip을 추가했다. ρ=3\rho = 3은 아직 rmax⁡r_{\max} 안이라 살아 있다. 상한 uu가 막는 것은 A^>0\hat A > 0 쪽이다.

정리

  • MAI의 사전학습 결정은 LL 하나로 정해지는 scaling ladder와 EG =f−1(L′)/C′= f^{-1}(L')/C'로 내린다. FLOPs EG와 시간 EG가 어긋나면 인프라를 고친다(모든 층 MoE, MoE MFU 24% → 35%).
  • MAI-Base-2(80B/2.8T, 50T 토큰)는 source scaling(작은 run에서도 반복 횟수를 맞춤), η⋆λ⋆=17.04/steps\eta^\star\lambda^\star = 17.04/\text{steps} 같은 하이퍼파라미터 법칙, Muon, MXFP8, 규모와 함께 이득이 커지는 activation gradient clipping으로 학습됐다.
  • 구조는 Gemma 3식 local 5 : global 1 attention 위의 LatentMoE다. Base-2는 global KV head를 2로 줄여 긴 context KV를 global 층이 독점하는 문제를 줄였고, multi-round dropless MoE로 메모리를 고정했다.
  • MAI-Thinking-1의 RL은 KL 없는 token-level GRPO에 adaptive entropy control(kk로 clip 상한 조절)과 outer ratio clip(ρ≤50\rho \le 50)을 더한 것이다. 보상은 task + 언어 일관성 − pass-rate 비례 길이 벌점이다.
  • self-distillation(O(1M) trace, 여러 후반 체크포인트, prompt 다양성)이 긴 climb의 재시작·이전 도구이고, specialist 3개를 SFT로 합친 뒤 가벼운 RL로 마무리한다.
  • 수치(BPB, 효율 배수, 벤치마크)는 비공개 평가셋과 서로 다른 평가 설정에 기대므로, 방법론과 실패 사례를 가져가는 것이 이 보고서를 가장 잘 쓰는 방법이다.

더 읽을거리Further reading