Skip to main content

Paper breakdown

DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models

Zhihong Shao et al. · 2024 · arXiv preprint

Continues pretraining a 7B code model for 500B tokens, 56% of them from a 120B-token math corpus mined from Common Crawl, then introduces Group Relative Policy Optimization (GRPO): PPO without a value network, where each sampled answer is scored against the mean and standard deviation of a group of answers to the same question. The RL model reaches 51.7% top-1 on MATH without tools. The paper also writes SFT, RFT, DPO, PPO and GRPO as one gradient with method-specific coefficients.

Overview

Shao et al. (2024) is two papers in one. The first half builds the DeepSeekMath Corpus, 120B tokens of math web pages selected from Common Crawl, and uses it to continue pretraining DeepSeek-Coder-Base-v1.5 7B. The resulting DeepSeekMath-Base 7B scores 36.2% on the competition-level MATH benchmark with few-shot chain-of-thought prompting, above Minerva 540B at 33.6% (Table 2). The second half introduces Group Relative Policy Optimization (GRPO), the reinforcement-learning algorithm DeepSeek later used to train DeepSeek-R1.

GRPO is PPO with the value network removed. For each question the policy samples a group of GG outputs, a reward model scores them, and each output's advantage is its reward standardized within the group: A^i=(rimean(r))/std(r)\hat A_i = (r_i - \operatorname{mean}(\mathbf r)) / \operatorname{std}(\mathbf r). The clipped importance ratio from PPO stays. The KL anchor to the reference model moves out of the reward and into the loss, as a per-token estimator. The critic, typically a second network about the size of the policy, is gone. The price is GG samples per question, and the paper uses G=64G = 64.

Starting from DeepSeekMath-Instruct 7B and training only on chain-of-thought questions tied to GSM8K and MATH, GRPO raises MATH top-1 accuracy from 46.8% to 51.7% and GSM8K from 82.9% to 88.2%, both without tools (Table 5). The abstract reports 60.9% on MATH with self-consistency over 64 samples. For scale, Table 5 lists GPT-4 at 52.9% and Gemini Ultra at 53.2% on MATH.

The RL half also contains a conceptual contribution. Section 5.2 writes the parameter gradient of SFT, rejection-sampling fine-tuning (RFT), DPO, PPO and GRPO in one form, a per-token score function times a method-specific gradient coefficient. That form separates three design choices: where the training outputs come from, what supplies the reward, and how the reward becomes a coefficient. The same section reports that RL raised Maj@K accuracy but not Pass@K, a result later work re-tested at much larger KK.

Mathematical Contributions

The DeepSeekMath Corpus

Section 2.1 describes an iterative recall loop over Common Crawl.

  1. Train a fastText classifier with 500,000 OpenWebMath pages as positives and 500,000 random Common Crawl pages as negatives (vector dimension 256, learning rate 0.1, word n-grams up to length 3, minimum word count 3, 3 epochs).
  2. Score a URL-deduplicated and near-deduplicated Common Crawl of 40B HTML pages, rank pages by classifier score, and keep the top of the ranking. Pretraining runs on the top 40B, 80B, 120B and 160B tokens set the cutoff; the first iteration keeps 40B tokens.
  3. Split Common Crawl into domains (pages sharing a base URL). A domain with more than 10% of its pages already collected is labeled math-related, for example mathoverflow.net.
  4. Annotators mark the math URL paths inside those domains, for example mathoverflow.net/questions. Uncollected pages under those paths join the seed set, and the classifier is retrained.

After four iterations the corpus holds 35.5M pages and 120B tokens. The loop stopped because nearly 98% of the fourth iteration's data had already been collected in the third. Decontamination removes any text segment containing a 10-gram that matches a substring of benchmarks such as GSM8K, MATH, CMATH and AGIEval. Benchmark texts shorter than 10 grams but at least 3 grams long are filtered by exact matching.

Table 1 isolates corpus quality by training the same 1.3B DeepSeek-LLM for 150B tokens on each math corpus and evaluating with few-shot chain-of-thought prompting:

CorpusTokensGSM8KMATHCMATH
No math trainingn/a2.9%3.0%12.3%
MathPile8.9B2.7%3.3%1.2%
OpenWebMath13.6B11.5%8.9%16.8%
Proof-Pile-251.9B14.3%11.2%19.9%
DeepSeekMath Corpus120.2B23.8%13.6%41.5%

The corpus is mostly English and Chinese, which the paper uses to explain the CMATH gap. Section 5.1 adds two pretraining findings. Code training before math training raised math accuracy both with and without tool use (Table 6). Math training on arXiv-only corpora (MathPile and ArXiv-RedPajama) brought no notable improvement on the paper's benchmarks (Tables 8 and 9), a conclusion the authors restrict to the tasks, data mixtures and model scales they tested.

DeepSeekMath-Base 7B trains for 500B tokens: 56% DeepSeekMath Corpus, 4% AlgebraicStack, 10% arXiv, 20% GitHub code and 10% English and Chinese natural-language text (Section 2.3). Instruction tuning on 776K examples in chain-of-thought, program-of-thought and tool-integrated formats produces DeepSeekMath-Instruct 7B (Section 3), the starting point for RL.

PPO as the paper writes it

For a question qP(Q)q \sim P(Q) and an output oo sampled from the old policy, PPO maximizes (Equation 1)

JPPO(θ)=Eq,oπθold(Oq)[1ot=1omin(ρtAt,  clip(ρt,1ε,1+ε)At)],ρt=πθ(otq,o<t)πθold(otq,o<t).\mathcal{J}_{\mathrm{PPO}}(\theta) = \mathbb{E}_{q,\, o \sim \pi_{\theta_{\mathrm{old}}}(O \mid q)}\left[\frac{1}{|o|}\sum_{t=1}^{|o|} \min\Big(\rho_t A_t,\; \mathrm{clip}\big(\rho_t, 1-\varepsilon, 1+\varepsilon\big) A_t\Big)\right], \qquad \rho_t = \frac{\pi_\theta(o_t \mid q, o_{<t})}{\pi_{\theta_{\mathrm{old}}}(o_t \mid q, o_{<t})}.

The advantage AtA_t comes from Generalized Advantage Estimation (GAE) applied to the rewards rtr_{\ge t} and a learned value function VψV_\psi. To limit over-optimization of the reward model rφr_\varphi, the KL penalty to the reference model πref\pi_{\mathrm{ref}} (usually the SFT model) is folded into the per-token reward (Equation 2), following InstructGPT:

rt=rφ(q,ot)βlogπθ(otq,o<t)πref(otq,o<t).r_t = r_\varphi(q, o_{\le t}) - \beta \log \frac{\pi_\theta(o_t \mid q, o_{<t})}{\pi_{\mathrm{ref}}(o_t \mid q, o_{<t})}.

Section 4.1.1 raises two objections to the value function here. It is usually a network of size comparable to the policy, which costs memory and compute. And the reward model usually scores only the last token, which makes it hard to train a value function that is accurate at every token.

The GRPO objective

For each question GRPO samples o1,,oGo_1, \ldots, o_G from πθold\pi_{\theta_{\mathrm{old}}} and maximizes (Equation 3)

JGRPO(θ)=E[1Gi=1G1oit=1oi{min(ρi,tA^i,t,  clip(ρi,t,1ε,1+ε)A^i,t)βDKL[πθπref]}],\mathcal{J}_{\mathrm{GRPO}}(\theta) = \mathbb{E}\left[\frac{1}{G}\sum_{i=1}^{G} \frac{1}{|o_i|}\sum_{t=1}^{|o_i|} \Big\{ \min\Big(\rho_{i,t} \hat A_{i,t},\; \mathrm{clip}\big(\rho_{i,t}, 1-\varepsilon, 1+\varepsilon\big) \hat A_{i,t}\Big) - \beta\, \mathbb{D}_{\mathrm{KL}}\big[\pi_\theta \,\|\, \pi_{\mathrm{ref}}\big] \Big\}\right],

with the expectation over qP(Q)q \sim P(Q) and the group o1,,oGπθold(Oq)o_1, \ldots, o_G \sim \pi_{\theta_{\mathrm{old}}}(O \mid q), and ρi,t=πθ(oi,tq,oi,<t)/πθold(oi,tq,oi,<t)\rho_{i,t} = \pi_\theta(o_{i,t} \mid q, o_{i,<t}) / \pi_{\theta_{\mathrm{old}}}(o_{i,t} \mid q, o_{i,<t}). Three things differ from Equations 1 and 2: the average over GG outputs of the same question, an advantage A^i,t\hat A_{i,t} computed only from rewards inside the group, and a KL term placed in the objective instead of in the reward. The paper motivates the group-relative advantage by how reward models are trained, on comparisons between outputs for the same question. It moves the KL term to avoid complicating the computation of A^i,t\hat A_{i,t}.

In the reported run (Section 4.2) the reward model starts from DeepSeekMath-Base 7B and trains with learning rate 2×1052 \times 10^{-5} on data built following Math-Shepherd. The policy uses learning rate 10610^{-6}, KL coefficient β=0.04\beta = 0.04, G=64G = 64 samples per question, maximum length 1024 and batch size 1024, with a single policy update after each sampling stage. The RL questions are about 144K chain-of-thought-format questions related to GSM8K and MATH, taken from the SFT data.

The single update matters for the analysis below. Appendix A.1.5 uses it to drop the min and clip operations. With one step per sampling stage, πθold=πθ\pi_{\theta_{\mathrm{old}}} = \pi_\theta where the gradient is taken, so ρ=1\rho = 1 sits inside [1ε,1+ε][1-\varepsilon, 1+\varepsilon] and the clipped objective has the same gradient as ρA^\rho \hat A. The calculations on this page work in that regime.

Group-normalized advantages

With outcome supervision (Section 4.1.2) the reward model returns one score per output, r=(r1,,rG)\mathbf r = (r_1, \ldots, r_G), and every token of oio_i receives the same advantage:

A^i,t=r~i=rimean(r)std(r),t=1,,oi.\hat A_{i,t} = \tilde r_i = \frac{r_i - \operatorname{mean}(\mathbf r)}{\operatorname{std}(\mathbf r)}, \qquad t = 1, \ldots, |o_i|.

The advantages in a group sum to zero, so within each question GRPO raises the probability of above-average outputs and lowers the probability of below-average ones. The paper does not analyze two further consequences of this formula.

Ties. If all GG rewards are equal, the numerator and std(r)\operatorname{std}(\mathbf r) are both zero and the formula is undefined. Section 4.1.2 does not say how this case is handled. Under any convention that keeps the denominator positive, the advantage is zero and the question contributes only through the KL term. The paper's run uses real-valued reward-model scores. With a binary correctness reward, every all-correct or all-wrong group gives zero advantage. DAPO (Yu et al., 2025), whose rule-based reward is +1+1 when the predicted answer matches the ground truth and 1-1 otherwise, reports the number of prompts with accuracy 1 rising during training, and it oversamples so that every prompt in a batch has accuracy strictly between 0 and 1.

Per-question weight. Take 0/1 rewards, let p^\hat p be the fraction of correct outputs in the group, and read std\operatorname{std} as the population standard deviation over the GG rewards. Then std(r)=p^(1p^)\operatorname{std}(\mathbf r) = \sqrt{\hat p(1-\hat p)} and

A^correct=1p^p^,A^wrong=p^1p^.\hat A_{\text{correct}} = \sqrt{\frac{1-\hat p}{\hat p}}, \qquad \hat A_{\text{wrong}} = -\sqrt{\frac{\hat p}{1-\hat p}}.

At p^=1/2\hat p = 1/2 these are ±1\pm 1. At G=64G = 64 with one correct output, that output gets 637.94\sqrt{63} \approx 7.94 and each wrong output gets 1/630.126-1/\sqrt{63} \approx -0.126. Relative to plain mean-centering, the division multiplies the whole question's contribution by 1/p^(1p^)1/\sqrt{\hat p(1-\hat p)}. That factor is at least 2 and grows without bound as p^\hat p approaches 0 or 1, so questions the policy almost always or almost never solves get the largest weight. Liu et al. (2025) call this a question-level difficulty bias.

What the group mean estimates

This subsection is a derivation added on this page, not a result stated in the paper. Fix a question qq, drop the KL term (β=0\beta = 0) and the standard-deviation division, and work in the single-update regime, so each token contributes A^i,tθlogπθ(oi,tq,oi,<t)\hat A_{i,t}\, \nabla_\theta \log \pi_\theta(o_{i,t} \mid q, o_{i,<t}). The token gradients of output ii sum to θlogπθ(oiq)\nabla_\theta \log \pi_\theta(o_i \mid q), so the gradient estimate for qq is

g^=1Gi=1Grirˉoiθlogπθ(oiq),rˉ=1Gj=1Grj.\hat g = \frac{1}{G} \sum_{i=1}^{G} \frac{r_i - \bar r}{|o_i|}\, \nabla_\theta \log \pi_\theta(o_i \mid q), \qquad \bar r = \frac{1}{G}\sum_{j=1}^{G} r_j.

The group mean contains rir_i itself. Writing rˉi\bar r_{-i} for the mean of the other G1G - 1 rewards, one line of algebra gives

rirˉ=G1G(rirˉi).r_i - \bar r = \frac{G-1}{G}\,\big(r_i - \bar r_{-i}\big).

Mean-centering is therefore the REINFORCE leave-one-out (RLOO) baseline, which Ahmadian et al. (2024) credit to Kool et al. (2019), scaled by (G1)/G(G-1)/G. Let R(q,o)R(q, o) be the reward-model score and μ(q)=Eoπθ(q)[R(q,o)]\mu(q) = \mathbb{E}_{o \sim \pi_\theta(\cdot \mid q)}[R(q, o)]. The GG outputs are sampled independently, so rˉi\bar r_{-i} is independent of oio_i and has mean μ(q)\mu(q). Using that and E[f(o)θlogπθ(oq)]=θE[f(o)]\mathbb{E}[f(o)\, \nabla_\theta \log \pi_\theta(o \mid q)] = \nabla_\theta \mathbb{E}[f(o)] for any ff that does not depend on θ\theta (the score-function identity),

E[g^]=G1GθEoπθ(q) ⁣[R(q,o)co]evaluated at c=μ(q),\mathbb{E}[\hat g] = \frac{G-1}{G}\, \nabla_\theta\, \mathbb{E}_{o \sim \pi_\theta(\cdot \mid q)}\!\left[\frac{R(q, o) - c}{|o|}\right] \quad \text{evaluated at } c = \mu(q),

with cc held fixed during differentiation. Two readings follow.

  • If every output had the same length LL, then E[g^]=G1GLθμ(q)\mathbb{E}[\hat g] = \frac{G-1}{G L} \nabla_\theta \mu(q), an unbiased policy gradient up to a positive constant.
  • With variable lengths, the expected update increases E[(Rc)/o]\mathbb{E}[(R - c)/|o|]. For outputs scored above the current mean, shorter is better. For outputs scored below it, longer shrinks the penalty. Liu et al. (2025) identify this response-level length bias and remove both the 1/oi1/|o_i| and the standard-deviation normalizations in their Dr. GRPO variant.

Restoring the division by std(r)\operatorname{std}(\mathbf r) breaks the factorization, since the standard deviation depends on every output in the group, including oio_i.

The KL term

GRPO estimates the per-token KL with an estimator from Schulman (2020), given as Equation 4. Write λi,t=πref(oi,tq,oi,<t)/πθ(oi,tq,oi,<t)\lambda_{i,t} = \pi_{\mathrm{ref}}(o_{i,t} \mid q, o_{i,<t}) / \pi_\theta(o_{i,t} \mid q, o_{i,<t}). Then

DKL[πθπref]=λi,tlogλi,t1.\mathbb{D}_{\mathrm{KL}}\big[\pi_\theta \,\|\, \pi_{\mathrm{ref}}\big] = \lambda_{i,t} - \log \lambda_{i,t} - 1.

Fix a prefix h=(q,oi,<t)h = (q, o_{i,<t}) and draw a token aπθ(h)a \sim \pi_\theta(\cdot \mid h), writing λ\lambda for the ratio at aa. Two properties hold.

  • Nonnegative. Since logxx1\log x \le x - 1 for x>0x > 0, each term is at least 0, with equality only when the two policies give the sampled token the same probability.
  • Unbiased for KL(πθπref)\mathrm{KL}(\pi_\theta \,\|\, \pi_{\mathrm{ref}}). E[λ]=aπref(ah)=1\mathbb{E}[\lambda] = \sum_a \pi_{\mathrm{ref}}(a \mid h) = 1 whenever πθ(h)\pi_\theta(\cdot \mid h) puts positive mass on every token, which a softmax policy does, and E[logλ]=KL(πθ(h)πref(h))\mathbb{E}[-\log \lambda] = \mathrm{KL}\big(\pi_\theta(\cdot \mid h) \,\|\, \pi_{\mathrm{ref}}(\cdot \mid h)\big).

The gradient is a different object. Differentiating β(λlogλ1)-\beta(\lambda - \log\lambda - 1) through πθ\pi_\theta gives β(λ1)θlogπθ(ah)\beta(\lambda - 1)\, \nabla_\theta \log \pi_\theta(a \mid h), the second term of the paper's GRPO gradient coefficient (Equation 21). Averaging over aπθ(h)a \sim \pi_\theta(\cdot \mid h) and using aπθ(ah)θlogπθ(ah)=0\sum_a \pi_\theta(a \mid h)\, \nabla_\theta \log \pi_\theta(a \mid h) = 0:

Ea[β(λ1)θlogπθ(ah)]=βaπref(ah)θlogπθ(ah)=βθKL(πref(h)πθ(h)).\mathbb{E}_{a}\big[\beta(\lambda - 1)\, \nabla_\theta \log \pi_\theta(a \mid h)\big] = \beta \sum_a \pi_{\mathrm{ref}}(a \mid h)\, \nabla_\theta \log \pi_\theta(a \mid h) = -\beta\, \nabla_\theta\, \mathrm{KL}\big(\pi_{\mathrm{ref}}(\cdot \mid h) \,\|\, \pi_\theta(\cdot \mid h)\big).

At each visited prefix the term's expected gradient therefore reduces KL(πrefπθ)\mathrm{KL}(\pi_{\mathrm{ref}} \,\|\, \pi_\theta), the KL divergence with its arguments swapped, while its value estimates KL(πθπref)\mathrm{KL}(\pi_\theta \,\|\, \pi_{\mathrm{ref}}). This calculation, which is not in the paper, holds the prefix fixed and ignores how θ\theta changes which prefixes get sampled.

Process supervision and iterative RL

Section 4.1.3 replaces the outcome score with step scores from a process reward model, following Math-Shepherd (Wang et al., 2023). Output ii has KiK_i steps, step jj ends at token index(j)\mathrm{index}(j), and the process reward model gives it the score riindex(j)r_i^{\mathrm{index}(j)}. All step scores in the group form the set R\mathbf R. Each is standardized with mean(R)\operatorname{mean}(\mathbf R) and std(R)\operatorname{std}(\mathbf R), and a token's advantage is the sum of the standardized scores of the steps that end at or after it:

A^i,t=j: index(j)tr~iindex(j).\hat A_{i,t} = \sum_{j:\ \mathrm{index}(j) \ge t} \tilde r_i^{\,\mathrm{index}(j)}.

Section 4.1.4 and Algorithm 1 add an outer loop. Each iteration starts by setting the reference model to the current policy, then trains the policy with GRPO. After that, the reward model is trained further on data built from the policy's samples, with a replay mechanism that mixes in 10% historical data. The paper runs two iterations with the 7B model (Figure 6) and reports the largest gain in the first.

PPO and GRPO at a glance

PropertyPPO (Equations 1 and 2)GRPO (Equations 3 and 4)
Networks trained during RLPolicy and value modelPolicy only (iterative GRPO also retrains the reward model between iterations)
Frozen networks in a policy stepReference model, reward modelReference model, reward model
Outputs per questionOne in Equation 1GG per question (G=64G = 64 in the paper)
BaselineLearned value function VψV_\psi inside GAEMean reward of the group
Advantage scaleGAE outputDivided by the group standard deviation
Token credit for an outcome scoreGAE spreads the final reward using VψV_\psiEvery token of oio_i gets r~i\tilde r_i
KL to the reference modelPer-token penalty inside the rewardEstimator λlogλ1\lambda - \log \lambda - 1 added to the objective
Clipped importance ratioYesYes, same form

One gradient for six methods

Section 5.2.1 writes the gradient of a training method A\mathcal A as (Equation 5)

θJA(θ)=E(q,o)D[1ot=1oGCA(q,o,t,πrf)θlogπθ(otq,o<t)].\nabla_\theta \mathcal{J}_{\mathcal{A}}(\theta) = \mathbb{E}_{(q, o) \sim \mathcal{D}}\left[\frac{1}{|o|} \sum_{t=1}^{|o|} GC_{\mathcal{A}}(q, o, t, \pi_{rf})\, \nabla_\theta \log \pi_\theta(o_t \mid q, o_{<t})\right].

A method is fixed by three components: the data source D\mathcal D, the reward function πrf\pi_{rf}, and the algorithm that turns data and reward into the gradient coefficient GCAGC_{\mathcal A}. Appendix A.1 derives each row of Table 10, reproduced here with the coefficients written out (PsftP_{sft} is the SFT data distribution and πsft\pi_{sft} the SFT model):

MethodData sourceRewardGradient coefficient
SFTq,oPsft(Q,O)q, o \sim P_{sft}(Q, O)None (human-selected data)11
RFTqPsft(Q)q \sim P_{sft}(Q), oπsft(Oq)o \sim \pi_{sft}(O \mid q)RuleI(o)\mathbb{I}(o): 1 if the answer is correct, else 0
DPOqPsft(Q)q \sim P_{sft}(Q), o+,oπsft(Oq)o^+, o^- \sim \pi_{sft}(O \mid q)RuleEquation 14, below
Online RFTqPsft(Q)q \sim P_{sft}(Q), oπθ(Oq)o \sim \pi_\theta(O \mid q)RuleI(o)\mathbb{I}(o)
PPOqPsft(Q)q \sim P_{sft}(Q), oπθ(Oq)o \sim \pi_\theta(O \mid q)ModelAtA_t
GRPOqPsft(Q)q \sim P_{sft}(Q), o1,,oGπθ(Oq)o_1, \ldots, o_G \sim \pi_\theta(O \mid q)ModelA^i,t+β(πref/πθ1)\hat A_{i,t} + \beta(\pi_{\mathrm{ref}} / \pi_\theta - 1) at token oi,to_{i,t}

For DPO with a preferred output o+o^+ and a rejected output oo^-, Equation 14 gives

GCDPO=σ ⁣(βlogπθ(otq,o<t)πref(otq,o<t)βlogπθ(ot+q,o<t+)πref(ot+q,o<t+)),GC_{\mathrm{DPO}} = \sigma\!\left(\beta \log \frac{\pi_\theta(o^-_t \mid q, o^-_{<t})}{\pi_{\mathrm{ref}}(o^-_t \mid q, o^-_{<t})} - \beta \log \frac{\pi_\theta(o^+_t \mid q, o^+_{<t})}{\pi_{\mathrm{ref}}(o^+_t \mid q, o^+_{<t})}\right),

which multiplies +θlogπθ+\nabla_\theta \log \pi_\theta on tokens of o+o^+ and θlogπθ-\nabla_\theta \log \pi_\theta on tokens of oo^- (Equation 13). The appendix writes the DPO objective with log-ratios averaged over tokens (Equation 12). The DPO paper uses the sequence log-ratio, which is the sum over tokens. For PPO and GRPO the appendix assumes πθold=πθ\pi_{\theta_{\mathrm{old}}} = \pi_\theta, the single-update regime above, so each coefficient is an advantage plus, for GRPO, the KL term.

Read row by row, the table separates methods on two axes. SFT reinforces every token of a human-chosen output equally, RFT and Online RFT reinforce correct outputs and ignore incorrect ones, and PPO and GRPO assign signed, reward-dependent coefficients that push incorrect outputs down. RFT and DPO are offline (outputs sampled from the SFT model); Online RFT, PPO and GRPO are online (outputs sampled from the current policy).

What the ablations show

Figure 5 trains DeepSeekMath-Instruct 1.3B with RFT, Online RFT, GRPO with outcome supervision and GRPO with process supervision, and tracks GSM8K and MATH accuracy over training steps.

  • Online RFT matches RFT early and pulls ahead later. The paper's explanation is that the policy's samples drift away from the SFT model's as training proceeds, so offline data goes stale.
  • GRPO beats Online RFT. The paper attributes this to the coefficient. GRPO's (Equation 21) depends on the reward value and is negative for below-average outputs, while Online RFT's (Equation 10) is 1 for every correct output and 0 for every incorrect one.
  • GRPO with process supervision beats GRPO with outcome supervision.

These are single training curves on a 1.3B model and two benchmarks, drawn without error bands, and the curves are visibly noisy.

Maj@K rises, Pass@K does not

Pass@K counts a problem as solved if any of KK sampled answers is correct. Maj@K counts it as solved if the most frequent final answer among KK samples is correct. Figure 7 compares DeepSeekMath-Instruct 7B and DeepSeekMath-RL 7B at temperature 0.7 for KK from 1 to 64 on GSM8K and MATH. RL raises Maj@K at every KK. The RL gain in Pass@K disappears as KK grows. The two Pass@K curves start apart at K=1K = 1, where Pass@1 is single-sample accuracy, and meet by K=16K = 16 on MATH; on GSM8K the instruction-tuned model's curve crosses the RL model's and finishes above it at K=64K = 64. Section 5.2.2 reads this as follows: "it seems that the improvement is attributed to boosting the correct response from TopK rather than the enhancement of fundamental capabilities."

The mechanism is simple. Pass@K depends on which answers the model can produce within KK draws; Maj@K depends on which answer it produces most often. An update that moves probability onto correct answers the model already generates raises Maj@K and top-1 accuracy without enlarging the set of answers it can reach. The authors tie this to their setup, since RL used only questions from the SFT stage and plain nucleus sampling. Section 5.2.3 lists out-of-distribution prompts, tree-search decoding, reward models that generalize, and algorithms that tolerate noisy rewards as next steps. Yue et al. (2025) later ran the comparison at much larger KK across several RLVR-trained model families and found that base models reach higher pass@k than their RL-trained versions once kk is large.

What It Gets Right

The critic removal fits the reward structure. With one score per output, a per-token value function has to predict a terminal score from every prefix, which is the difficulty Section 4.1.1 names. For an outcome score with no per-token penalty, the value a critic must learn at the first token is μ(q)\mu(q), the expected reward for the question, and the group mean is a Monte Carlo estimate of it. GRPO gives up the per-token baselines a critic would supply beyond that point. In exchange it needs no second network, and the derivation above shows its baseline is the leave-one-out baseline up to a constant factor.

The data claim is measured where it can be isolated. Table 1 trains the same 1.3B model for the same 150B tokens on four corpora and compares them on eight benchmarks. Table 2 is weaker evidence for data quality. Its 7B model scores 36.2% on MATH against 33.6% for Minerva 540B, a model 77 times larger, but it starts from a code model and trains on a 500B-token mixture that is 56% the new corpus, so the gap does not isolate the data. The negative arXiv result comes with its limits stated.

The unified gradient turns vague comparisons into specific ones. RFT and Online RFT differ in one component, the source of the sampled outputs. Online RFT and GRPO both sample from the current policy but differ in the reward source (a correctness rule or a trained reward model) and in the coefficient (a 0/1 indicator or a signed advantage). Figure 5 runs these methods on one 1.3B model, so it isolates the sampling choice and, as noted below, bundles the other two.

The paper reports a result that limits its own method. Figure 7 shows RL sharpening the output distribution rather than widening what the model can solve, and Section 5.2.2 says so directly.

Common Misconceptions

GRPO removes the reward model. It removes the value model. The paper's GRPO scores outputs with a trained reward model (Algorithm 1, Section 4.2), and iterative GRPO keeps retraining it. DeepSeek-R1-Zero later paired GRPO with rule-based rewards and no neural reward model (DeepSeek-R1, Section 2.2.2 of the first arXiv version).

GRPO is PPO minus the critic and nothing else. Three other changes come with it: advantages are divided by the group standard deviation, the KL anchor moves from the reward to the loss with a different estimator, and with outcome rewards every token of an output gets the same advantage. The standard-deviation division, together with the 1/oi1/|o_i| average, produces the difficulty and length weightings derived above. See the comparison page for how the group baseline changes gradient dynamics.

The KL term's gradient is the gradient of KL(πθπref)\mathrm{KL}(\pi_\theta \| \pi_{\mathrm{ref}}). Its value is an unbiased estimate of that quantity. Treated as the loss β(λlogλ1)\beta(\lambda - \log\lambda - 1), its expected gradient at each visited prefix is βθKL(πrefπθ)\beta\, \nabla_\theta \mathrm{KL}(\pi_{\mathrm{ref}} \| \pi_\theta). DAPO drops the term altogether for long chain-of-thought training, on the grounds that the policy is expected to move far from the initial model.

RL taught the model to solve new problems. The paper's own evidence points the other way. The Pass@K gain vanished at large KK while Maj@K rose at every KK, and Section 5.2.2 attributes the gain to moving probability onto correct answers already among the model's top samples.

Figure 5 isolates the effect of negative coefficients. Going from Online RFT to GRPO changes the coefficient and the reward source at once. Online RFT uses a correctness rule, while GRPO uses a reward model trained on rule judgments (Section 5.2.1). The figure does not separate the two.

Connections to TheoremPath Topics

Further Reading

  • Liu, Z., Chen, C., Li, W., Qi, P., Pang, T., Du, C., et al. (2025). "Understanding R1-Zero-Like Training: A Critical Perspective." COLM 2025. arXiv:2503.20783. Names GRPO's response-length and question-difficulty biases and proposes Dr. GRPO, which removes both normalizations.
  • Yu, Q., Zhang, Z., Zhu, R., et al. (2025). "DAPO: An Open-Source LLM Reinforcement Learning System at Scale." arXiv:2503.14476. A GRPO-derived recipe with decoupled clip ranges, dynamic sampling, a token-level loss, overlong reward shaping and no KL term.
  • Zheng, C., Liu, S., Li, M., et al. (2025). "Group Sequence Policy Optimization." arXiv:2507.18071. Replaces GRPO's token-level importance ratios with a sequence-level ratio and sequence-level clipping.
  • Yue, Y., Chen, Z., Lu, R., et al. (2025). "Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?" NeurIPS 2025. arXiv:2504.13837. Re-tests the Pass@K observation at large kk across model families, RL algorithms and benchmarks.
  • Ahmadian, A., Cremer, C., Gallé, M., et al. (2024). "Back to Basics: Revisiting REINFORCE Style Optimization for Learning from Human Feedback in LLMs." arXiv:2402.14740. The leave-one-out baseline that mean-centering matches up to a factor (G1)/G(G-1)/G.
  • DeepSeek-AI (2025). "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning." arXiv:2501.12948. Trains DeepSeek-R1-Zero from DeepSeek-V3-Base with GRPO and rule-based rewards, then reuses the same RL process for DeepSeek-R1 after a cold-start fine-tuning stage.

References

Canonical:

  • Shao, Z., Wang, P., Zhu, Q., Xu, R., Song, J., Bi, X., Zhang, H., Zhang, M., Li, Y. K., Wu, Y., & Guo, D. (2024). "DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models." arXiv:2402.03300. Section, table and equation numbers on this page follow v3 (27 April 2024). Code and models: github.com/deepseek-ai/DeepSeek-Math.

Direct precursors:

  • Schulman, J., Wolski, F., Dhariwal, P., Radford, A., & Klimov, O. (2017). "Proximal Policy Optimization Algorithms." arXiv:1707.06347. The clipped surrogate in Equations 1 and 3.
  • Schulman, J., Moritz, P., Levine, S., Jordan, M., & Abbeel, P. (2015). "High-Dimensional Continuous Control Using Generalized Advantage Estimation." arXiv:1506.02438. GAE, the advantage estimator GRPO replaces.
  • Ouyang, L. et al. (2022). "Training language models to follow instructions with human feedback." NeurIPS 2022. arXiv:2203.02155. The per-token KL penalty in Equation 2.
  • Wang, P., Li, L., Shao, Z., et al. (2023). "Math-Shepherd: Verify and Reinforce LLMs Step-by-step without Human Annotations." arXiv:2312.08935. The recipe the paper follows to build its reward-model training set, and the source of its process supervision setup.
  • Yuan, Z., Yuan, H., Li, C., et al. (2023). "Scaling Relationship on Learning Mathematical Reasoning with Large Language Models." arXiv:2308.01825. Rejection-sampling fine-tuning (RFT).
  • Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C. D., & Finn, C. (2023). "Direct Preference Optimization: Your Language Model is Secretly a Reward Model." NeurIPS 2023. arXiv:2305.18290.
  • Schulman, J. (2020). "Approximating KL Divergence." Blog post, joschu.net/blog/kl-approx.html. The estimator in Equation 4.

Data and evaluation:

  • Paster, K., Dos Santos, M., Azerbayev, Z., & Ba, J. (2023). "OpenWebMath: An Open Dataset of High-Quality Mathematical Web Text." arXiv:2310.06786. The seed corpus.
  • Joulin, A., Grave, E., Bojanowski, P., Douze, M., Jégou, H., & Mikolov, T. (2016). "FastText.zip: Compressing text classification models." arXiv:1612.03651. The classifier library cited for the recall step.
  • Azerbayev, Z. et al. (2023). "Llemma: An Open Language Model For Mathematics." arXiv:2310.10631. Proof-Pile-2 and the Llemma baselines.
  • Lewkowycz, A. et al. (2022). "Solving Quantitative Reasoning Problems with Language Models." NeurIPS 2022. arXiv:2206.14858. Minerva.
  • Hendrycks, D. et al. (2021). "Measuring Mathematical Problem Solving With the MATH Dataset." arXiv:2103.03874.
  • Cobbe, K. et al. (2021). "Training Verifiers to Solve Math Word Problems." arXiv:2110.14168. GSM8K.
  • Wang, X., Wei, J., Schuurmans, D., et al. (2022). "Self-Consistency Improves Chain of Thought Reasoning in Language Models." arXiv:2203.11171. Majority voting over sampled answers, the procedure behind Maj@K.

Follow-up work:

  • DeepSeek-AI (2025). "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning." arXiv:2501.12948. A revised version appeared in Nature 645, 633-638 (2025).
  • Liu, Z. et al. (2025). "Understanding R1-Zero-Like Training: A Critical Perspective." COLM 2025. arXiv:2503.20783.
  • Yu, Q. et al. (2025). "DAPO: An Open-Source LLM Reinforcement Learning System at Scale." arXiv:2503.14476.
  • Zheng, C. et al. (2025). "Group Sequence Policy Optimization." arXiv:2507.18071.
  • Yue, Y. et al. (2025). "Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?" NeurIPS 2025. arXiv:2504.13837.
  • Ahmadian, A. et al. (2024). "Back to Basics: Revisiting REINFORCE Style Optimization for Learning from Human Feedback in LLMs." arXiv:2402.14740.

Textbook:

  • Sutton, R. S., & Barto, A. G. (2018). Reinforcement Learning: An Introduction (2nd ed.). MIT Press. Chapter 13, Sections 13.3 (REINFORCE), 13.4 (REINFORCE with Baseline) and 13.5 (Actor-Critic Methods).

Connected topics

Last reviewed: September 19, 2026