Track IX · Frontier RL: Algorithms & Stability · 01/10

프론티어 RL 목적함수 지도 — 하나의 틀The frontier RL landscape — one template for every objective

GRPO, DAPO, Dr. GRPO, GSPO, CISPO, IcePop, TIS와 각 랩의 변형을 "토큰당 가중치 × advantage × ∇log π" 하나의 틀로 다시 쓰고, 집계·정규화·ratio 단위·clip/mask·IS 보정·KL을 갈아 끼우는 부품으로 본다. DeepSeek, Qwen, Kimi, MiniMax, MiMo, GLM, MAI, Olmo, Nemotron의 선택을 한 표로 비교한다.Rewrite GRPO, DAPO, Dr. GRPO, GSPO, CISPO, IcePop, TIS and each lab's variant as one template — per-token weight × advantage × ∇log π — whose components (aggregation, normalisation, ratio level, clip/mask, IS correction, KL) are interchangeable parts. Then compare the choices of DeepSeek, Qwen, Kimi, MiniMax, MiMo, GLM, MAI, Olmo and Nemotron in one table.

Since DeepSeek-R1, nearly every frontier technical report has shipped its own RL objective with its own name: GRPO, DAPO, Dr. GRPO, GSPO, CISPO, IcePop, TIS, double-sided masks, entropy-controlled clips. Read one at a time, they look like a zoo. Written in the right coordinates they are one family. Every one of them is REINFORCE with a different weight on each token. This lesson builds that coordinate system, places each lab inside it, and sets up the three lessons that follow, each of which takes one coordinate apart: aggregation and the ratio level, clipping and importance sampling, and regularisation.

The lesson assumes GRPO and its variants and the training–inference mismatch are familiar; it does not re-derive them.

The template: everything is a per-token weight

Take any loss built from the log-probabilities of the sampled tokens, ℓi,t=log⁡πθ(yi,t∣x,yi,<t)\ell_{i,t} = \log\pi_\theta(y_{i,t}\mid x, y_{i,<t}), for GG responses y1,…,yGy_1,\dots,y_G to a prompt xx. Everything else in it — rewards, old log-probs, reference log-probs, the rollout engine’s log-probs — is a constant with respect to θ\theta. By the chain rule

∇θJ  =  ∑i=1G∑t=1∣yi∣∂J∂ℓi,t⏟wi,t  ∇θlog⁡πθ(yi,t∣x,yi,<t).\nabla_\theta J \;=\; \sum_{i=1}^{G}\sum_{t=1}^{|y_i|} \underbrace{\frac{\partial J}{\partial \ell_{i,t}}}_{w_{i,t}}\;\nabla_\theta \log\pi_\theta(y_{i,t}\mid x, y_{i,<t}).

So for a given batch, an objective is fully described by one number per token, wi,tw_{i,t}. Two losses that look nothing alike are the same algorithm if they produce the same ww, and two losses that look almost identical are different algorithms if they do not. This is also how you should read a new paper: compute ww.

For the clipped surrogate, ww follows from differentiating min⁡(ρA,clip⁡(ρ,1−εl,1+εh)A)\min(\rho A, \operatorname{clip}(\rho, 1-\varepsilon_l, 1+\varepsilon_h)A) with ρ=eℓ−ℓold\rho = e^{\ell - \ell_{\text{old}}}, so ∂ρ/∂ℓ=ρ\partial\rho/\partial\ell = \rho:

∂∂ℓmin⁡(ρA, clip⁡(ρ) A)={ρ Aif (A≥0, ρ≤1+εh) or (A<0, ρ≥1−εl)0otherwise.\frac{\partial}{\partial \ell}\min\big(\rho A,\ \operatorname{clip}(\rho)\,A\big) = \begin{cases} \rho\,A & \text{if } (A \ge 0,\ \rho \le 1+\varepsilon_h)\ \text{or}\ (A<0,\ \rho \ge 1-\varepsilon_l)\\ 0 & \text{otherwise.} \end{cases}

When the clipped branch is active the term is a constant and the token gets no gradient at all. The stop-gradient form sg⁡[u] A ℓ\operatorname{sg}[u]\,A\,\ell used by CISPO, MiMo and GLM-5’s agentic stage gives w=uAw = uA directly. Collecting every variant in the literature, the weight always factors into the same six parts:

wi,t  =  ci⏟aggregation[ h(Ri,t, A^i)⏟ratio + clip/mask⋅ui,t⏟IS correction⋅A^i⏟advantage  −  λ ∂Di,t∂ℓi,t⏟regulariser].w_{i,t} \;=\; \underbrace{c_i}_{\text{aggregation}} \Big[\ \underbrace{h\big(R_{i,t},\,\hat A_i\big)}_{\text{ratio + clip/mask}}\cdot \underbrace{u_{i,t}}_{\text{IS correction}}\cdot \underbrace{\hat A_i}_{\text{advantage}} \;-\; \underbrace{\lambda\,\frac{\partial D_{i,t}}{\partial \ell_{i,t}}}_{\text{regulariser}}\Big].
SlotChoices you will meetWhat it decides
Advantage A^i\hat A_i(ri−rˉ)/σ(r_i-\bar r)/\sigma (GRPO), ri−rˉr_i-\bar r (Dr. GRPO, Olmo 3, V3.2, Kimi), leave-one-out, reward-to-go minus baseline (MiniMax-M2)how much signal each response carries, and per-prompt weighting
Aggregation cic_i1G∣yi∣\frac{1}{G\lvert y_i\rvert} (sequence-mean), 1∑j∣yj∣\frac{1}{\sum_j \lvert y_j\rvert} (token-mean), 1GLmax⁡\frac{1}{G L_{\max}} (constant), 1G\frac1G per sequencehow much a token weighs as a function of its response’s length
Ratio RRtoken ρi,t=πθ/πold\rho_{i,t}=\pi_\theta/\pi_{\text{old}}, sequence geometric mean sis_i (GSPO), sequence log-ratio (k1.5), πθ/μ\pi_\theta/\mu against the rollout engine (MiMo-V2.6, GLM-5 agentic)which unit is compared with the trust region
Clip / mask hhPPO clip, clip-higher, dual-clip, CISPO weight cap, log-ratio mask (K2.5), band mask, entropy-controlled bounds (MAI)which tokens lose their gradient, and which are only capped
IS correction uunone, TIS min⁡(k,C)\min(k, C), IcePop k⋅1[k∈[α,β]]k\cdot\mathbb 1[k\in[\alpha,\beta]], V3.2 sequence maskhow the gap k=πold/μk=\pi_{\text{old}}/\mu between trainer and sampler is treated
Regulariser DDnone, k3 to πref\pi_{\text{ref}}, ρ⋅\rho\cdotk3 (V3.2), τ(log⁡ρ)2\tau(\log\rho)^2 to πold\pi_{\text{old}} (K2.5), squared sequence log-ratio (k1.5)what the policy is anchored to

What the template does not contain is just as important. It says nothing about which samples enter the batch (difficulty filtering, dynamic sampling, curricula), about the reward, or about the systems fixes that change the numbers ℓ\ell, ℓold\ell_{\text{old}} and log⁡μ\log\mu themselves (routing replay, FP32 LM head, batch-invariant kernels). Those live in the long-horizon, mismatch-engineering and rewards lessons. Two objectives with the same ww can still behave very differently if one of them is fed a different batch.

In a picture: the same batch under every lab’s objective

The figure draws one prompt’s group of eight responses (lengths 60 to 420 tokens, three correct). Each token has a sampled probability under πold\pi_{\text{old}}, a ratio ρt\rho_t after some updates, and an engine ratio ktk_t with a heavy tail. The ratio is generated as a logit shift of the sampled token, so low-probability tokens move most in ratio space — this is what really happens and it matters for every clip rule.

DeepSeek-R1 이후 거의 모든 프론티어 기술 보고서가 저마다 이름 붙인 RL 목적함수를 내놓았다. GRPO, DAPO, Dr. GRPO, GSPO, CISPO, IcePop, TIS, 양방향 mask, 엔트로피로 조절되는 clip. 하나씩 읽으면 동물원 같다. 알맞은 좌표로 쓰면 한 가족이다. 모두 토큰마다 다른 가중치를 곱한 REINFORCE다. 이 레슨은 그 좌표계를 만들고 각 랩을 그 안에 배치한 뒤, 좌표 하나씩을 해부하는 다음 세 레슨 — 집계와 ratio 단위, clipping과 importance sampling, 정규화 — 을 준비한다.

GRPO와 그 변형, 학습–추론 불일치는 안다고 가정하고 다시 유도하지 않는다.

틀: 모든 것은 토큰당 가중치다

프롬프트 xx에 대한 응답 GG개 y1,…,yGy_1,\dots,y_G의 샘플 토큰 log-확률 ℓi,t=log⁡πθ(yi,t∣x,yi,<t)\ell_{i,t} = \log\pi_\theta(y_{i,t}\mid x, y_{i,<t})로 만든 손실을 아무거나 잡자. 그 안의 나머지 — 보상, old log-prob, reference log-prob, rollout 엔진의 log-prob — 는 θ\theta에 대해 상수다. 연쇄법칙으로

∇θJ  =  ∑i=1G∑t=1∣yi∣∂J∂ℓi,t⏟wi,t  ∇θlog⁡πθ(yi,t∣x,yi,<t).\nabla_\theta J \;=\; \sum_{i=1}^{G}\sum_{t=1}^{|y_i|} \underbrace{\frac{\partial J}{\partial \ell_{i,t}}}_{w_{i,t}}\;\nabla_\theta \log\pi_\theta(y_{i,t}\mid x, y_{i,<t}).

그러니 주어진 배치에서 목적함수는 토큰마다 숫자 하나 wi,tw_{i,t}로 완전히 기술된다. 전혀 달라 보이는 두 손실도 같은 ww를 만들면 같은 알고리즘이고, 거의 같아 보여도 ww가 다르면 다른 알고리즘이다. 새 논문도 이렇게 읽으면 된다. ww를 계산하라.

Clip된 surrogate의 ww는 ρ=eℓ−ℓold\rho = e^{\ell - \ell_{\text{old}}}, 즉 ∂ρ/∂ℓ=ρ\partial\rho/\partial\ell = \rho를 써서 min⁡(ρA,clip⁡(ρ,1−εl,1+εh)A)\min(\rho A, \operatorname{clip}(\rho, 1-\varepsilon_l, 1+\varepsilon_h)A)를 미분하면 나온다.

∂∂ℓmin⁡(ρA, clip⁡(ρ) A)={ρ A(A≥0, ρ≤1+εh) 또는 (A<0, ρ≥1−εl)0그 밖\frac{\partial}{\partial \ell}\min\big(\rho A,\ \operatorname{clip}(\rho)\,A\big) = \begin{cases} \rho\,A & (A \ge 0,\ \rho \le 1+\varepsilon_h)\ \text{또는}\ (A<0,\ \rho \ge 1-\varepsilon_l)\\ 0 & \text{그 밖} \end{cases}

Clip된 가지가 선택되면 그 항은 상수이고 토큰은 gradient를 전혀 받지 않는다. CISPO, MiMo, GLM-5의 agentic 단계가 쓰는 stop-gradient 형태 sg⁡[u] A ℓ\operatorname{sg}[u]\,A\,\ell은 곧바로 w=uAw = uA를 준다. 문헌의 변형을 모두 모으면 가중치는 늘 같은 여섯 부품으로 인수분해된다.

wi,t  =  ci⏟집계[ h(Ri,t, A^i)⏟ratio + clip/mask⋅ui,t⏟IS 보정⋅A^i⏟advantage  −  λ ∂Di,t∂ℓi,t⏟정규화 항].w_{i,t} \;=\; \underbrace{c_i}_{\text{집계}} \Big[\ \underbrace{h\big(R_{i,t},\,\hat A_i\big)}_{\text{ratio + clip/mask}}\cdot \underbrace{u_{i,t}}_{\text{IS 보정}}\cdot \underbrace{\hat A_i}_{\text{advantage}} \;-\; \underbrace{\lambda\,\frac{\partial D_{i,t}}{\partial \ell_{i,t}}}_{\text{정규화 항}}\Big].
칸만나게 될 선택지무엇을 결정하나
Advantage A^i\hat A_i(ri−rˉ)/σ(r_i-\bar r)/\sigma (GRPO), ri−rˉr_i-\bar r (Dr. GRPO, Olmo 3, V3.2, Kimi), leave-one-out, reward-to-go − baseline (MiniMax-M2)응답 하나가 싣는 신호의 크기, 프롬프트별 가중
집계 cic_i1G∣yi∣\frac{1}{G\lvert y_i\rvert} (sequence-mean), 1∑j∣yj∣\frac{1}{\sum_j \lvert y_j\rvert} (token-mean), 1GLmax⁡\frac{1}{G L_{\max}} (상수), 시퀀스당 1G\frac1G응답 길이에 따라 토큰 하나가 얼마나 무거운가
Ratio RR토큰 ρi,t=πθ/πold\rho_{i,t}=\pi_\theta/\pi_{\text{old}}, 시퀀스 기하평균 sis_i (GSPO), 시퀀스 log-ratio (k1.5), rollout 엔진 기준 πθ/μ\pi_\theta/\mu (MiMo-V2.6, GLM-5 agentic)trust region과 비교하는 단위
Clip / mask hhPPO clip, clip-higher, dual-clip, CISPO 가중치 상한, log-ratio mask (K2.5), band mask, 엔트로피 조절 경계 (MAI)어떤 토큰이 gradient를 잃고, 어떤 토큰은 크기만 눌리나
IS 보정 uu없음, TIS min⁡(k,C)\min(k, C), IcePop k⋅1[k∈[α,β]]k\cdot\mathbb 1[k\in[\alpha,\beta]], V3.2 시퀀스 mask학습기와 샘플러의 차이 k=πold/μk=\pi_{\text{old}}/\mu를 어떻게 다루나
정규화 항 DD없음, πref\pi_{\text{ref}}로의 k3, ρ⋅\rho\cdotk3 (V3.2), πold\pi_{\text{old}}로의 τ(log⁡ρ)2\tau(\log\rho)^2 (K2.5), 시퀀스 log-ratio 제곱 (k1.5)정책을 무엇에 묶어 두나

틀이 담지 않는 것도 그만큼 중요하다. 어떤 샘플이 배치에 들어오는가(난이도 필터, dynamic sampling, 커리큘럼), 보상, 그리고 숫자 ℓ\ell, ℓold\ell_{\text{old}}, log⁡μ\log\mu 자체를 바꾸는 시스템 쪽 수정(routing replay, FP32 LM head, batch-invariant 커널)은 여기 없다. 그것들은 long-horizon, 불일치 엔지니어링, 보상 레슨에서 다룬다. ww가 같은 두 목적함수도 다른 배치를 먹으면 전혀 다르게 움직인다.

그림으로: 같은 배치, 랩마다 다른 목적함수

그림은 한 프롬프트에 대한 응답 8개(길이 60–420 토큰, 정답 3개)의 그룹이다. 토큰마다 πold\pi_{\text{old}}에서의 샘플 확률, 몇 번 업데이트한 뒤의 ratio ρt\rho_t, 꼬리가 두꺼운 엔진 ratio ktk_t가 있다. Ratio는 샘플 토큰 logit의 이동으로 만들었기 때문에 확률이 낮은 토큰일수록 ratio 공간에서 크게 움직인다. 실제로도 그렇고, 모든 clip 규칙에 중요하다.

기울기 0 토큰zero-grad tokens A>0 – · A<0 – 긴 오답/짧은 오답 토큰당 |w|per-token |w| long/short wrong – cos(g, gon-policy) –
Every frontier objective has a gradient of the form Σ wi,t ∇log πθ(yi,t); only the per-token weight w differs. Rows are 8 responses to one prompt (● correct, ○ wrong), drawn to length; each thin column is one token, coloured by w (blue raises its probability, red lowers it, grey = gradient removed by a clip or mask). The bar on the right is the response's total Σtw. Pick a lab, then raise policy drift (later minibatches, staler data) and engine mismatch and watch which tokens each rule silences. Change any component to build your own objective. Values a report did not disclose are placeholders (see the table below). 모든 frontier 목적함수의 gradient는 Σ wi,t ∇log πθ(yi,t) 꼴이고, 토큰당 가중치 w만 다르다. 행은 한 프롬프트에 대한 응답 8개(● 정답, ○ 오답)이고 길이에 비례해 그렸다. 가는 세로줄 하나가 토큰 하나이며 색이 w다(파랑은 확률을 올림, 빨강은 내림, 회색 = clip이나 mask로 gradient가 지워짐). 오른쪽 막대는 응답 전체의 Σtw. 랩을 고른 뒤 정책 이동(뒤쪽 minibatch, 오래된 데이터)과 엔진 불일치를 올려 각 규칙이 어떤 토큰을 끄는지 보라. 구성 요소를 바꾸면 자기만의 목적함수가 된다. 보고서가 공개하지 않은 값은 자리표시값이다(아래 표 참고).

Things to try:

  1. GRPO vs DAPO at drift 0.4. GRPO’s long wrong answers (lengths 420 and 380) are pale; switch to DAPO and they turn as red as the short wrong one. The readout “per-token |w| long/short wrong” goes from about 90/420≈0.290/420\approx0.2 to 1. That is aggregation, the subject of the next lesson.
  2. Qwen GSPO. Whole rows go grey at once: the clip acts on the sequence ratio sis_i, so a response is either in or out. With ε=3×10−4\varepsilon = 3\times10^{-4} almost every response is out at drift 0.4 — set drift to 0.05 to see them come back. Within a row the colour is uniform: every token of a response gets the same siA^i/(G∣yi∣)s_i\hat A_i/(G\lvert y_i\rvert).
  3. MiniMax CISPO never shows grey. Tokens with large ρ\rho are capped at 1+εh1+\varepsilon_h but still learn. Compare the “zero-grad” readout with DAPO’s as you raise drift.
  4. GLM-5 (IcePop) and Olmo 3 (TIS) react to the engine mismatch slider, not to drift: IcePop deletes tokens whose kk leaves [0.5,2][0.5, 2]; TIS only shrinks those above 2.
  5. DeepSeek-V3.2 kills whole wrong responses when they drifted away from the sampler (the sequence mask fires only when A^<0\hat A<0). Raise both sliders.
  6. Kimi k1.5 has no clip at all; the pull-back term −τ∑tlog⁡ρt-\tau\sum_t\log\rho_t grows with the response’s length and can flip the sign of a long correct answer’s total weight.
  7. GMPO and Qwen SAPO sit between the token and sequence views: GMPO gives every unclipped token of a response the same geometric-mean weight; SAPO replaces the hard cut-off with a smooth gate, so tokens fade out instead of turning grey. Both are taken apart in the next lesson.

Every lab in one table

Here is what each lab reports, translated into the slots above. Equations and numbers come from the Track VI reviews (linked), which were written from the primary reports; ”—” means the report does not use the component, “n/d” that it uses it without disclosing the value. Placeholders in the figure stand in for every n/d.

Lab · objectiveAdvantageAggregationRatio · clip/mask · ISRegulariserOther stabilisers
DeepSeek-R1 — GRPO(r−rˉ)/σ(r-\bar r)/\sigma, G=16G=16written per sequence; DeepSeekMath form 1G∣yi∣\frac{1}{G\lvert y_i\rvert}PPO clip; ε=10\varepsilon=10 in stage-1 RL (§3.2.1)k3 in loss, β=0.001\beta=0.001; πref\pi_{\text{ref}} replaced every 400 stepsone rollout batch → 16 minibatch updates
DeepSeek-V3.2, V4r−rˉr-\bar r (no std)1G∣yi∣\frac{1}{G\lvert y_i\rvert}token clip (n/d) × off-policy sequence mask: drop A^<0\hat A<0 sequences with 1∣yi∣∑tlog⁡πoldπθ>δ\frac{1}{\lvert y_i\rvert}\sum_t\log\frac{\pi_{\text{old}}}{\pi_\theta}>\delta, πold\pi_{\text{old}} from the inference engineunbiased KL ρ⋅\rho\cdotk3; weakened or dropped for mathsKeep Routing, Keep Sampling Mask, length penalty in reward
Qwen3 → GSPO(r−rˉ)/σ(r-\bar r)/\sigma1G\frac1G per sequence (gradient carries 1/∣yi∣1/\lvert y_i\rvert)sequence ratio si=(πθ/πold)1/∣yi∣s_i=(\pi_\theta/\pi_{\text{old}})^{1/\lvert y_i\rvert}, clip 3×10−43\times10^{-4} / 4×10−44\times10^{-4}—stable MoE RL without routing replay (GSPO §5.3)
Kimi k1.5, K2r−rˉr-\bar rmean over kk samples, no length normalisationno clip; squared loss pulls τlog⁡πθ(y)πold(y)\tau\log\frac{\pi_\theta(y)}{\pi_{\text{old}}(y)} backmirror descent to πθi\pi_{\theta_i} (τ\tau n/d)length reward (k1.5), budget control, PTX loss, temperature decay (K2), partial rollouts
Kimi K2.5 / K3r−rˉr-\bar r1N\frac1N, NN = tokens in batchtoken ratio with a log-ratio mask (gradient zeroed outside the interval, either sign of A^\hat A; bounds n/d)−τ(log⁡ρt)2-\tau(\log\rho_t)^2 per tokeneffort budgets (reward −1-1 above τb0\tau b_0), QAT so rollout and training share precision
MiniMax-M1/M2 — CISPOgroup-relative (M1); reward-to-go − baseline (M2)1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}sg⁡(clip⁡(ρ,0,1+εh))A^log⁡π\operatorname{sg}\big(\operatorname{clip}(\rho,0,1+\varepsilon_h)\big)\hat A\log\pi: weight capped, gradient kept (εh\varepsilon_h n/d)—FP32 LM head (correlation 0.9x → 0.99x), AdamW β2=0.95\beta_2=0.95, ϵ=10−15\epsilon=10^{-15}, dynamic sampling, length penalty
MiMo-7B(r−rˉ)/σ(r-\bar r)/\sigma1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}clip-higher (n/d)—dynamic sampling, 10% easy-pool resampling, 16 updates per iteration
MiMo-V2.6r−rˉr-\bar r (+ GAR rescaling)written 1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}; text says per-prompt meansg⁡[πθ/μ]⋅M\operatorname{sg}[\pi_\theta/\mu]\cdot M, separate bounds for A^>0\hat A>0 and A^<0\hat A<0, initialised at [0.2,5.0][0.2, 5.0], moved by entropy—staleness 4, frozen router, top-p candidate replay
GLM-4.5(r−rˉ)/σ(r-\bar r)/\sigma; r−rˉr-\bar r for agentictoken-weighted (faster for code RL) or sequence-meansymmetric clip (n/d)droppedhard stage with pass@8 = 0, pass@512 > 0; temperature raised at plateaus
GLM-5(r−rˉ)/σ(r-\bar r)/\sigma1G∣yi∣\frac{1}{G\lvert y_i\rvert}clip 0.2/0.280.2/0.28 × IcePop pop⁡(k,12,2)\operatorname{pop}(k,\tfrac12,2); agentic: double-sided band on πθ/πrollout\pi_\theta/\pi_{\text{rollout}}droppeddeterministic top-k in the DSA indexer, optimiser reset after each weight push, staleness filter
MAI-Thinking-1(r−rˉ)/σ(r-\bar r)/\sigmaglobal-batch token meanclip [1−ε, (1−ε)−1+κ][1-\varepsilon,\ (1-\varepsilon)^{-1}+\kappa], ε=0.6\varepsilon=0.6, κ∈[0,2.5]\kappa\in[0,2.5] set by an entropy controller; outer ρ≤50\rho\le 50— (β=0\beta=0)routing replay, top-p mask replay, length term in reward (wlen=0.25w_{\text{len}}=0.25), rollouts ≤ 40 gradient steps stale
Olmo 3r−rˉr-\bar r1∑i∣yi∣\frac{1}{\sum_i\lvert y_i\rvert}clip 0.2/0.2720.2/0.272 × TIS min⁡(πold/πvllm,2)\min(\pi_{\text{old}}/\pi_{\text{vllm}}, 2)—active sampling fills the batch with non-zero groups; inflight weight updates
Nemotron 3 Ultra(r−rˉ)/σ(r-\bar r)/\sigmatoken-level (review’s reading)PPO clip (n/d) × mask on train/infer log-prob ratio (n/d)—asynchronous, ≤ 1 step lag; MOPD stage with behaviour→proximal IS weight
DAPO(r−rˉ)/σ(r-\bar r)/\sigma1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}clip 0.2/0.280.2/0.28—dynamic sampling, overlong shaping
Dr. GRPOr−rˉr-\bar r1GLmax⁡\frac{1}{G L_{\max}}PPO clip——
GMPO(r−rˉ)/σ(r-\bar r)/\sigma1G\frac1G per sequencegeometric mean of token-clipped terms, clip (e−0.4,e0.4)(e^{-0.4}, e^{0.4})——
Qwen SAPO(r−rˉ)/σ(r-\bar r)/\sigmaper sequence, then groupsoft sigmoid gate instead of a hard clip, τ+=1.0\tau_{+}=1.0, τ−=1.05\tau_{-}=1.05——

The MAI column bounds use κ\kappa for the controller state that the report calls kk, to avoid a clash with the engine ratio ktk_t.

Reading the table

Four trends stand out once everything is in the same slots.

1. The std division is leaving. DeepSeek dropped it between R1 and V3.2; Olmo 3, Kimi, MiMo-V2.6 and GLM’s agentic stage never had it. Dividing by σ=p(1−p)\sigma=\sqrt{p(1-p)} for binary rewards up-weights prompts near p=0p=0 or 11 (derivation); labs that keep it (MAI, GLM-5, Nemotron) pair it with filters that remove those prompts anyway.

2. Token-mean aggregation won, with two notable exceptions. DAPO, MiMo, MiniMax, MAI, Olmo, K2.5 and Nemotron normalise by the total token count; DeepSeek V3.2 and GLM-5’s reasoning stage still use 1/(G∣yi∣)1/(G\lvert y_i\rvert), and GSPO’s sequence ratio brings the 1/∣yi∣1/\lvert y_i\rvert back implicitly. MiMo-V2.6’s text argues for per-prompt averaging precisely because it slows length growth. Length bias is not a bug to remove at all costs but a lever.

3. The reference KL is almost gone; anchoring to πold\pi_{\text{old}} replaced it. Only DeepSeek keeps a reference KL (and fixes its estimator). Kimi regularises towards the previous policy with an L2 penalty on the log-ratio. The rest rely on the clip or mask as their only anchor. The regularisation lesson explains why this works for verifiable rewards and what replaces the KL’s role against entropy collapse.

4. The real action moved to the ratio. One ratio now hides three different gaps — the policy update πθ/πold\pi_\theta/\pi_{\text{old}}, staleness, and the engine mismatch πold/μ\pi_{\text{old}}/\mu — and each lab chooses which to clip, which to correct, which to mask, and at which unit (token, sequence, sign of A^\hat A). Compare: Olmo multiplies a TIS weight for the engine gap with a PPO clip for the update; GLM-5’s agentic stage and MiMo-V2.6 skip πold\pi_{\text{old}} and band-mask the full πθ/μ\pi_\theta/\mu; V3.2 masks only negative sequences. The clipping and IS lesson maps all of these on one gradient-weight plot.

The advantage slot: one family of baselines

The template takes A^i\hat A_i as given, but this is the slot with the longest history, and the labs’ choices above are only a corner of it. Every critic-free estimator is a reward minus a baseline, possibly rescaled:

A^i=ri−bisi.\hat A_i = \frac{r_i - b_i}{s_i}.

The baseline keeps the gradient unbiased as long as it does not depend on yiy_i itself, since Ey∼π[b ∇log⁡π(y)]=0\mathbb E_{y\sim\pi}[b\,\nabla\log\pi(y)] = 0; it may depend on the prompt, on the other samples, or on a separate rollout. The scale sis_i is different: it changes how much each prompt (or batch) weighs and therefore which objective is optimised.

EstimatorBaseline bib_iScale sis_iWhat it buys
GRPO (Shao et al. 2024)group mean, including rir_igroup stdamplifies prompts where success is rare; biases toward p≈0p\approx0 or 11
Dr. GRPO (Liu et al. 2025)group mean1the GRPO direction without the per-prompt reweighting
RLOO (Ahmadian et al. 2024)mean of the other G−1G-11exactly unbiased; equals GG−1×\frac{G}{G-1}\times Dr. GRPO
REINFORCE++ (Hu et al. 2025)global batch mean of r−β∑s≥tKLsr-\beta\sum_{s\ge t}\mathrm{KL}_sglobal batch stdone sample per prompt; k1 KL folded into the return
REINFORCE++-baselinegroup mean, then batch meanglobal batch stdgroup baseline, batch-level scale; KL moved to a separate k2 loss
ReMax (Li et al. 2024)reward of the greedy decode1one extra greedy rollout instead of a critic
OPO (Hao et al. 2025)∑jljrj/∑jlj\sum_j l_j r_j / \sum_j l_j1the variance-minimising baseline when gradient size grows with length
GPG (Chu et al. 2025)group meanB−MB\frac{B-M}{B} (MM = samples in zero-advantage groups)plain −A^log⁡π-\hat A\log\pi, no surrogate, clip, KL or reference; the rescale undoes the dilution by dead groups
pass@k advantage (Tang et al. 2025)second-best reward in the group1optimises the max over kk samples: only the best response gets signal
Optimal Token Baseline (Li et al. 2026)per token: reward-to-go averaged with weights W^t=∑j≤t(1−2π(yj)+∥πj∥22)\hat W_t=\sum_{j\le t}(1-2\pi(y_j)+\lVert\pi_j\rVert_2^2)1per-token variance reduction for long horizons

The figure puts eight of them side by side on the same two prompts.

해 볼 것:

  1. 이동 0.4에서 GRPO와 DAPO. GRPO에서 긴 오답(길이 420, 380)은 옅다. DAPO로 바꾸면 짧은 오답만큼 빨갛다. “긴/짧은 오답 토큰당 |w|” 값이 대략 90/420≈0.290/420\approx0.2에서 1로 바뀐다. 이것이 집계이고, 다음 레슨의 주제다.
  2. Qwen GSPO. 행 전체가 한꺼번에 회색이 된다. clip이 시퀀스 ratio sis_i에 걸리므로 응답 단위로 들어오거나 나간다. ε=3×10−4\varepsilon = 3\times10^{-4}이면 이동 0.4에서 거의 모든 응답이 밖이다. 이동을 0.05로 내리면 돌아온다. 한 행 안의 색은 균일하다. 응답의 모든 토큰이 같은 siA^i/(G∣yi∣)s_i\hat A_i/(G\lvert y_i\rvert)를 받는다.
  3. MiniMax CISPO에는 회색이 없다. ρ\rho가 큰 토큰은 1+εh1+\varepsilon_h에서 눌리지만 여전히 배운다. 이동을 올리며 “기울기 0 토큰” 값을 DAPO와 비교하라.
  4. **GLM-5 (IcePop)**과 **Olmo 3 (TIS)**는 이동이 아니라 엔진 불일치 슬라이더에 반응한다. IcePop은 kk가 [0.5,2][0.5, 2]를 벗어난 토큰을 지우고, TIS는 2를 넘는 토큰을 줄이기만 한다.
  5. DeepSeek-V3.2는 샘플러에서 멀어진 오답 응답을 통째로 끈다(시퀀스 mask는 A^<0\hat A<0일 때만 작동). 두 슬라이더를 모두 올려 보라.
  6. Kimi k1.5에는 clip이 아예 없다. 끌어당기는 항 −τ∑tlog⁡ρt-\tau\sum_t\log\rho_t가 응답 길이에 따라 커져서, 긴 정답의 총 가중치 부호를 뒤집기도 한다.
  7. GMPO와 Qwen SAPO는 토큰 관점과 시퀀스 관점 사이에 있다. GMPO는 응답에서 clip되지 않은 모든 토큰에 같은 기하평균 가중치를 준다. SAPO는 딱 끊는 대신 부드러운 gate를 써서 토큰이 회색이 되는 대신 서서히 흐려진다. 둘 다 다음 레슨에서 해부한다.

모든 랩을 한 표에

각 랩이 보고한 내용을 위 칸들로 옮긴 표다. 식과 숫자는 원 보고서로 쓴 Track VI 리뷰(링크)에서 가져왔다. ”—“는 그 부품을 쓰지 않음, “비공개”는 쓰지만 값을 밝히지 않음이다. 그림의 자리표시값이 모든 비공개 값을 대신한다.

랩 · 목적함수Advantage집계Ratio · clip/mask · IS정규화 항그 밖의 안정화
DeepSeek-R1 — GRPO(r−rˉ)/σ(r-\bar r)/\sigma, G=16G=16시퀀스 단위로 표기; DeepSeekMath 형태는 1G∣yi∣\frac{1}{G\lvert y_i\rvert}PPO clip; stage-1 RL에서 ε=10\varepsilon=10 (§3.2.1)손실 안의 k3, β=0.001\beta=0.001; 400 step마다 πref\pi_{\text{ref}} 교체rollout 배치 하나 → minibatch 업데이트 16번
DeepSeek-V3.2, V4r−rˉr-\bar r (std 없음)1G∣yi∣\frac{1}{G\lvert y_i\rvert}토큰 clip(비공개) × off-policy 시퀀스 mask: 1∣yi∣∑tlog⁡πoldπθ>δ\frac{1}{\lvert y_i\rvert}\sum_t\log\frac{\pi_{\text{old}}}{\pi_\theta}>\delta인 A^<0\hat A<0 시퀀스를 버림, πold\pi_{\text{old}}는 추론 엔진 확률편향 없는 KL ρ⋅\rho\cdotk3; 수학에서는 약하게 하거나 뺌Keep Routing, Keep Sampling Mask, 보상의 길이 패널티
Qwen3 → GSPO(r−rˉ)/σ(r-\bar r)/\sigma시퀀스당 1G\frac1G (gradient가 1/∣yi∣1/\lvert y_i\rvert를 실어 옴)시퀀스 ratio si=(πθ/πold)1/∣yi∣s_i=(\pi_\theta/\pi_{\text{old}})^{1/\lvert y_i\rvert}, clip 3×10−43\times10^{-4} / 4×10−44\times10^{-4}—routing replay 없이 MoE RL 안정 (GSPO §5.3)
Kimi k1.5, K2r−rˉr-\bar r샘플 kk개 평균, 길이 정규화 없음clip 없음; 제곱 손실이 τlog⁡πθ(y)πold(y)\tau\log\frac{\pi_\theta(y)}{\pi_{\text{old}}(y)}를 끌어당김πθi\pi_{\theta_i}로의 mirror descent (τ\tau 비공개)길이 보상(k1.5), budget control, PTX loss, temperature decay(K2), partial rollout
Kimi K2.5 / K3r−rˉr-\bar r1N\frac1N, NN = 배치 토큰 수토큰 ratio에 log-ratio mask(구간 밖이면 A^\hat A 부호와 무관하게 gradient 0; 경계 비공개)토큰마다 −τ(log⁡ρt)2-\tau(\log\rho_t)^2effort budget(보상 −1-1 above τb0\tau b_0), rollout과 학습이 같은 정밀도를 쓰는 QAT
MiniMax-M1/M2 — CISPO그룹 상대(M1); reward-to-go − baseline(M2)1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}sg⁡(clip⁡(ρ,0,1+εh))A^log⁡π\operatorname{sg}\big(\operatorname{clip}(\rho,0,1+\varepsilon_h)\big)\hat A\log\pi: 가중치만 상한, gradient 유지(εh\varepsilon_h 비공개)—FP32 LM head(상관 0.9x → 0.99x), AdamW β2=0.95\beta_2=0.95, ϵ=10−15\epsilon=10^{-15}, dynamic sampling, 길이 패널티
MiMo-7B(r−rˉ)/σ(r-\bar r)/\sigma1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}clip-higher(비공개)—dynamic sampling, easy pool 10% 재샘플, iteration당 업데이트 16번
MiMo-V2.6r−rˉr-\bar r (+ GAR 재조정)식은 1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}, 본문은 프롬프트별 평균sg⁡[πθ/μ]⋅M\operatorname{sg}[\pi_\theta/\mu]\cdot M, A^>0\hat A>0과 A^<0\hat A<0에 별도 경계, 초기값 [0.2,5.0][0.2, 5.0], 엔트로피로 조정—staleness 4, router 고정, top-p 후보 replay
GLM-4.5(r−rˉ)/σ(r-\bar r)/\sigma; agentic은 r−rˉr-\bar rtoken-weighted(code RL에서 더 빠름) 또는 sequence-mean대칭 clip(비공개)뺌pass@8 = 0, pass@512 > 0 문제로 된 어려운 단계; 정체 시 temperature 상향
GLM-5(r−rˉ)/σ(r-\bar r)/\sigma1G∣yi∣\frac{1}{G\lvert y_i\rvert}clip 0.2/0.280.2/0.28 × IcePop pop⁡(k,12,2)\operatorname{pop}(k,\tfrac12,2); agentic: πθ/πrollout\pi_\theta/\pi_{\text{rollout}}에 양방향 band뺌DSA indexer의 결정적 top-k, weight push마다 optimizer 초기화, staleness 필터
MAI-Thinking-1(r−rˉ)/σ(r-\bar r)/\sigma전역 배치 토큰 평균clip [1−ε, (1−ε)−1+κ][1-\varepsilon,\ (1-\varepsilon)^{-1}+\kappa], ε=0.6\varepsilon=0.6, κ∈[0,2.5]\kappa\in[0,2.5]는 엔트로피 controller가 정함; 바깥 ρ≤50\rho\le 50— (β=0\beta=0)routing replay, top-p mask replay, 보상의 길이 항(wlen=0.25w_{\text{len}}=0.25), rollout은 gradient step 40 이하로 stale
Olmo 3r−rˉr-\bar r1∑i∣yi∣\frac{1}{\sum_i\lvert y_i\rvert}clip 0.2/0.2720.2/0.272 × TIS min⁡(πold/πvllm,2)\min(\pi_{\text{old}}/\pi_{\text{vllm}}, 2)—active sampling으로 0이 아닌 그룹만 채움; inflight weight update
Nemotron 3 Ultra(r−rˉ)/σ(r-\bar r)/\sigma토큰 단위(리뷰의 해석)PPO clip(비공개) × 학습/추론 log-prob ratio mask(비공개)—비동기, 지연 ≤ 1 step; behaviour→proximal IS 가중치를 쓰는 MOPD 단계
DAPO(r−rˉ)/σ(r-\bar r)/\sigma1∑i∣oi∣\frac{1}{\sum_i\lvert o_i\rvert}clip 0.2/0.280.2/0.28—dynamic sampling, overlong shaping
Dr. GRPOr−rˉr-\bar r1GLmax⁡\frac{1}{G L_{\max}}PPO clip——
GMPO(r−rˉ)/σ(r-\bar r)/\sigma시퀀스당 1G\frac1G토큰별로 clip한 항의 기하평균, clip (e−0.4,e0.4)(e^{-0.4}, e^{0.4})——
Qwen SAPO(r−rˉ)/σ(r-\bar r)/\sigma시퀀스, 이어서 그룹hard clip 대신 부드러운 sigmoid gate, τ+=1.0\tau_{+}=1.0, τ−=1.05\tau_{-}=1.05——

MAI 행의 경계는 엔진 ratio ktk_t와 겹치지 않도록 보고서의 controller 상태 kk를 κ\kappa로 썼다.

표 읽기

모두 같은 칸에 넣으면 네 가지 흐름이 보인다.

1. std 나눗셈이 사라지고 있다. DeepSeek은 R1과 V3.2 사이에 뺐고, Olmo 3, Kimi, MiMo-V2.6, GLM의 agentic 단계는 처음부터 없었다. 이진 보상에서 σ=p(1−p)\sigma=\sqrt{p(1-p)}로 나누면 pp가 0이나 1 근처인 프롬프트가 무거워진다(유도). 이를 유지하는 랩(MAI, GLM-5, Nemotron)은 그런 프롬프트를 어차피 걸러 내는 필터와 함께 쓴다.

2. Token-mean 집계가 이겼다. 눈에 띄는 예외가 둘 있다. DAPO, MiMo, MiniMax, MAI, Olmo, K2.5, Nemotron은 전체 토큰 수로 나눈다. DeepSeek V3.2와 GLM-5의 추론 단계는 여전히 1/(G∣yi∣)1/(G\lvert y_i\rvert)를 쓰고, GSPO의 시퀀스 ratio는 1/∣yi∣1/\lvert y_i\rvert를 은근히 되살린다. MiMo-V2.6 본문은 바로 길이 증가를 늦춘다는 이유로 프롬프트별 평균을 택한다. 길이 편향은 무조건 없앨 버그가 아니라 손잡이다.

3. Reference KL은 거의 사라졌고, πold\pi_{\text{old}}에 묶는 것이 그 자리를 대신했다. Reference KL을 유지하는 곳은 DeepSeek뿐이다(그리고 추정량을 고쳤다). Kimi는 log-ratio에 대한 L2 패널티로 직전 정책에 묶는다. 나머지는 clip이나 mask가 유일한 닻이다. 검증 가능한 보상에서 이것이 왜 통하는지, 엔트로피 붕괴를 막던 KL의 역할을 무엇이 대신하는지는 정규화 레슨에서 다룬다.

4. 진짜 싸움은 ratio로 옮겨 갔다. 이제 ratio 하나에 세 가지 차이 — 정책 업데이트 πθ/πold\pi_\theta/\pi_{\text{old}}, staleness, 엔진 불일치 πold/μ\pi_{\text{old}}/\mu — 가 숨어 있고, 각 랩은 무엇을 clip하고 무엇을 보정하고 무엇을 mask할지, 어떤 단위(토큰, 시퀀스, A^\hat A의 부호)로 할지 고른다. Olmo는 엔진 차이용 TIS 가중치와 업데이트용 PPO clip을 곱한다. GLM-5 agentic과 MiMo-V2.6은 πold\pi_{\text{old}}를 건너뛰고 πθ/μ\pi_\theta/\mu 전체에 band mask를 건다. V3.2는 음의 시퀀스만 mask한다. Clipping과 IS 레슨이 이 모두를 gradient 가중치 그림 하나에 올린다.

Advantage 칸: baseline의 한 가족

틀은 A^i\hat A_i를 주어진 것으로 받지만, 이 칸이야말로 역사가 가장 길고 위 랩들의 선택은 그 한 구석일 뿐이다. critic 없는 추정량은 모두 보상에서 baseline을 빼고, 필요하면 크기를 다시 맞춘 것이다.

A^i=ri−bisi.\hat A_i = \frac{r_i - b_i}{s_i}.

Ey∼π[b ∇log⁡π(y)]=0\mathbb E_{y\sim\pi}[b\,\nabla\log\pi(y)] = 0이므로 baseline은 yiy_i 자신에만 의존하지 않으면 gradient를 편향시키지 않는다. 프롬프트, 다른 샘플, 별도의 rollout에는 의존해도 된다. 크기 sis_i는 다르다. 프롬프트(또는 배치)마다의 무게를 바꾸고, 따라서 최적화하는 목적함수 자체를 바꾼다.

추정량Baseline bib_i크기 sis_i얻는 것
GRPO (Shao et al. 2024)rir_i를 포함한 그룹 평균그룹 std성공이 드문 프롬프트를 증폭; p≈0p\approx0이나 11 쪽으로 치우침
Dr. GRPO (Liu et al. 2025)그룹 평균1프롬프트별 재가중 없는 GRPO 방향
RLOO (Ahmadian et al. 2024)나머지 G−1G-1개의 평균1정확히 편향 없음; Dr. GRPO의 GG−1\frac{G}{G-1}배
REINFORCE++ (Hu et al. 2025)r−β∑s≥tKLsr-\beta\sum_{s\ge t}\mathrm{KL}_s의 전역 배치 평균전역 배치 std프롬프트당 샘플 하나; k1 KL을 return에 넣음
REINFORCE++-baseline그룹 평균, 이어서 배치 평균전역 배치 std그룹 baseline + 배치 단위 크기; KL은 별도 k2 손실
ReMax (Li et al. 2024)greedy 디코딩의 보상1critic 대신 greedy rollout 하나 추가
OPO (Hao et al. 2025)∑jljrj/∑jlj\sum_j l_j r_j / \sum_j l_j1gradient 크기가 길이에 비례할 때 분산을 최소화하는 baseline
GPG (Chu et al. 2025)그룹 평균B−MB\frac{B-M}{B} (MM = advantage 0 그룹의 샘플 수)surrogate·clip·KL·reference 없는 −A^log⁡π-\hat A\log\pi; 죽은 그룹에 의한 희석을 되돌림
pass@k advantage (Tang et al. 2025)그룹의 두 번째로 좋은 보상1kk개 샘플의 최댓값을 최적화: 가장 좋은 응답만 신호를 받음
Optimal Token Baseline (Li et al. 2026)토큰마다: 가중치 W^t=∑j≤t(1−2π(yj)+∥πj∥22)\hat W_t=\sum_{j\le t}(1-2\pi(y_j)+\lVert\pi_j\rVert_2^2)로 평균한 reward-to-go1긴 horizon에서 토큰 단위 분산 감소

그림은 이 가운데 여덟 개를 같은 두 프롬프트 위에 나란히 놓는다.

Two prompts, six responses each (number = length in tokens). Click a reward dot to flip it, and click the "greedy" box to change the reward of the greedy decode that ReMax uses as its baseline. Each row is one estimator, all on the same scale. Things to see: RLOO is Dr. GRPO times G/(G−1); GRPO inflates the rare correct answer; REINFORCE++-baseline rescales by the batch std, so prompt A's numbers change when you edit prompt B; OPO's baseline leans towards long responses' rewards; GPG scales everything up when a group carries no signal; the pass@k advantage rewards only the single best response and is zero whenever two or more are correct. 프롬프트 둘, 각각 응답 여섯 개(숫자 = 토큰 길이). 보상 점을 클릭하면 뒤집히고, "greedy" 상자를 클릭하면 ReMax가 baseline으로 쓰는 greedy 디코딩의 보상이 바뀐다. 행 하나가 추정량 하나이고 모두 같은 눈금이다. 볼 것: RLOO는 Dr. GRPO의 G/(G−1)배다. GRPO는 드문 정답을 부풀린다. REINFORCE++-baseline은 배치 std로 나누므로 프롬프트 B를 바꾸면 A의 숫자도 바뀐다. OPO의 baseline은 긴 응답의 보상 쪽으로 기운다. GPG는 신호 없는 그룹이 있으면 전체를 키운다. pass@k advantage는 가장 좋은 응답 하나만 보상하고, 정답이 둘 이상이면 0이다.

Three things to take from the figure. First, the baseline changes the direction only by a per-prompt constant (Dr. GRPO, RLOO and GPG are parallel within a group), while the scale changes how prompts are weighted against each other: GRPO’s std and REINFORCE++‘s batch std are choices about the objective, not about variance alone. Press “prompt B all correct”: GRPO, Dr. GRPO and RLOO give B nothing, GPG scales prompt A up by B/(B−M)=2B/(B-M)=2 to keep the step size, and REINFORCE++-baseline’s batch std shrinks, so A’s advantages change even though nothing about A did. Second, ReMax can produce all-negative or all-zero advantages within a group (when the greedy answer is correct, every correct sample gets 0) — its baseline is a different rollout, not the group. Third, the pass@k advantage is the most selective: with binary rewards it is non-zero only when exactly one response is correct. It optimises the probability that at least one of kk samples succeeds, which is the right target when the model will be used with best-of-kk or a verifier, and the wrong one for pass@1.

Why OPO weights by length

When the reward is a single scalar per response, the gradient of response ii is (ri−b)∑t∇log⁡π(yi,t)(r_i-b)\sum_t\nabla\log\pi(y_{i,t}), whose squared norm grows roughly in proportion to its length lil_i. Minimising E[(r−b)2 l]\mathbb E[(r-b)^2\,l] over bb gives

b⋆=E[l r]E[l]  ≈  ∑jljrj∑jlj,b^\star = \frac{\mathbb E[l\,r]}{\mathbb E[l]} \;\approx\; \frac{\sum_j l_j r_j}{\sum_j l_j},

which is OPO’s baseline (Hao et al. 2025, derived under the assumption that per-token score vectors are roughly independent with similar norm). When long responses are more often wrong, b⋆b^\star is lower than the mean reward. The block below checks this numerically.

NumPy The variance-optimal baseline and the critic-free family
import numpy as np
rng = np.random.default_rng(1)

# A "response" of length l has score ∇log π(y) = Σ_t s_t with s_t ~ N(0, I_d) independent,
# so E‖∇log π(y)‖² = l·d: long responses carry bigger gradients. Reward correlates with length.
d, n = 8, 4000
l = rng.choice([200, 400, 800, 1600, 3200], size=n, p=[.25, .25, .2, .2, .1])
p_correct = np.interp(np.log(l), np.log([200, 3200]), [0.7, 0.2])   # long = more often wrong
r = (rng.random(n) < p_correct).astype(float)
score = rng.normal(size=(n, d)) * np.sqrt(l)[:, None]                # Σ_t s_t has variance l per dim

def grad_var(b):
    g = (r - b)[:, None] * score                                     # one-sample gradient estimates
    return ((g - g.mean(0)) ** 2).sum(1).mean()                      # trace of the covariance

b_mean = r.mean()
b_opo = (l * r).sum() / l.sum()                                      # OPO: length-weighted baseline
bs = np.linspace(0, 1, 201)
b_best = bs[np.argmin([grad_var(b) for b in bs])]
print(f"mean reward baseline      b = {b_mean:.3f}   var = {grad_var(b_mean):9.1f}")
print(f"OPO baseline Σ l r / Σ l  b = {b_opo:.3f}   var = {grad_var(b_opo):9.1f}")
print(f"grid-search minimum       b = {b_best:.3f}   var = {grad_var(b_best):9.1f}")
print(f"no baseline               b = 0.000   var = {grad_var(0.0):9.1f}")

# The critic-free estimators on one group (G = 6), as functions of rewards (and lengths).
def estimators(r, lens, r_greedy):
    G = len(r); m = r.mean()
    out = {
        "GRPO":     (r - m) / (r.std() + 1e-6),
        "Dr.GRPO":  r - m,
        "RLOO":     r - (r.sum() - r) / (G - 1),
        "ReMax":    r - r_greedy,
        "OPO":      r - (lens * r).sum() / lens.sum(),
    }
    top = np.argsort(-r, kind="stable")
    pk = np.zeros(G); pk[top[0]] = r[top[0]] - r[top[1]]             # pass@k: only the best sample
    out["pass@k"] = pk
    return out

r6 = np.array([1., 0., 1., 0., 0., 1.]); l6 = np.array([220, 900, 400, 1500, 300, 650])
print()
for k, v in estimators(r6, l6, r_greedy=1.0).items():
    print(f"{k:8s}", np.round(v, 2))
r1 = np.array([0., 0., 1., 0., 0., 0.])
print("one correct → pass@k:", estimators(r1, l6, 0.0)["pass@k"], " GRPO:", np.round(estimators(r1, l6, 0.0)["GRPO"], 2))
 

The grid-search minimum lands on the OPO baseline (about 0.33 against a mean reward of 0.49), cutting the gradient variance by about 9% relative to the mean baseline here. The gain is larger when lengths are more spread out and more strongly correlated with the reward, which is exactly the long-reasoning regime.

The critic-based branch

Before group baselines, the advantage came from a learned value function through GAE (Schulman et al. 2015), A^t=∑l≥0(γλ)lδt+l\hat A_t=\sum_{l\ge0}(\gamma\lambda)^l\delta_{t+l} with δt=rt+γV(st+1)−V(st)\delta_t=r_t+\gamma V(s_{t+1})-V(s_t) (see actor-critic). With a reward only at the end of a long chain of thought, two things go wrong. VC-PPO (Yuan et al. 2025) traced PPO’s collapse on long CoT to the value model’s initialisation bias: with λ<1\lambda<1 the early tokens’ advantages are dominated by a critic that has not learned yet. Its fixes are to pretrain the value model on a fixed policy and to decouple λ\lambda: λcritic=1\lambda_{\text{critic}}=1 (an unbiased Monte Carlo target for the value) and λpolicy≈0.95\lambda_{\text{policy}}\approx0.95. VAPO (Yue et al. 2025) makes the policy’s λ\lambda length-adaptive, λpolicy=1−1α l\lambda_{\text{policy}}=1-\frac{1}{\alpha\,l} with α≈0.05\alpha\approx0.05, so that a 2,000-token response bootstraps less (λ ≈ 0.99) than a 100-token one (λ = 0.8). The frontier labs in the table all chose the critic-free branch, but per-token advantages are coming back through other doors: reward-to-go minus a baseline (MiniMax-M2), the Optimal Token Baseline, and dense teacher log-ratios in on-policy distillation.

Two older tools complete the picture. PF-PPO (Zhang et al. 2025) does not change the estimator at all; it filters which samples enter the batch, keeping the reward-model ranks where the RM is reliable (e.g. best and worst of NN). And the adaptive KL controller of Ziegler et al. (2019) moves β\beta multiplicatively toward a target KL; it belongs to the regulariser slot and is treated in the regularisation lesson.

Bias and variance across objectives

Every clip or mask trades bias for variance: it removes or caps exactly the tokens with extreme ratios, which are the tokens that would dominate the update. The next figure sweeps the policy drift and plots two batch statistics for every objective: the share of tokens whose gradient was removed (what the objective refuses to learn from) and the effective sample size of the weights (how many tokens effectively contribute).

그림에서 가져갈 것 셋. 첫째, baseline은 프롬프트마다 상수만큼만 방향을 바꾸지만(그룹 안에서 Dr. GRPO, RLOO, GPG는 평행하다), 크기는 프롬프트끼리의 무게를 바꾼다. GRPO의 std와 REINFORCE++의 배치 std는 분산만이 아니라 목적함수에 관한 선택이다. “프롬프트 B 모두 정답”을 눌러 보라. GRPO, Dr. GRPO, RLOO는 B에 아무것도 주지 않고, GPG는 step 크기를 지키려고 프롬프트 A를 B/(B−M)=2B/(B-M)=2배로 키우며, REINFORCE++-baseline은 배치 std가 줄어서 A에 대해 아무것도 바뀌지 않았는데도 A의 advantage가 바뀐다. 둘째, ReMax는 그룹 안에서 모두 음수이거나 모두 0인 advantage를 만들 수 있다(greedy 답이 맞으면 맞은 샘플은 모두 0). baseline이 그룹이 아니라 다른 rollout이기 때문이다. 셋째, pass@k advantage가 가장 까다롭다. 이진 보상에서는 정확히 하나만 맞았을 때만 0이 아니다. kk개 중 적어도 하나가 성공할 확률을 최적화하므로, 모델을 best-of-kk나 verifier와 함께 쓸 때는 맞는 목표이고 pass@1에는 틀린 목표다.

OPO가 길이로 가중하는 이유

보상이 응답마다 스칼라 하나이면 응답 ii의 gradient는 (ri−b)∑t∇log⁡π(yi,t)(r_i-b)\sum_t\nabla\log\pi(y_{i,t})이고, 그 제곱 노름은 대략 길이 lil_i에 비례해 커진다. E[(r−b)2 l]\mathbb E[(r-b)^2\,l]을 bb에 대해 최소화하면

b⋆=E[l r]E[l]  ≈  ∑jljrj∑jlj,b^\star = \frac{\mathbb E[l\,r]}{\mathbb E[l]} \;\approx\; \frac{\sum_j l_j r_j}{\sum_j l_j},

이것이 OPO의 baseline이다(Hao et al. 2025, 토큰별 score 벡터가 대략 독립이고 노름이 비슷하다는 가정 아래 유도). 긴 응답이 더 자주 틀리면 b⋆b^\star는 평균 보상보다 낮다. 아래 블록이 수치로 확인한다.

NumPy 분산 최적 baseline과 critic 없는 추정량들
import numpy as np
rng = np.random.default_rng(1)

# 길이 l인 "응답"의 score ∇log π(y) = Σ_t s_t, s_t ~ N(0, I_d) 독립
# → E‖∇log π(y)‖² = l·d: 긴 응답일수록 gradient가 크다. 보상은 길이와 상관된다.
d, n = 8, 4000
l = rng.choice([200, 400, 800, 1600, 3200], size=n, p=[.25, .25, .2, .2, .1])
p_correct = np.interp(np.log(l), np.log([200, 3200]), [0.7, 0.2])   # 길수록 자주 틀림
r = (rng.random(n) < p_correct).astype(float)
score = rng.normal(size=(n, d)) * np.sqrt(l)[:, None]                # Σ_t s_t의 차원별 분산 = l

def grad_var(b):
    g = (r - b)[:, None] * score                                     # 샘플 하나짜리 gradient 추정
    return ((g - g.mean(0)) ** 2).sum(1).mean()                      # 공분산의 trace

b_mean = r.mean()
b_opo = (l * r).sum() / l.sum()                                      # OPO: 길이 가중 baseline
bs = np.linspace(0, 1, 201)
b_best = bs[np.argmin([grad_var(b) for b in bs])]
print(f"mean reward baseline      b = {b_mean:.3f}   var = {grad_var(b_mean):9.1f}")
print(f"OPO baseline Σ l r / Σ l  b = {b_opo:.3f}   var = {grad_var(b_opo):9.1f}")
print(f"grid-search minimum       b = {b_best:.3f}   var = {grad_var(b_best):9.1f}")
print(f"no baseline               b = 0.000   var = {grad_var(0.0):9.1f}")

# 그룹 하나(G = 6)에서 critic 없는 추정량들 — 보상(과 길이)의 함수
def estimators(r, lens, r_greedy):
    G = len(r); m = r.mean()
    out = {
        "GRPO":     (r - m) / (r.std() + 1e-6),
        "Dr.GRPO":  r - m,
        "RLOO":     r - (r.sum() - r) / (G - 1),
        "ReMax":    r - r_greedy,
        "OPO":      r - (lens * r).sum() / lens.sum(),
    }
    top = np.argsort(-r, kind="stable")
    pk = np.zeros(G); pk[top[0]] = r[top[0]] - r[top[1]]             # pass@k: 가장 좋은 샘플만
    out["pass@k"] = pk
    return out

r6 = np.array([1., 0., 1., 0., 0., 1.]); l6 = np.array([220, 900, 400, 1500, 300, 650])
print()
for k, v in estimators(r6, l6, r_greedy=1.0).items():
    print(f"{k:8s}", np.round(v, 2))
r1 = np.array([0., 0., 1., 0., 0., 0.])
print("one correct → pass@k:", estimators(r1, l6, 0.0)["pass@k"], " GRPO:", np.round(estimators(r1, l6, 0.0)["GRPO"], 2))
 

격자 탐색의 최솟값이 OPO baseline(평균 보상 0.49에 대해 약 0.33)에 떨어지고, 여기서는 평균 baseline보다 gradient 분산이 9%쯤 줄어든다. 길이가 더 넓게 퍼져 있고 보상과 더 강하게 상관될수록 이득이 크다. 바로 긴 추론의 영역이다.

Critic을 쓰는 갈래

그룹 baseline 이전에는 학습한 가치함수에서 GAE(Schulman et al. 2015)로 advantage를 얻었다. A^t=∑l≥0(γλ)lδt+l\hat A_t=\sum_{l\ge0}(\gamma\lambda)^l\delta_{t+l}, δt=rt+γV(st+1)−V(st)\delta_t=r_t+\gamma V(s_{t+1})-V(s_t)(actor-critic 참고). 보상이 긴 chain of thought의 끝에만 있으면 두 가지가 어긋난다. VC-PPO(Yuan et al. 2025)는 긴 CoT에서 PPO가 무너지는 원인을 가치 모델의 초기화 편향에서 찾았다. λ<1\lambda<1이면 앞쪽 토큰의 advantage가 아직 배우지 못한 critic에 지배된다. 해법은 고정된 정책으로 가치 모델을 먼저 학습시키고 λ\lambda를 분리하는 것이다. λcritic=1\lambda_{\text{critic}}=1(가치에 대한 편향 없는 Monte Carlo 목표), λpolicy≈0.95\lambda_{\text{policy}}\approx0.95. VAPO(Yue et al. 2025)는 정책의 λ\lambda를 길이에 맞춘다. λpolicy=1−1α l\lambda_{\text{policy}}=1-\frac{1}{\alpha\,l}, α≈0.05\alpha\approx0.05이므로 2,000토큰 응답은 100토큰 응답(λ = 0.8)보다 덜 bootstrap한다(λ ≈ 0.99). 표의 프론티어 랩은 모두 critic 없는 갈래를 골랐지만, 토큰 단위 advantage는 다른 문으로 돌아오고 있다. reward-to-go − baseline(MiniMax-M2), Optimal Token Baseline, on-policy distillation의 dense한 teacher log-ratio다.

오래된 도구 둘이 그림을 채운다. PF-PPO(Zhang et al. 2025)는 추정량을 전혀 바꾸지 않는다. 보상모델이 믿을 만한 순위(예: NN개 중 최고와 최저)만 남기도록 배치에 들어갈 샘플을 거른다. Ziegler et al.(2019)의 적응형 KL controller는 목표 KL 쪽으로 β\beta를 곱셈으로 움직인다. 정규화 칸에 속하며 정규화 레슨에서 다룬다.

목적함수별 bias와 variance

모든 clip과 mask는 bias를 내주고 variance를 산다. ratio가 극단적인 토큰, 즉 업데이트를 좌우했을 토큰을 정확히 지우거나 누른다. 다음 그림은 정책 이동을 키우며 모든 목적함수에 대해 배치 통계 둘을 그린다. gradient가 지워진 토큰의 비율(목적함수가 배우기를 거부하는 몫)과 가중치의 effective sample size(실제로 기여하는 토큰이 몇 개인가)다.

Each line is one objective evaluated on the same synthetic group while policy drift grows (x axis). Left: the share of tokens whose gradient a clip or mask removes, i.e. how much of the batch the objective refuses to learn from (a bias). Right: the effective sample size of the per-token weights, (Σ|w|)²/(N Σw²); low values mean a few tokens dominate the step (variance). Pick two objectives to highlight. Notice that the objectives barely differ at zero drift except through aggregation, and that every rule buys a lower variance by removing or capping exactly the tokens that moved most. 선 하나가 목적함수 하나이고, 같은 합성 그룹에서 정책 이동(x축)을 키우며 계산했다. 왼쪽: clip이나 mask가 gradient를 지운 토큰의 비율, 즉 목적함수가 배우기를 거부하는 배치의 몫(bias 쪽). 오른쪽: 토큰 가중치의 effective sample size (Σ|w|)²/(N Σw²). 낮으면 소수 토큰이 한 step을 좌우한다(variance 쪽). 비교할 두 목적함수를 고르라. 이동이 0일 때는 집계 방식 말고는 거의 차이가 없고, 모든 규칙이 가장 많이 움직인 토큰을 지우거나 눌러서 분산을 줄인다는 점을 보라.

At zero drift every curve on the left sits at 0 — on the first minibatch ρ≡1\rho\equiv1 and no PPO clip can fire — except for the rules that look at the rollout engine (IcePop, V3.2’s sequence mask, the πθ/μ\pi_\theta/\mu bands of MiMo-V2.6 and GLM-5 agentic), which react to the engine mismatch even then. As drift grows, the curves separate by unit and bound: GSPO’s tiny sequence-level ε\varepsilon removes whole responses early; DAPO-style token clips remove a growing slice of tokens; CISPO and Kimi k1.5 remove nothing. On the right, the objectives that remove nothing pay with a lower effective sample size: a few tokens with large ρ\rho carry the step. There is no free lunch in this figure, only a choice of where to stand. Which point is right depends on how off-policy the data is, which is why the labs with the most asynchronous pipelines (MAI with rollouts up to 40 gradient steps stale, MiMo-V2.6 with staleness 4) use far wider bounds than the 0.2 of the textbook clip.

Implementing it

The block below writes eleven objectives the way their reports write them, as functions of the sampled tokens’ log-probs ℓ\ell, and differentiates them numerically. It then computes ww from the template with the slots filled in, and checks that the two agree. It is the strongest form of the claim “they are all one family”: not an analogy, the same numbers.

NumPy One template, eleven objectives: template weights vs finite differences
import numpy as np
rng = np.random.default_rng(0)

# ---- one synthetic group: G responses, per-token log-probs under four distributions ----
G, L_MAX = 6, 64
lens = np.array([12, 40, 20, 60, 8, 30])
r    = np.array([1., 0., 1., 0., 0., 1.])
seg  = np.repeat(np.arange(G), lens).astype(np.intp)   # response id of every token
N    = int(lens.sum())
l_old = np.log(rng.uniform(0.05, 0.95, N))             # log π_old (trainer, θ_old)
l_mu  = l_old + rng.normal(0, 0.15, N)                 # log μ     (rollout engine)
l_th  = l_old + rng.normal(0, 0.25, N)                 # log π_θ   (after a few updates)
l_ref = l_old + rng.normal(-0.05, 0.2, N)              # log π_ref

def adv(kind):
    m = r.mean()
    return {"std": (r - m) / (r.std() + 1e-6), "mean": r - m}[kind]

def seg_mean(x):                                       # per-response mean of a per-token array
    return np.bincount(seg, weights=x, minlength=G) / lens

def ppo(rho, A, lo, hi):                               # PPO clipped surrogate
    return np.minimum(rho * A, np.clip(rho, lo, hi) * A)

# ---- literal objectives J(ℓ) as the reports write them; ℓ = log π_θ of the sampled tokens.
# Quantities inside sg[·] and masks are evaluated at the sampled θ (l_th) and held fixed.
def J(l, name):
    rho = np.exp(l - l_old); k = np.exp(l_old - l_mu); A = adv("std")[seg]; A0 = adv("mean")[seg]
    if name == "GRPO":
        k3 = np.exp(l_ref - l) - (l_ref - l) - 1
        return seg_mean(ppo(rho, A, 0.8, 1.2) - 1e-3 * k3).mean()
    if name == "DAPO":    return ppo(rho, A, 0.8, 1.28).sum() / N
    if name == "Dr.GRPO": return ppo(rho, A0, 0.8, 1.2).sum() / (G * L_MAX)
    if name == "V3.2":
        M = ~((A0 < 0) & (seg_mean(l_mu - l_th)[seg] > 0.05))
        kl = rho * (np.exp(l_ref - l) - (l_ref - l) - 1)
        return seg_mean(ppo(rho, A0, 0.8, 1.2) * M - 1e-3 * kl).mean()
    if name == "GSPO":
        s = np.exp(seg_mean(l - l_old))
        return ppo(s, adv("std"), 1 - 3e-4, 1 + 4e-4).mean()
    if name == "k1.5":                                 # −(1/2τ)·mean_i (r − r̄ − τ log π/π_old)²
        tau = 0.1; X = np.bincount(seg, weights=l - l_old, minlength=G)
        return -((adv("mean") - tau * X) ** 2).mean() / (2 * tau)
    if name == "K2.5":
        tau = 0.05; lr0 = l_th - l_old; M = (lr0 > -0.3) & (lr0 < 0.3)
        return (M * rho * A0 - tau * (l - l_old) ** 2).sum() / N
    if name == "CISPO":
        w = np.clip(np.exp(l_th - l_old), 0, 2.0)
        return (w * A * l).sum() / N
    if name == "GLM-5":
        pop = np.where((k >= 0.5) & (k <= 2), k, 0.0)
        return seg_mean(pop * ppo(rho, A, 0.8, 1.28)).mean()
    if name == "Olmo 3":  return (np.minimum(k, 2.0) * ppo(rho, A0, 0.8, 1.272)).sum() / N
    if name == "MAI":
        keep = np.exp(l_th - l_old) <= 50
        return (keep * ppo(rho, A, 0.4, 1 / 0.4 + 1.0)).sum() / N
    raise ValueError(name)

# ---- the ONE template: w_{i,t} = c_i · [ g(ratio, A, clip/mask) · IS − regulariser ] ----
def template(name):
    rho = np.exp(l_th - l_old); k = np.exp(l_old - l_mu); A = adv("std")[seg]; A0 = adv("mean")[seg]
    inside = lambda R, A, lo, hi: np.where(A >= 0, R <= hi, R >= lo)   # PPO: is the gradient alive?
    c_seq, c_tok = 1 / (G * lens[seg]), 1 / N
    if name == "GRPO":    return c_seq * (inside(rho, A, .8, 1.2) * rho * A - 1e-3 * (1 - np.exp(l_ref - l_th)))
    if name == "DAPO":    return c_tok * inside(rho, A, .8, 1.28) * rho * A
    if name == "Dr.GRPO": return inside(rho, A0, .8, 1.2) * rho * A0 / (G * L_MAX)
    if name == "V3.2":
        M = ~((A0 < 0) & (seg_mean(l_mu - l_th)[seg] > 0.05))
        return c_seq * (M * inside(rho, A0, .8, 1.2) * rho * A0 - 1e-3 * rho * (l_th - l_ref))
    if name == "GSPO":
        s = np.exp(seg_mean(l_th - l_old)); a = adv("std")
        return (inside(s, a, 1 - 3e-4, 1 + 4e-4) * s * a / G)[seg] / lens[seg]
    if name == "k1.5":
        X = np.bincount(seg, weights=l_th - l_old, minlength=G)
        return ((adv("mean") - 0.1 * X) / G)[seg]
    if name == "K2.5":
        lr0 = l_th - l_old; M = (lr0 > -0.3) & (lr0 < 0.3)
        return c_tok * (M * rho * A0 - 2 * 0.05 * lr0)
    if name == "CISPO":   return c_tok * np.clip(rho, 0, 2.0) * A
    if name == "GLM-5":   return c_seq * np.where((k >= .5) & (k <= 2), k, 0) * inside(rho, A, .8, 1.28) * rho * A
    if name == "Olmo 3":  return c_tok * np.minimum(k, 2) * inside(rho, A0, .8, 1.272) * rho * A0
    if name == "MAI":     return c_tok * (rho <= 50) * inside(rho, A, .4, 1 / .4 + 1) * rho * A

def num_grad(name, h=1e-6):                            # ∂J/∂ℓ_t by central differences
    g = np.zeros(N)
    for t in range(N):
        e = np.zeros(N); e[t] = h
        g[t] = (J(l_th + e, name) - J(l_th - e, name)) / (2 * h)
    return g

print(f"{'objective':9s} {'rel. error':>11s} {'zeroed':>7s} {'Σw(A>0)':>9s} {'Σw(A<0)':>9s}")
for name in ["GRPO", "DAPO", "Dr.GRPO", "V3.2", "GSPO", "k1.5", "K2.5", "CISPO", "GLM-5", "Olmo 3", "MAI"]:
    w, g = template(name), num_grad(name)
    pos = r[seg] > r.mean()
    print(f"{name:9s} {np.abs(w - g).max() / np.abs(g).max():11.1e} {np.mean(np.abs(w) < 1e-12):7.2f}"
          f" {w[pos].sum():9.4f} {w[~pos].sum():9.4f}")
 

Every relative error is around 10−910^{-9}, i.e. finite-difference noise. Three things in the last columns are worth a second look. GRPO, V3.2 and K2.5 never show zeroed tokens even where their clip or mask fires, because the regulariser keeps a small gradient alive on every token; when you log a “clip fraction” for these objectives, log the policy-gradient part separately. GSPO zeroes 40% of tokens here because three responses are out of its 10−410^{-4}-wide band as whole units. And k1.5’s totals are an order of magnitude larger than the others: with no length normalisation, the sequence log-ratio and its gradient both scale with ∣yi∣\lvert y_i\rvert, so its learning rate lives on a different scale.

In a real trainer the same template becomes one loss function with switches. The version below takes the three log-prob tensors a modern RL stack has — current, recomputed old, and rollout-engine — and expresses every row of the table by its arguments.

PyTorch PyTorch: one configurable loss for the whole table 로컬에서 실행run locally (pip install torch)
import torch

def frontier_pg_loss(logp, old_logp, rollout_logp, adv, mask, *,
                     ratio="token",          # "token" | "seq_geo" (GSPO) | "rollout" (π_θ/μ directly)
                     clip="ppo",             # "ppo" | "dual" | "cispo" | "band" | "none"
                     eps_low=0.2, eps_high=0.28, dual_c=3.0, band=(0.5, 2.0),
                     is_corr="none",         # "none" | "tis" | "icepop"
                     tis_cap=2.0, icepop_band=(0.5, 2.0),
                     agg="token_mean",       # "token_mean" | "seq_mean" | "const"
                     L_max=None, ref_logp=None, kl="none", beta=0.0):
    """logp: (B,T) current policy with grad; old_logp: (B,T) trainer recompute at θ_old;
    rollout_logp: (B,T) sampler log-probs μ; adv: (B,) sequence advantage; mask: (B,T) 1 on model tokens."""
    m = mask.float()
    A = adv[:, None].expand_as(logp)
    if ratio == "seq_geo":                                        # GSPO: s_i = exp(mean_t log ρ_t)
        log_s = ((logp - old_logp) * m).sum(1, keepdim=True) / m.sum(1, keepdim=True).clamp(min=1)
        R = torch.exp(log_s).expand_as(logp)
    elif ratio == "rollout":                                      # MiMo-V2.6 / GLM-5 agentic
        R = torch.exp(logp - rollout_logp)
    else:
        R = torch.exp(logp - old_logp)

    if clip in ("ppo", "dual"):
        surr = torch.minimum(R * A, R.clamp(1 - eps_low, 1 + eps_high) * A)
        if clip == "dual":                                        # A<0: bound the loss at c·A
            surr = torch.where(A < 0, torch.maximum(surr, dual_c * A), surr)
    elif clip == "cispo":                                         # weight capped, gradient kept
        surr = R.clamp(max=1 + eps_high).detach() * A * logp
    elif clip == "band":                                          # zero outside the band, either sign
        keep = ((R >= band[0]) & (R <= band[1])).float().detach()
        surr = keep * R.detach() * A * logp
    else:
        surr = R * A

    k = torch.exp(old_logp - rollout_logp).detach()               # engine ratio π_old/μ
    if is_corr == "tis":
        surr = k.clamp(max=tis_cap) * surr
    elif is_corr == "icepop":
        surr = torch.where((k >= icepop_band[0]) & (k <= icepop_band[1]), k, torch.zeros_like(k)) * surr

    per_tok = -surr
    if kl != "none":
        log_r = ref_logp - logp                                   # log π_ref/π_θ
        k3 = torch.exp(log_r) - log_r - 1
        if kl == "k3_is":                                         # DeepSeek-V3.2: ρ·k3, unbiased
            k3 = torch.exp(logp - old_logp) * k3
        per_tok = per_tok + beta * k3

    if agg == "seq_mean":
        return ((per_tok * m).sum(1) / m.sum(1).clamp(min=1)).mean()
    if agg == "const":
        return (per_tok * m).sum() / (m.shape[0] * L_max)
    return (per_tok * m).sum() / m.sum().clamp(min=1)            # token mean; all-reduce m.sum() under DP
 

Two details matter in practice. Under data parallelism, m.sum() in the token-mean must be the global token count (MAI defines its normaliser over the global batch); dividing by each rank’s local count silently reweights ranks with short responses. And the "rollout" ratio uses the sampler’s log-probs directly, which saves the recompute pass but means one ratio carries the update, staleness and engine noise at once — the reason GLM-5 says its band must be tight.

확인 문제Check yourself

A new paper proposes the loss −(1/Σ|y|) Σ sg[min(ρ, 2)]·A·log π. Which row of the table is it?

Its per-token weight is w=min⁡(ρ,2) A^/∑j∣yj∣w = \min(\rho, 2)\,\hat A / \sum_j\lvert y_j\rvert: token-mean aggregation, the policy ratio ρ=πθ/πold\rho=\pi_\theta/\pi_{\text{old}} capped at 1+εh=21+\varepsilon_h=2, gradient never zeroed. That is CISPO. Olmo’s TIS cap of 2 applies to the engine ratio πold/μ\pi_{\text{old}}/\mu and is multiplied with a PPO clip that does zero gradients; DAPO zeroes tokens with ρ>1.28\rho > 1.28 when A^>0\hat A>0.

확인 문제Check yourself

In the figure, why does GSPO zero whole responses while DAPO zeroes scattered tokens?

GSPO computes si=exp⁡(1∣yi∣∑tlog⁡ρi,t)s_i = \exp\big(\frac{1}{\lvert y_i\rvert}\sum_t\log\rho_{i,t}\big) and clips it, so the in/out decision is made once per response and every token of the response shares the weight siA^i/(G∣yi∣)s_i\hat A_i/(G\lvert y_i\rvert). Its ε\varepsilon is much smaller (3×10−43\times10^{-4}) because the geometric mean has a far smaller spread than single-token ratios.

Summary

  • For a fixed batch, any LLM policy-gradient objective is fully described by its per-token weight wi,t=∂J/∂ℓi,tw_{i,t}=\partial J/\partial\ell_{i,t}, and every frontier objective factors ww into aggregation × (ratio + clip/mask) × IS correction × advantage − regulariser.
  • PPO-style clips zero the gradient of a token; stop-gradient weights (CISPO, MiMo-V2.6, GLM-5 agentic) cap it instead. Masks (IcePop, V3.2, K2.5) zero it based on a different ratio or a different unit.
  • Across labs: std normalisation is fading, token-mean aggregation dominates, the reference KL has mostly been replaced by anchoring to πold\pi_{\text{old}}, and the design effort now goes into how the three gaps hidden in the ratio (update, staleness, engine mismatch) are clipped, corrected or masked.
  • Every clip or mask trades bias (tokens it refuses to learn from) for variance (tokens that would dominate the step); the right trade depends on how off-policy the data is.
  • The advantage slot is a baseline plus a scale: the baseline (group mean, leave-one-out, greedy, length-weighted, second-best, per-token) affects variance, the scale (group std, batch std, GPG’s rescale) changes which objective is optimised.
  • The template leaves out batch selection, rewards and systems fixes; those are the other half of stability.

이동이 0이면 왼쪽의 모든 곡선은 0이다. 첫 minibatch에서는 ρ≡1\rho\equiv1이라 PPO clip이 작동할 수 없다. rollout 엔진을 보는 규칙(IcePop, V3.2의 시퀀스 mask, MiMo-V2.6과 GLM-5 agentic의 πθ/μ\pi_\theta/\mu band)만 예외인데, 그때도 엔진 불일치에 반응한다. 이동이 커지면 곡선이 단위와 경계로 갈린다. GSPO의 아주 작은 시퀀스 단위 ε\varepsilon은 일찍부터 응답 전체를 지운다. DAPO 계열 토큰 clip은 점점 늘어나는 토큰 조각을 지운다. CISPO와 Kimi k1.5는 아무것도 지우지 않는다. 오른쪽을 보면, 아무것도 지우지 않는 목적함수는 낮은 effective sample size로 값을 치른다. ρ\rho가 큰 소수 토큰이 한 step을 끌고 간다. 이 그림에 공짜 점심은 없고 어디 설지 선택만 있다. 어느 점이 맞는지는 데이터가 얼마나 off-policy인지에 달렸다. 그래서 파이프라인이 가장 비동기적인 랩(rollout이 gradient step 40까지 stale한 MAI, staleness 4인 MiMo-V2.6)은 교과서 clip의 0.2보다 훨씬 넓은 경계를 쓴다.

구현

아래 블록은 열한 목적함수를 보고서가 쓴 그대로 샘플 토큰 log-prob ℓ\ell의 함수로 적고 수치 미분한다. 그리고 칸을 채운 틀로 ww를 계산해 둘이 같은지 확인한다. “모두 한 가족”이라는 주장의 가장 강한 형태다. 비유가 아니라 같은 숫자다.

NumPy 틀 하나, 목적함수 열하나: 틀의 가중치 vs 유한 차분
import numpy as np
rng = np.random.default_rng(0)

# ---- 합성 그룹 하나: 응답 G개, 네 분포 아래의 토큰별 log-prob ----
G, L_MAX = 6, 64
lens = np.array([12, 40, 20, 60, 8, 30])
r    = np.array([1., 0., 1., 0., 0., 1.])
seg  = np.repeat(np.arange(G), lens).astype(np.intp)   # 토큰마다 응답 번호
N    = int(lens.sum())
l_old = np.log(rng.uniform(0.05, 0.95, N))             # log π_old (학습기, θ_old)
l_mu  = l_old + rng.normal(0, 0.15, N)                 # log μ     (rollout 엔진)
l_th  = l_old + rng.normal(0, 0.25, N)                 # log π_θ   (몇 번 업데이트한 뒤)
l_ref = l_old + rng.normal(-0.05, 0.2, N)              # log π_ref

def adv(kind):
    m = r.mean()
    return {"std": (r - m) / (r.std() + 1e-6), "mean": r - m}[kind]

def seg_mean(x):                                       # 토큰 배열의 응답별 평균
    return np.bincount(seg, weights=x, minlength=G) / lens

def ppo(rho, A, lo, hi):                               # PPO clipped surrogate
    return np.minimum(rho * A, np.clip(rho, lo, hi) * A)

# ---- 보고서가 쓴 그대로의 목적함수 J(ℓ); ℓ = 샘플 토큰의 log π_θ.
# sg[·] 안의 값과 mask는 샘플 시점 θ(l_th)에서 계산해 고정한다.
def J(l, name):
    rho = np.exp(l - l_old); k = np.exp(l_old - l_mu); A = adv("std")[seg]; A0 = adv("mean")[seg]
    if name == "GRPO":
        k3 = np.exp(l_ref - l) - (l_ref - l) - 1
        return seg_mean(ppo(rho, A, 0.8, 1.2) - 1e-3 * k3).mean()
    if name == "DAPO":    return ppo(rho, A, 0.8, 1.28).sum() / N
    if name == "Dr.GRPO": return ppo(rho, A0, 0.8, 1.2).sum() / (G * L_MAX)
    if name == "V3.2":
        M = ~((A0 < 0) & (seg_mean(l_mu - l_th)[seg] > 0.05))
        kl = rho * (np.exp(l_ref - l) - (l_ref - l) - 1)
        return seg_mean(ppo(rho, A0, 0.8, 1.2) * M - 1e-3 * kl).mean()
    if name == "GSPO":
        s = np.exp(seg_mean(l - l_old))
        return ppo(s, adv("std"), 1 - 3e-4, 1 + 4e-4).mean()
    if name == "k1.5":                                 # −(1/2τ)·mean_i (r − r̄ − τ log π/π_old)²
        tau = 0.1; X = np.bincount(seg, weights=l - l_old, minlength=G)
        return -((adv("mean") - tau * X) ** 2).mean() / (2 * tau)
    if name == "K2.5":
        tau = 0.05; lr0 = l_th - l_old; M = (lr0 > -0.3) & (lr0 < 0.3)
        return (M * rho * A0 - tau * (l - l_old) ** 2).sum() / N
    if name == "CISPO":
        w = np.clip(np.exp(l_th - l_old), 0, 2.0)
        return (w * A * l).sum() / N
    if name == "GLM-5":
        pop = np.where((k >= 0.5) & (k <= 2), k, 0.0)
        return seg_mean(pop * ppo(rho, A, 0.8, 1.28)).mean()
    if name == "Olmo 3":  return (np.minimum(k, 2.0) * ppo(rho, A0, 0.8, 1.272)).sum() / N
    if name == "MAI":
        keep = np.exp(l_th - l_old) <= 50
        return (keep * ppo(rho, A, 0.4, 1 / 0.4 + 1.0)).sum() / N
    raise ValueError(name)

# ---- 하나의 틀: w_{i,t} = c_i · [ g(ratio, A, clip/mask) · IS − 정규화 항 ] ----
def template(name):
    rho = np.exp(l_th - l_old); k = np.exp(l_old - l_mu); A = adv("std")[seg]; A0 = adv("mean")[seg]
    inside = lambda R, A, lo, hi: np.where(A >= 0, R <= hi, R >= lo)   # PPO: gradient가 살아 있나?
    c_seq, c_tok = 1 / (G * lens[seg]), 1 / N
    if name == "GRPO":    return c_seq * (inside(rho, A, .8, 1.2) * rho * A - 1e-3 * (1 - np.exp(l_ref - l_th)))
    if name == "DAPO":    return c_tok * inside(rho, A, .8, 1.28) * rho * A
    if name == "Dr.GRPO": return inside(rho, A0, .8, 1.2) * rho * A0 / (G * L_MAX)
    if name == "V3.2":
        M = ~((A0 < 0) & (seg_mean(l_mu - l_th)[seg] > 0.05))
        return c_seq * (M * inside(rho, A0, .8, 1.2) * rho * A0 - 1e-3 * rho * (l_th - l_ref))
    if name == "GSPO":
        s = np.exp(seg_mean(l_th - l_old)); a = adv("std")
        return (inside(s, a, 1 - 3e-4, 1 + 4e-4) * s * a / G)[seg] / lens[seg]
    if name == "k1.5":
        X = np.bincount(seg, weights=l_th - l_old, minlength=G)
        return ((adv("mean") - 0.1 * X) / G)[seg]
    if name == "K2.5":
        lr0 = l_th - l_old; M = (lr0 > -0.3) & (lr0 < 0.3)
        return c_tok * (M * rho * A0 - 2 * 0.05 * lr0)
    if name == "CISPO":   return c_tok * np.clip(rho, 0, 2.0) * A
    if name == "GLM-5":   return c_seq * np.where((k >= .5) & (k <= 2), k, 0) * inside(rho, A, .8, 1.28) * rho * A
    if name == "Olmo 3":  return c_tok * np.minimum(k, 2) * inside(rho, A0, .8, 1.272) * rho * A0
    if name == "MAI":     return c_tok * (rho <= 50) * inside(rho, A, .4, 1 / .4 + 1) * rho * A

def num_grad(name, h=1e-6):                            # 중앙 차분으로 ∂J/∂ℓ_t
    g = np.zeros(N)
    for t in range(N):
        e = np.zeros(N); e[t] = h
        g[t] = (J(l_th + e, name) - J(l_th - e, name)) / (2 * h)
    return g

print(f"{'objective':9s} {'rel. error':>11s} {'zeroed':>7s} {'Σw(A>0)':>9s} {'Σw(A<0)':>9s}")
for name in ["GRPO", "DAPO", "Dr.GRPO", "V3.2", "GSPO", "k1.5", "K2.5", "CISPO", "GLM-5", "Olmo 3", "MAI"]:
    w, g = template(name), num_grad(name)
    pos = r[seg] > r.mean()
    print(f"{name:9s} {np.abs(w - g).max() / np.abs(g).max():11.1e} {np.mean(np.abs(w) < 1e-12):7.2f}"
          f" {w[pos].sum():9.4f} {w[~pos].sum():9.4f}")
 

모든 상대 오차가 10−910^{-9} 근처, 즉 유한 차분의 잡음이다. 마지막 열에서 세 가지를 다시 볼 만하다. GRPO, V3.2, K2.5는 clip이나 mask가 작동하는 곳에서도 0이 된 토큰이 없다. 정규화 항이 모든 토큰에 작은 gradient를 남기기 때문이다. 이런 목적함수의 “clip 비율”을 기록할 때는 policy-gradient 부분을 따로 기록하라. GSPO는 여기서 토큰의 40%를 0으로 만든다. 응답 셋이 폭 10−410^{-4}인 band 밖에 통째로 있기 때문이다. 그리고 k1.5의 합계는 다른 것보다 한 자릿수 크다. 길이 정규화가 없으니 시퀀스 log-ratio와 그 gradient가 모두 ∣yi∣\lvert y_i\rvert에 비례해 커지고, 학습률이 다른 눈금 위에 있게 된다.

실제 학습기에서는 같은 틀이 스위치 달린 손실 함수 하나가 된다. 아래 버전은 요즘 RL 스택이 가진 세 log-prob 텐서 — 현재, 다시 계산한 old, rollout 엔진 — 를 받아 표의 모든 행을 인자로 표현한다.

PyTorch PyTorch: 표 전체를 덮는 설정 가능한 손실 하나 로컬에서 실행run locally (pip install torch)
import torch

def frontier_pg_loss(logp, old_logp, rollout_logp, adv, mask, *,
                     ratio="token",          # "token" | "seq_geo" (GSPO) | "rollout" (π_θ/μ를 바로 사용)
                     clip="ppo",             # "ppo" | "dual" | "cispo" | "band" | "none"
                     eps_low=0.2, eps_high=0.28, dual_c=3.0, band=(0.5, 2.0),
                     is_corr="none",         # "none" | "tis" | "icepop"
                     tis_cap=2.0, icepop_band=(0.5, 2.0),
                     agg="token_mean",       # "token_mean" | "seq_mean" | "const"
                     L_max=None, ref_logp=None, kl="none", beta=0.0):
    """logp: (B,T) gradient가 흐르는 현재 정책; old_logp: (B,T) θ_old에서 학습기가 다시 계산;
    rollout_logp: (B,T) 샘플러 log-prob μ; adv: (B,) 시퀀스 advantage; mask: (B,T) 모델 토큰에 1."""
    m = mask.float()
    A = adv[:, None].expand_as(logp)
    if ratio == "seq_geo":                                        # GSPO: s_i = exp(mean_t log ρ_t)
        log_s = ((logp - old_logp) * m).sum(1, keepdim=True) / m.sum(1, keepdim=True).clamp(min=1)
        R = torch.exp(log_s).expand_as(logp)
    elif ratio == "rollout":                                      # MiMo-V2.6 / GLM-5 agentic
        R = torch.exp(logp - rollout_logp)
    else:
        R = torch.exp(logp - old_logp)

    if clip in ("ppo", "dual"):
        surr = torch.minimum(R * A, R.clamp(1 - eps_low, 1 + eps_high) * A)
        if clip == "dual":                                        # A<0: 손실을 c·A에서 막음
            surr = torch.where(A < 0, torch.maximum(surr, dual_c * A), surr)
    elif clip == "cispo":                                         # 가중치만 상한, gradient 유지
        surr = R.clamp(max=1 + eps_high).detach() * A * logp
    elif clip == "band":                                          # band 밖이면 부호와 무관하게 0
        keep = ((R >= band[0]) & (R <= band[1])).float().detach()
        surr = keep * R.detach() * A * logp
    else:
        surr = R * A

    k = torch.exp(old_logp - rollout_logp).detach()               # 엔진 ratio π_old/μ
    if is_corr == "tis":
        surr = k.clamp(max=tis_cap) * surr
    elif is_corr == "icepop":
        surr = torch.where((k >= icepop_band[0]) & (k <= icepop_band[1]), k, torch.zeros_like(k)) * surr

    per_tok = -surr
    if kl != "none":
        log_r = ref_logp - logp                                   # log π_ref/π_θ
        k3 = torch.exp(log_r) - log_r - 1
        if kl == "k3_is":                                         # DeepSeek-V3.2: ρ·k3, 편향 없음
            k3 = torch.exp(logp - old_logp) * k3
        per_tok = per_tok + beta * k3

    if agg == "seq_mean":
        return ((per_tok * m).sum(1) / m.sum(1).clamp(min=1)).mean()
    if agg == "const":
        return (per_tok * m).sum() / (m.shape[0] * L_max)
    return (per_tok * m).sum() / m.sum().clamp(min=1)            # token mean; DP에서는 m.sum()을 all-reduce
 

실전에서 중요한 세부 둘. Data parallel에서는 token-mean의 m.sum()이 전역 토큰 수여야 한다(MAI는 정규화 분모를 전역 배치로 정의한다). 랭크마다 자기 토큰 수로 나누면 짧은 응답을 가진 랭크의 가중치가 조용히 바뀐다. 그리고 "rollout" ratio는 샘플러의 log-prob을 바로 써서 재계산 패스를 아끼지만, ratio 하나가 업데이트, staleness, 엔진 잡음을 한꺼번에 싣는다. GLM-5가 band를 좁게 잡아야 한다고 말하는 이유다.

확인 문제Check yourself

새 논문이 −(1/Σ|y|) Σ sg[min(ρ, 2)]·A·log π 손실을 제안했다. 표의 어느 행인가?

토큰당 가중치는 w=min⁡(ρ,2) A^/∑j∣yj∣w = \min(\rho, 2)\,\hat A / \sum_j\lvert y_j\rvert다. token-mean 집계, 정책 ratio ρ=πθ/πold\rho=\pi_\theta/\pi_{\text{old}}를 1+εh=21+\varepsilon_h=2에서 상한, gradient는 결코 0이 되지 않는다. CISPO다. Olmo의 TIS 상한 2는 엔진 ratio πold/μ\pi_{\text{old}}/\mu에 걸리고, gradient를 0으로 만드는 PPO clip과 곱해진다. DAPO는 A^>0\hat A>0일 때 ρ>1.28\rho > 1.28인 토큰을 0으로 만든다.

확인 문제Check yourself

그림에서 GSPO는 응답 전체를 0으로 만들고 DAPO는 흩어진 토큰을 0으로 만드는 이유는?

GSPO는 si=exp⁡(1∣yi∣∑tlog⁡ρi,t)s_i = \exp\big(\frac{1}{\lvert y_i\rvert}\sum_t\log\rho_{i,t}\big)를 계산해 clip하므로, 안/밖 판정이 응답마다 한 번 내려지고 응답의 모든 토큰이 가중치 siA^i/(G∣yi∣)s_i\hat A_i/(G\lvert y_i\rvert)를 공유한다. 기하평균은 토큰 하나의 ratio보다 퍼짐이 훨씬 작기 때문에 ε\varepsilon은 훨씬 작다(3×10−43\times10^{-4}).

정리

  • 배치가 고정되면 LLM policy-gradient 목적함수는 토큰당 가중치 wi,t=∂J/∂ℓi,tw_{i,t}=\partial J/\partial\ell_{i,t}로 완전히 기술되고, 모든 프론티어 목적함수는 ww를 집계 × (ratio + clip/mask) × IS 보정 × advantage − 정규화 항으로 인수분해한다.
  • PPO식 clip은 토큰의 gradient를 0으로 만들고, stop-gradient 가중치(CISPO, MiMo-V2.6, GLM-5 agentic)는 크기만 누른다. Mask(IcePop, V3.2, K2.5)는 다른 ratio나 다른 단위를 기준으로 0으로 만든다.
  • 랩 전체로 보면 std 정규화는 사라지는 중이고, token-mean 집계가 우세하며, reference KL은 대부분 πold\pi_{\text{old}}에 묶는 것으로 바뀌었고, 설계의 노력은 ratio에 숨은 세 차이(업데이트, staleness, 엔진 불일치)를 어떻게 clip·보정·mask하느냐로 옮겨 갔다.
  • 모든 clip과 mask는 bias(배우기를 거부하는 토큰)를 내주고 variance(step을 좌우했을 토큰)를 산다. 맞는 교환은 데이터가 얼마나 off-policy인지에 달렸다.
  • Advantage 칸은 baseline과 크기다. baseline(그룹 평균, leave-one-out, greedy, 길이 가중, 두 번째 최고, 토큰별)은 분산에 영향을 주고, 크기(그룹 std, 배치 std, GPG의 재조정)는 최적화하는 목적함수를 바꾼다.
  • 틀은 배치 선택, 보상, 시스템 수정을 빼놓는다. 그것이 안정성의 나머지 절반이다.

더 읽을거리Further reading