Skip to content

Group Sequence Policy Optimization

Skip →Missing old logits (async agentic RL)
RL stage 2 #3extendedfrontierpaperrubric 8/122025 · ~25 min

Chujie Zheng, Shixuan Liu, Mingze Li, … Junyang Lin

Status

TL;DR. GSPO (from the Qwen team) changes one thing in GRPO: the importance ratio. Instead of a ratio per token, it uses one ratio per response, the geometric mean of the token ratios, and clips whole responses. The paper argues per-token ratios are noisy single-sample weights that build up over long answers and destabilize training, especially for Mixture-of-Experts (MoE) models whose routing changes between updates. It reports more stable and more efficient training than GRPO, and says GSPO was used to train Qwen3.

GRPO multiplies each token’s gradient by its own ratio wi,t=πθ(yi,t)/πold(yi,t)w_{i,t}=\pi_\theta(y_{i,t})/\pi_{\text{old}}(y_{i,t}) and clips it per token. GSPO replaces this with a sequence ratio, normalized by length so responses of different lengths share one clip range:

si(θ)=(πθ(yi∣x)πold(yi∣x))1/∣yi∣=exp⁡ ⁣(1∣yi∣∑tlog⁡πθ(yi,t∣x,yi,<t)πold(yi,t∣x,yi,<t)),s_i(\theta)=\left(\frac{\pi_\theta(y_i\mid x)}{\pi_{\text{old}}(y_i\mid x)}\right)^{1/|y_i|} =\exp\!\Big(\frac{1}{|y_i|}\sum_{t}\log\frac{\pi_\theta(y_{i,t}\mid x,y_{i,\lt t})}{\pi_{\text{old}}(y_{i,t}\mid x,y_{i,\lt t})}\Big), JGSPO=E[1G∑i=1Gmin⁡(siA^i, clip⁡(si,1−ε,1+ε)A^i)],\mathcal J_{\text{GSPO}}=\mathbb E\Big[\frac1G\sum_{i=1}^{G}\min\big(s_i\hat A_i,\ \operatorname{clip}(s_i,1-\varepsilon,1+\varepsilon)\hat A_i\big)\Big],

with the usual group advantage A^i=(ri−mean⁡)/std⁡\hat A_i=(r_i-\operatorname{mean})/\operatorname{std}. The gradient (eq. 10) is siA^i⋅1∣yi∣∑t∇log⁡πθ(yi,t)s_i\hat A_i\cdot\frac{1}{|y_i|}\sum_t\nabla\log\pi_\theta(y_{i,t}): every token in a response gets the same weight sis_i, where GRPO gives each token its own wi,tw_{i,t}.

A small example. Token ratios [1.10,0.95,1.02,0.90][1.10, 0.95, 1.02, 0.90] give a mean log-ratio of −0.0104-0.0104 and s≈0.990s\approx0.990. GRPO’s per-token clip at (0.8,1.27)(0.8, 1.27) clips nothing here, but each token is weighted differently. GSPO’s clip range is (1−3×10−4, 1+4×10−4)(1-3\times10^{-4},\,1+4\times10^{-4}), several hundred times narrower, because a geometric mean stays very close to 1. With a negative advantage this response is already below the lower bound, so it is clipped as a whole. A single token whose probability triples (for example after an MoE routing change) moves ss of a 1,000-token answer by only about 0.1%.

GSPO-token. For settings like multi-turn RL that need per-token advantages, si,t=sg⁡[si]⋅πθ(yi,t)/sg⁡[πθ(yi,t)]s_{i,t}=\operatorname{sg}[s_i]\cdot\pi_\theta(y_{i,t})/\operatorname{sg}[\pi_\theta(y_{i,t})] (sg⁡\operatorname{sg} is stop-gradient). Its value equals sis_i, and with equal advantages it is identical to GSPO.

Results. The paper trains a cold-start model fine-tuned from Qwen3-30B-A3B-Base, with each rollout batch split into four minibatches, against a tuned GRPO baseline (clip 0.2 / 0.27, with Routing Replay). It reports training curves only: GSPO trains stably and reaches higher training reward, AIME24 avg@32, LiveCodeBench and CodeForces Elo at the same compute (Fig. 1). It also argues that sequence likelihoods tolerate small precision differences between training and inference engines, so likelihoods from the inference engine could be used directly. There are no tables, seeds or code, and the main experiment is one MoE model, so the size of the gain on dense models is not established. The claim that GSPO powers Qwen3 is the authors’ own.

  • The objective it modifies: DeepSeekMath / GRPO, and the clipped ratio from PPO.
  • Other GRPO fixes that keep token-level ratios: DAPO (clip-higher, token-level loss) and Dr. GRPO (removing the length and std normalizations).
  • A different route to stability on long answers, with a critic: VAPO.
  • Token-level entropy control, the opposite granularity: The Entropy Mechanism.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    A 4-token response has token ratios π_θ/π_old of 1.10, 0.95, 1.02 and 0.90. Compute the GSPO sequence ratio s. With GSPO's clip range (1 − 3e-4, 1 + 4e-4), say whether the response is clipped when its advantage is positive and when it is negative. Then compare with GRPO's per-token clip at (0.8, 1.27).

    What a strong answer covers
    • Log-ratios ≈ 0.095, −0.051, 0.020, −0.105; mean ≈ −0.0104; s = exp(−0.0104) ≈ 0.990.
    • s is below 1 − 3e-4. For A > 0, min(s·A, clip(s)·A) = s·A, so the response still gets gradient (the clip only stops ratios that already moved in the advantage's direction). For A < 0, the clipped term is the min, so the whole response gets no gradient.
    • Under GRPO every token ratio lies inside (0.8, 1.27), so no token is clipped, but each token's gradient is weighted by its own ratio (0.90 to 1.10).
    • Because s is a geometric mean, it stays very close to 1, which is why GSPO's clip range is several hundred times narrower than GRPO's.
  2. Mechanism

    Explain the paper's argument that a per-token importance ratio does not correct for off-policy data, and why this matters more for Mixture-of-Experts models and long responses. Why does a sequence-level ratio help?

    What a strong answer covers
    • Importance sampling corrects a distribution mismatch by averaging weights over many samples from the behavior distribution; GRPO uses one sampled token per next-token distribution, so each weight is a single noisy draw rather than a correction.
    • The token weights multiply each token's gradient and the noise adds up over thousands of tokens; the paper reports collapses it could not recover from by reverting checkpoints.
    • In Qwen3-30B-A3B about 10% of activated experts change after each update, so individual token probabilities jump and token ratios swing; GRPO needed Routing Replay (reusing old routing) to converge.
    • The reward is given per sequence, so GSPO uses the sequence likelihood ratio, length-normalized: one token's jump of ×3 in a 1,000-token answer changes s by only about 0.1%. All tokens of a response then get the same weight s.
  3. Critique

    What evidence does the paper give that GSPO is better than GRPO, and what would you need to see before switching a dense-model RL pipeline to it?

    What a strong answer covers
    • Evidence is training curves for one cold-start Qwen3-30B-A3B model (AIME24, LiveCodeBench, CodeForces) and a statement that GSPO was used for Qwen3; no tables, seeds or open code.
    • The GRPO baseline needs Routing Replay for MoE, so part of the gain is specific to MoE routing; dense models do not have this problem.
    • GSPO clips about 100× more tokens yet is reported as more efficient; this is suggestive but does not separate the effect of the ratio from the effect of the clip range.
    • The gradient still has a 1/|y| factor per response (eq. 10), so the length weighting that Dr. GRPO and DAPO discuss is unchanged.
    • Before switching: same-compute comparisons on a dense model with several seeds, against DAPO-style token-level baselines, plus the clip fraction and length curves.

Done with this page?

Status