TL;DR
DAPO is a variant of GRPO for reinforcement learning on long reasoning chains. It loosens the upper clip so that unlikely tokens can grow in probability, drops prompts whose sampled answers are all right or all wrong, and averages the loss over tokens instead of over answers. It also penalises answers that run past a length limit, but gently, and it removes the KL penalty. The paper reports 50 points on AIME 2024 for a Qwen2.5-32B base model, against 30 for plain GRPO on the same model.
Where you'll see it: training open reasoning models on math and code tasks whose answers can be checked automatically, where the open-source DAPO system built on verl is a common starting point.
Intuition
Why a plain GRPO run stalls
GRPO works, but the authors found that a naive run on Qwen2.5-32B reached only 30 points on AIME 2024, well below the 47 reported for DeepSeek's R1-Zero recipe on the same base model. They traced the gap to three symptoms: entropy collapse, reward noise and training instability. DAPO gives each symptom a targeted fix, and each fix is small enough to explain on its own.
Entropy collapse and the clip
Entropy measures how spread out a model's next-token probabilities are. When entropy falls too far, the model becomes nearly deterministic, and the answers it samples for one question start to look identical. A group of identical answers gives no comparison to learn from, so exploration stops.
PPO's clip is one cause. For a token with a positive advantage, the update is capped once the probability ratio passes . A token that starts at probability 0.9 has plenty of room, because it can only go up to 1. A token that starts at 0.01 is held to a tiny absolute gain. Rare tokens are often the ones that open a new line of reasoning, so a tight upper cap blocks exactly the moves that would add diversity.
- upper cap, ε = 0.2
- upper cap, ε_high = 0.28
Prompts that teach nothing
If every sampled answer to a prompt is correct, every reward in the group is equal. The group-relative advantage is then zero, and the prompt contributes no gradient. The same happens when every answer is wrong. As training goes on, more prompts sit at the all-correct end, so the number of useful prompts in each batch shrinks. DAPO handles this by sampling more prompts and discarding the useless ones until the batch is full of prompts with mixed outcomes.
Long answers and short answers
GRPO first averages the loss over the tokens of each answer and then averages over answers. A 100-token answer and a 1000-token answer therefore carry the same total weight, and each token of the long answer counts ten times less. The paper observes that long, degenerate answers (gibberish, repeated words) then go unpunished per token, which pushes entropy and length up in an unhealthy way. DAPO averages over all tokens in the group instead, so every token counts equally.
The math
Notation: is a question, its reference answer, and the policy (the language model) with parameters . For each question, the old policy samples a group of answers . Answer has tokens, and is its -th token. The probability ratio for that token is
DAPO maximises
subject to
where the advantage is and is the reward of answer . The symbols and are the lower and upper clip widths.
The objective has four changes from GRPO, one per technique.
Asymmetric clipping (Clip-Higher)
The clip range is split into a lower width and an upper width . The paper uses and . Only the upper bound moves, because raising the lower bound would push low-probability tokens toward zero and collapse the sampling space.
Dynamic sampling (the constraint)
The constraint in the objective is the dynamic sampling rule. A prompt is kept only if its group is neither all correct nor all wrong. Sampling continues until the batch holds the target number of prompts that satisfy it.
Token-level normalisation
The denominator is the total number of tokens in the group. Each token contributes with the same weight, so a longer answer has more influence on the update in proportion to its length.
No KL penalty
GRPO adds a KL penalty against a frozen reference model. DAPO drops it. The paper's argument is that in long reasoning training the model is supposed to move far from its starting point, so keeping it close is not the right constraint. See Kullback–Leibler Divergence for what the removed term measured.
Reward and length penalty
The correctness reward is when the predicted answer is equivalent to the reference and otherwise. Because the advantage is normalised by the group mean and standard deviation, shifting and scaling the reward (for example, from 0 and 1 to and ) leaves the advantages unchanged. The paper also adds a soft length penalty for truncated answers, with and a cache :
Here is the length of answer in tokens. The penalty is added to the correctness reward. Hard truncation at 20,480 tokens still applies, as the paper sets the generation limit there.
Worked examples
Take , so the lower bound is , and compare two upper widths for a token with positive advantage. The cap on the new probability is the old probability times .
- Rare token, old probability . With , the cap is . With , the cap is .
- Gain from the change: .
- Common token, old probability . With the cap is , and with it is . Both exceed 1, so neither clip binds, since a probability cannot exceed 1.
Interpretation: the relaxed bound moves the cap for rare tokens from 1.2 times to 1.28 times their old probability. The absolute gain in one update is small, so this is a steady nudge that accumulates over many steps, not a jump. It does nothing for common tokens, which is the intended asymmetry.
Take a group with answers and suppose 12 are correct. Rewards are for correct and for wrong.
- Mean reward: .
- Deviations: for correct answers, for wrong ones.
- Population variance: , so the standard deviation is .
- Advantages: for correct answers and for wrong ones.
- Check: , as normalised advantages must sum to zero.
If the same prompt had 16 correct answers, every reward would be , the standard deviation would be 0, and the group would be dropped by the constraint.
Interpretation: this prompt still has a signal, so it is kept. The illustrative arithmetic below shows the batch-filling effect. Suppose a batch needs 512 prompts and 150 of the first 512 sampled prompts are all-correct or all-wrong. Only 362 remain, so the sampler draws more prompts until 512 useful ones are collected. The cost of generation rises, but every gradient step uses a full batch of informative prompts. The paper reports that the total training time was not significantly affected.
A group has two answers. Answer A has 100 tokens and answer B has 1000 tokens, with .
- Sample-level GRPO weights each token by . A token in A gets , and a token in B gets .
- Total weight per answer under sample-level GRPO: for A and for B. The two answers count equally.
- Token-level DAPO weights each token by , the same for every token.
- Total weight per answer under DAPO: for A and for B.
Interpretation: under GRPO each token of the long answer is diluted tenfold, so a bad pattern repeated across a long answer is penalised weakly per token. Under DAPO a pattern costs the same wherever it appears, so repeated gibberish in a long answer is penalised as much as the same pattern in a short one.
Tradeoffs and failure modes
| Situation | What goes wrong | Better choice |
|---|---|---|
| Short answers, most prompts already solved | Dynamic sampling discards many prompts and spends extra generation for little gain | Plain GRPO or a curriculum that keeps hard prompts |
| Very hard dataset, most prompts at 0% | Sampling cost grows sharply; the filter may never fill a batch | Easier prompts first, or relax the group size |
| Learned reward model instead of a checker | Without KL, the policy can drift into reward hacking | Keep a KL term or a clipped reward; the paper's setup uses a rule-based correctness reward, where this risk is smaller |
| Truncated answers simply masked out | The model never learns to shorten, and it can drift back to long answers | Soft length penalty, as in the paper's final recipe |
| Entropy drifting up with length | Repetitive, low-quality text in long answers | Watch entropy and length together, as the paper does |
The paper's ablation (Table 1) shows each step adding accuracy on AIME 2024, in the order applied: naive GRPO 30, plus overlong filtering 36, plus Clip-Higher 38, plus soft overlong punishment 41, plus token-level loss 42, plus dynamic sampling 50. These gains come from one run order, so they are not independent contributions, and the token-level loss gives the smallest gain. The authors say it mainly improves stability.
History
DAPO was posted to arXiv in March 2025 by a team from ByteDance Seed and the Institute for AI Industry Research at Tsinghua University. It followed DeepSeek-R1, released in January 2025, which showed that RL on a base model could produce long chains of reasoning. R1 did not publish every training detail, and the DAPO authors reported that several groups had struggled to reproduce the result. Their contribution was a list of the failure modes they hit, a fix for each, and an open release of the training code (built on verl), the algorithm, and a curated dataset of about 17,000 math prompts with integer answers.
Check yourself
QuestionWhat is the only difference between the clip in DAPO and the clip in PPO when the advantage is positive?Show answer
PPO uses the same width on both sides, so the ratio is capped at and floored at . DAPO uses on the lower side and on the upper side. For a positive advantage only the upper cap matters, so it rises from to . The lower bound is kept because lowering the probability of a token too far can remove it from the sampling space.
QuestionIn a group of answers with 0 or 1 rewards, two answers are correct. What are the advantages of the correct and wrong answers, to three decimal places?Show answer
The mean reward is . The population variance is , so the standard deviation is . The correct answers have advantage , and the wrong answers have . Check: .
QuestionWhy does a prompt on which all sampled answers are correct give no learning signal under GRPO, and why does DAPO discard it?Show answer
When every reward in the group is equal, each answer's reward equals the group mean, so every advantage is zero. The gradient from that prompt is zero, and the prompt only adds sampling cost. Since the group standard deviation is also zero, the normalisation is undefined. DAPO removes such prompts and keeps sampling until the batch contains only prompts with mixed outcomes, so each step's gradient comes from informative data.
QuestionYou train a code model with unit-test rewards. About 40% of prompts are solved by all 16 samples in every step. What would DAPO do, and what would you monitor?Show answer
DAPO would filter those prompts out and draw more prompts to fill the batch, so the effective gradient stays dense. The cost is that generation per step rises, roughly in proportion to the share of filtered prompts. You would monitor the filtered fraction, the cost per useful prompt, the response length and the entropy. If entropy falls sharply, Clip-Higher and the entropy watch from the paper are the first things to check. If the filtered fraction keeps growing, the training set is too easy and should be made harder.
Sources
- Qiying Yu et al., "DAPO: An Open-Source LLM Reinforcement Learning System at Scale," 2025. arXiv:2503.14476
- Zhihong Shao et al., "DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models," 2024. arXiv:2402.03300
- John Schulman et al., "Proximal Policy Optimization Algorithms," 2017. arXiv:1707.06347
- volcengine, verl reinforcement learning framework. GitHub