Skip to content

DAPO: An Open-Source LLM Reinforcement Learning System at Scale

Skip →Rubrics as Rewards (RaR)
main track #11corefrontierpaperrubric 11/122025 · ~45 min

Qiying Yu, Zheng Zhang, Ruofei Zhu, … Mingxuan Wang

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

Status

TL;DR. DAPO is a recipe and an open system for long chain-of-thought RL, built from a plain GRPO baseline that scored 30 on AIME 2024 with Qwen2.5-32B. Four changes bring it to 50: an asymmetric clip range (clip-higher), dynamic sampling that drops groups with no learning signal, a token-level loss average, and overlong reward shaping for truncated answers. The paper reports beating DeepSeek’s RL result on the same base model (47) with half the training steps.

Why it matters now. DAPO is the most common “GRPO plus fixes” baseline in open RLVR work, and each fix is a reusable idea for any RL-trained agent. If you train a search agent whose trajectories vary from a few hundred to tens of thousands of tokens, you will face the same four questions: how far rare actions may move, what to do with prompts that are always or never solved, how to average over unequal lengths, and how to treat running out of budget.

DAPO starts from the GRPO setup. It keeps the group advantage A^i=(Ri−mean⁡)/std⁡\hat A_i = (R_i-\operatorname{mean})/\operatorname{std}, uses a rule-based reward of +1+1 if the final answer matches and −1-1 otherwise, and removes the KL term. The paper argues that long-CoT training is meant to move far from the initial model. The objective (eq. 8) is:

JDAPO=E[1∑i=1G∣oi∣∑i=1G∑t=1∣oi∣min⁡(ρi,tA^i, clip⁡(ρi,t, 1−εlow, 1+εhigh)A^i)]s.t.0<∣{oi: correct}∣<G.\mathcal J_{\text{DAPO}} = \mathbb E\Bigg[\frac{1}{\sum_{i=1}^{G}|o_i|}\sum_{i=1}^{G}\sum_{t=1}^{|o_i|}\min\Big(\rho_{i,t}\hat A_{i},\ \operatorname{clip}\big(\rho_{i,t},\,1-\varepsilon_{\text{low}},\,1+\varepsilon_{\text{high}}\big)\hat A_{i}\Big)\Bigg] \quad\text{s.t.}\quad 0\lt\big|\{o_i:\ \text{correct}\}\big|\lt G .

Each part of this equation is one of the four changes.

1. Clip-higher (εlow=0.2\varepsilon_{\text{low}}=0.2, εhigh=0.28\varepsilon_{\text{high}}=0.28). For positive advantage, this sample’s surrogate stops rewarding further increases once its ratio exceeds 1+εhigh1+\varepsilon_{\text{high}}, that is, once the token’s probability passes πold(1+εhigh)\pi_\text{old}(1+\varepsilon_{\text{high}}). This is not a hard cap on the new probability: a gradient step can overshoot, and other samples sharing parameters can still move a clipped token (see the PPO page). The examples below are incentive cutoffs, not guaranteed maximum probabilities. The cutoff is very uneven across tokens. For a token at 0.90.9 it sits at 1.081.08, which never binds. For a rare token at 0.010.01 the incentive stops at 0.0120.012. The paper finds that the tokens hitting the upper clip have low probability (below 0.2 on average). So the clip mostly stops rare “exploration” tokens from growing, and the policy’s entropy collapses early. Raising only the upper bound gives rare tokens more room. The lower bound stays at 0.2, because a larger one would let negative updates drive rare tokens to zero. The clip only acts because DAPO takes 16 gradient steps per rollout. With one step, the ratio is 1 (see the GRPO page).

2. Dynamic sampling. The constraint on the right of the equation keeps only groups that are neither all right nor all wrong. In the running example, a group with rewards [1,1,1,1][1,1,1,1] or [0,0,0,0][0,0,0,0] has zero std and zero advantage, so it contributes nothing. As training goes on, more prompts are always solved, so the useful part of each batch shrinks and the gradient gets noisier. DAPO keeps sampling until the batch holds NN useful prompts. The cost is extra generation per step; the paper reports reaching the same accuracy in fewer steps.

3. Token-level loss. GRPO averages token losses within each answer and then over answers, so every answer counts equally. DAPO divides the sum of all token losses by the total number of tokens in the group, so every token counts equally. The paper’s reason is practical: very long answers often contain gibberish and repetition. Under per-answer averaging those tokens are diluted and barely penalized, and entropy and length grow unhealthily (Fig. 4). This is the same per-response length weighting that Dr. GRPO calls a bias. The two papers fix it differently: DAPO divides by the group’s token count, while Dr. GRPO divides by a constant and also drops the std.

4. Overlong reward shaping. Answers longer than the generation limit are cut off. Giving a cut-off answer the “wrong” reward punishes sound reasoning just for being long, which adds reward noise. DAPO first tried overlong filtering, which masks truncated answers out of the loss. It then added a soft overlong punishment on top of the correctness reward:

Rlength(y)={0,∣y∣≤Lmax⁡−Lcache(Lmax⁡−Lcache)−∣y∣Lcache,Lmax⁡−Lcache<∣y∣≤Lmax⁡−1,∣y∣>Lmax⁡R_{\text{length}}(y)=\begin{cases}0, & |y|\le L_{\max}-L_{\text{cache}}\\[2pt] \dfrac{(L_{\max}-L_{\text{cache}})-|y|}{L_{\text{cache}}}, & L_{\max}-L_{\text{cache}}<|y|\le L_{\max}\\[4pt] -1, & |y|>L_{\max}\end{cases}

with Lmax⁡=20,480L_{\max}=20{,}480 and Lcache=4,096L_{\text{cache}}=4{,}096. A correct answer of 18,432 tokens gets 1−0.5=0.51-0.5=0.5. One that hits the limit gets 1−1=01-1=0.

DAPO's four changes to the GRPO recipe and their cumulative effect Four panels. Clip-higher: with a positive advantage the surrogate stops rewarding increases once the new probability passes the old probability times one plus epsilon-high; this is an incentive cutoff, not a hard cap. For a token with old probability 0.01 the cutoff moves from 0.012 to 0.0128; for a token at 0.9 the cutoff of 1.08 never binds, so the change mainly helps rare tokens. The lower epsilon stays at 0.2. Dynamic sampling: four example groups of four answers; the all-correct and all-wrong groups are dropped because every advantage is zero, and sampling continues until the batch has enough useful groups. Token-level loss: GRPO averages tokens within each answer and then over answers; DAPO sums all tokens in the group and divides by the total token count, so every token weighs the same and long low-quality answers are penalized in full. Overlong reward shaping: a penalty of zero up to 16,384 tokens, falling linearly to minus one at 20,480 tokens; the alternative is to mask truncated samples. Bottom: AIME 2024 average at 32 samples rises from 30 for naive GRPO to 36, 38, 41, 42 and 50 as each technique is added. 1. Clip-higher positive-A incentive cutoff: π_old · (1 + ε_high) π_old = 0.01: cutoff 0.012 → 0.0128 π_old = 0.90: cutoff 1.08, never binds ε_high 0.2 → 0.28 frees rare tokens to grow; ε_low stays 0.2 so rare tokens are not crushed 2. Dynamic sampling G = 4 answers per question, filled = correct all right: Â = 0, dropped kept all wrong: Â = 0, dropped kept resample until the batch has N useful groups 3. Token-level loss GRPO: (1/G) Σᵢ (1/|oᵢ|) Σₜ ℓᵢₜ DAPO: (1 / Σᵢ|oᵢ|) Σᵢ Σₜ ℓᵢₜ every token in the group weighs the same, so long gibberish answers are penalized in full (the std divisor is kept, unlike Dr. GRPO) 4. Overlong reward shaping 0 −1 16,384 20,480 length penalty or mask truncated answers (filtering) AIME24 avg@32, Qwen2.5-32B (Table 1): naive GRPO 30 → overlong filtering 36 → clip-higher 38 → soft overlong punishment 41 → token-level loss 42 → dynamic sampling 50
Original sketch. The four DAPO changes and the cumulative AIME 2024 scores the paper reports as each is added (single runs, Table 1).
  • Setup (§4.1). Base model Qwen2.5-32B, trained with the verl framework on DAPO-Math-17K, a set of 17K math prompts whose answers were rewritten as integers so a rule can check them. Each rollout has 512 prompts × 16 samples, with minibatches of 512 samples, giving 16 gradient updates per rollout. Learning rate 1e-6 with 20 warm-up steps. Maximum generation is 20,480 tokens (16,384 expected plus a 4,096-token penalty band). Evaluation reports AIME 2024 avg@32 at temperature 1.0 and top-p 0.7.
  • Main result (Fig. 1, Table 1). 50 on AIME 2024, compared with 47 for DeepSeek-R1-Zero-Qwen-32B, using 50% of its training steps.
  • Cumulative ablation (Table 1). Naive GRPO 30 → overlong filtering 36 → clip-higher 38 → soft overlong punishment 41 → token-level loss 42 → dynamic sampling 50. These are single runs added in one fixed order, so each step’s gain is conditional on the earlier ones.
  • Training-dynamics advice (§4.3). Length does not rise steadily; it can stall or fall for long periods. Training reward often correlates poorly with validation accuracy, a sign of overfitting. Entropy should stay in a range: too low means collapse, too high goes with gibberish.
  • Evidence is one base model, one domain (integer-answer math) and one benchmark of 30 problems. There are no seed repeats in Table 1.
  • Dynamic sampling trains only on questions that are partly solvable now. It cannot teach anything on questions the policy never solves, which links to the RL-boundary debate.
  • Clip-higher raises entropy, but higher entropy is not the same as useful exploration. The Entropy Mechanism paper finds it can become unstable later in training.
  • Removing the KL relies on the reward being hard to hack. With learned or LLM-judge rewards, dropping the anchor is riskier (see Reward hacking with noisy verifiers).

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

    With a positive advantage, DAPO's clipped surrogate stops rewarding further increases in a token's probability once it passes π_old·(1 + ε_high); with a negative one it stops rewarding decreases below π_old·(1 − ε_low). These are incentive cutoffs, not hard caps on the new probability. For π_old = 0.01, 0.1 and 0.9, compute the upper cutoff at ε = 0.2 and at ε_high = 0.28, and the lower cutoff at ε_low = 0.2. Why does raising ε_high mostly matter for rare tokens, and why keep ε_low small?

    What a strong answer covers
    • Upper cutoffs at 0.2: 0.012, 0.12, 1.08. At 0.28: 0.0128, 0.128, 1.152. Lower cutoffs: 0.008, 0.08, 0.72.
    • For π_old = 0.9 the cutoff exceeds 1, so the clip never binds: a likely token can already go to 0.999. For 0.01 the surrogate rewards an absolute increase of only 0.002 (or 0.0028) per rollout. A gradient step can still overshoot, and updates from other samples sharing parameters can move a clipped token, so this is not a guaranteed maximum.
    • The paper finds that up-clipped tokens have low mean probability (below 0.2, Fig. 3a), which supports the idea that the upper clip mainly limits rare "exploration" tokens.
    • A larger ε_low would let negative-advantage updates push rare tokens toward 0 faster, collapsing the sampling space, so it stays at 0.2.
    • Clipping only binds after the first of the 16 minibatch updates per rollout. With a single update per batch, the ratio is 1 and neither bound matters.
  2. Derive / compute

    DAPO adds a soft overlong penalty to the ±1 correctness reward, with L_max = 20,480 and L_cache = 4,096. Compute the total reward of a correct answer of 15,000, 18,432 and 20,480 tokens, and of a wrong answer of 19,456 tokens. In a group of four with these lengths and correctness, which answer has the largest advantage?

    What a strong answer covers
    • Penalty = 0 up to 16,384 tokens; (16,384 − |y|)/4,096 between 16,384 and 20,480; −1 beyond.
    • Correct 15,000: 1 + 0 = 1. Correct 18,432: 1 − 0.5 = 0.5. Correct 20,480: 1 − 1 = 0.
    • Wrong 19,456: −1 − 0.75 = −1.75.
    • Rewards [1, 0.5, 0, −1.75]: mean −0.0625, so the short correct answer gets the largest advantage and a correct answer at the cap scores only about the group mean.
    • The penalty grows smoothly, so the model is told "too long" without being told "wrong", unlike a hard −1 for truncation that punishes sound but long reasoning.
  3. Mechanism

    Explain why groups where every answer is correct (or every answer is wrong) hurt GRPO training even though their loss is just zero, how dynamic sampling fixes this, and what new bias the filtering introduces into the training distribution.

    What a strong answer covers
    • An all-equal group has std 0 and advantage 0, so it adds no gradient. The batch gradient then averages fewer useful prompts, so it is smaller and noisier.
    • As training proceeds, more prompts reach accuracy 1 (Fig. 3b), so the effective batch shrinks over time.
    • Dynamic sampling oversamples and keeps only groups with accuracy strictly between 0 and 1 until the batch holds N such prompts, keeping the effective batch constant.
    • Cost: more generation per step; the paper argues that wall-clock time is dominated by long-tail samples anyway, and reaches the same accuracy in fewer steps (Fig. 6).
    • Bias: training now only sees questions of medium difficulty for the current policy. Hopeless questions never teach anything, so this is an implicit curriculum that cannot open new problems.
  4. What if…

    Table 1 adds the techniques one at a time: 30 → 36 → 38 → 41 → 42 → 50 on AIME24 avg@32. What can and cannot be concluded about each technique's individual value from this ladder? Propose a cleaner ablation design and say what it would cost.

    What a strong answer covers
    • Cumulative ladders measure the gain of each step given everything before it; the order is a choice, and interactions (for example clip-higher with token-level loss) are not separated.
    • Each number is one run on 30 AIME problems; avg@32 reduces sampling noise but not seed-to-seed training variance.
    • Dynamic sampling gives the biggest step (+8), but it also changes how many samples each step sees, so part of the gain could be compute rather than method.
    • Cleaner: leave-one-out from the full recipe, several seeds each, at matched generated tokens, with a second benchmark. VAPO later reports such a leave-one-out table for its own recipe.
  5. Connect

    DAPO motivates clip-higher by entropy collapse, and the Entropy Mechanism paper studies the same symptom. Using the covariance view of entropy change, explain why raising ε_high raises entropy, and why entropy rising is not by itself evidence of better exploration.

    What a strong answer covers
    • Entropy falls when high-probability tokens get positive advantages (positive covariance between log-probability and advantage). Clip-higher lets low-probability tokens with positive advantage grow, a negative-covariance contribution that raises entropy.
    • The Entropy Mechanism paper reports that clip-higher helps early but can become unstable, and that its added tokens have slightly negative average covariance.
    • DAPO itself warns that too-high entropy goes with gibberish and repetition; entropy should stay in a range, not be maximized.
    • Useful exploration means trying different strategies that sometimes succeed. Measure strategy diversity and pass@k, not token entropy alone.
  6. Design

    You adapt DAPO to RL-train a deep-research agent that issues search calls and must answer within a 40-call budget. Map each of the four DAPO techniques onto this setting, and say which one you expect to matter most and how you would test that.

    What a strong answer covers
    • Overlong shaping becomes a soft penalty on tool calls or total tokens past a threshold, so running out of budget is not treated the same as a wrong answer.
    • Token-level loss over model-generated tokens only (retrieved text masked), so long failed trajectories are fully penalized.
    • Dynamic sampling filters questions the agent always or never answers; with expensive search calls, cache retrieval results to make oversampling affordable.
    • Clip-higher matters if the policy collapses onto one search pattern; check query diversity per group.
    • Test with leave-one-out runs at matched search calls, reporting accuracy, calls per question and the zero-variance group rate.

Done with this page?

Status