AI system design

RLVR and GRPO: train against a checkable outcome

By Anup RaiReviewed

Reinforcement learning with verifiable rewards (RLVR) updates a model using rewards computed by a checker, such as answer comparison, code tests, or a proof verifier. The model is the policy that produces actions or tokens. The checker scores observable outcomes under a defined task contract.

The verifier defines what the training run rewards. A checker may accept an incorrect program that passes incomplete tests, and a correct final answer can contain invalid intermediate steps. Specify which outcomes the checker can distinguish before selecting the optimization algorithm.

RLVR: Reinforcement Learning with Verifiable Rewards

Suppose a code-generation model must implement small transformation functions. A training environment can run candidates against hidden tests in an isolated sandbox. The desired outcome is correct behavior on the specification, while the immediate reward measures passing those tests. The gap between those two is the central risk.

  1. Sample a task and its independent checking procedure.
  2. Generate candidate solutions from a recorded policy version.
  3. Score candidates within time, memory, and execution limits.
  4. Estimate which sampled actions performed better than a baseline.
  5. Update the policy using the selected RL objective.
  6. Evaluate on untouched tasks and inspect reward exploitation.
Architecture / visual model
flowchart LR T[Tasks with checking contract] --> P[Current policy rollouts] P --> V[Isolated verifier] V --> R[Rewards and advantages] R --> U[Policy update] U --> P U --> E[Independent evaluation and exploit checks]
Read diagram source
flowchart LR
  T[Tasks with checking contract] --> P[Current policy rollouts]
  P --> V[Isolated verifier]
  V --> R[Rewards and advantages]
  R --> U[Policy update]
  U --> P
  U --> E[Independent evaluation and exploit checks]

An outcome reward scores the final result. Process supervision scores intermediate steps. Long explanations, self-checking, or backtracking can emerge in some training settings, but are not guaranteed or required by the definition of RLVR. DeepSeek-R1 provides a documented open training report; do not attribute its exact algorithm to providers that have not published theirs.

GRPO

Group Relative Policy Optimization (GRPO) compares several responses generated for the same prompt. Suppose the model writes four candidate functions and the checker passes two. The group's average reward gives the trainer a baseline, the score it uses to decide which candidates did better or worse than their peers. It does not need a separately trained model to estimate that baseline. The system still has to generate candidates, run the checker, and update the model. DeepSeekMath introduced this method.

For an outcome-reward version, subtract the group's mean reward from each response's reward. Divide by the standard deviation to express the difference on a common scale. The result is the response's advantage. This example adds a small positive ε to the denominator to keep it above zero when all scores are equal.

Aᵢ = (rᵢ − mean(group_rewards)) / (std(group_rewards) + ε)

For rewards [1, 1, 0, 0], the mean and population standard deviation are both 0.5. The advantages are approximately [1, 1, -1, -1]. In this version, the trainer gives each generated token the advantage of its whole response. The checker scored the finished function, so the trainer does not know which individual token was responsible for success. Implementations can use different normalization rules.

Follow one token through an update. A saved version of the model produces the four responses. That version is the rollout policy, and it stays fixed for this batch. The optimizer compares the model being updated with that saved version.

  1. In a successful response with advantage close to +1, the rollout policy gave one sampled token probability 0.20. When the trainer scores that same token with the same preceding text, the model being trained gives it probability 0.30. The probability ratio is 0.30 / 0.20 = 1.5.
  2. Suppose the objective allows a 20% increase before clipping. For this positive advantage, the objective gets no extra benefit from pushing the ratio past 1.2. The term uses the smaller of the original and clipped contributions. This limits the incentive from the sample. It does not set the model's actual token probability to a fixed value.
  3. The original GRPO objective makes this comparison for each sampled token. A probability ratio for the whole response would instead multiply the token ratios. Later variants can change which ratio the trainer uses.

Some recipes also include a KL penalty, which measures how much the model's probabilities move away from a separate reference model. The rollout policy answers “what probabilities produced this batch?” The reference model answers “how far has the model moved from the behavior we want to retain?” Those versions can differ. The optimizer can keep the reference fixed while refreshing the rollout policy for a new batch.

Diagnose the group signal

Group outcome Relative reward signal Consequence
Mixed success and failure Nonzero advantages The policy can favor better sampled outcomes
All correct Zero advantages in this outcome-only group Little task-learning signal from the relative reward term
All wrong Also zero advantages More sampling or better task selection may be needed
Reward varies for irrelevant formatting Nonzero but misdirected signal The model can improve reward without solving the task

When all advantages are zero, the policy-gradient reward term contributes no signal. An enabled KL or other loss can still produce gradients. Saying “the entire training step has no gradient” would be too broad.

Objective variants and their costs

Approach Main change to understand Tradeoff to test
Dr.GRPO Removes division by each response's length and by the reward group's standard deviation. These divisions change how much different examples contribute to an update. Measure whether outputs become shorter without losing task accuracy.
DAPO Gives probability increases and decreases different clipping limits. It averages the loss over all generated tokens in the batch instead of averaging within each response first. It also collects replacement groups when every response in a group is right or every response is wrong. Replacing groups can require generating more responses. Measure end-to-end training time.
GSPO Combines the ratios for a response into one length-normalized ratio. It takes the average of the token log-ratios and exponentiates that average, then clips at the response level. Measure stability on long responses. A clipping limit tuned for per-token ratios may be unsuitable for this ratio.

Primary reports: Dr.GRPO, DAPO, GSPO. A length bias is a property of the objective and its normalization, not simply the fact that a sequence shares an outcome reward. These methods are alternatives to evaluate, not a universal ranking or a required replacement order.

Reward Design and Failure Modes

Failure Example Repair and remaining cost
Incomplete verifier Code hard-codes visible examples Hidden and adversarial tests; specification coverage still matters
Parser exploit Answer extraction accepts an unrelated matching number Strict output parsing and adversarial verifier tests
Correct result, flawed explanation Invalid intermediate step happens to reach the answer Evaluate steps when they are part of the required deliverable
Format dominates correctness Tagged output earns reward despite a wrong result Rebalance or remove shaping rewards; monitor each component
Length becomes a shortcut Extra tokens correlate with reward or exploit normalization Inspect objective, truncation, and success at matched token budgets
Benchmark leakage Training includes near copies of evaluation problems Source-aware splits and contamination checks

A learned reward model has its own exploitation surface, but a deterministic checker also has blind spots. There is no general theorem that every RLVR setup is more stable than every RLHF setup.

Does RL Add Capability or Sharpen Sampling?

Pass@1 measures success with one sampled attempt under a specified setup. Pass@k asks whether at least one of k attempts succeeds. A better pass@1 can reflect a higher probability of already-possible correct outputs. Success found only after very many samples is different from reliable single-attempt performance.

For one problem with a 20% chance of success per independent attempt, four attempts give a 1 − 0.8⁴ ≈ 59% chance that at least one succeeds. A model can have useful pass@4 results while still failing most first attempts. A service only benefits from those extra successes if it can recognize which attempt is correct and afford the extra generation.

To investigate a capability claim:

  1. Compare the base and trained model using the same prompts, decoding rules, and evaluation checker.
  2. Report sampling counts and generated-token or compute budgets; large k costs more.
  3. Measure important difficulty slices and use multiple seeds or uncertainty estimates.
  4. Check final-answer validity and, when needed, intermediate reasoning.
  5. Include other base families before generalizing a result.

Finite sampling cannot prove that a base model had zero probability of producing a solution. Conversely, improved sampling efficiency is useful even without a claim of entirely new capability. The Spurious Rewards study reports gains from uninformative rewards for some Qwen settings that did not generalize to other model families. A base-versus-RL study and ProRL report different capability-boundary findings under different training setups. The studies use different starting models, task sets, and sampling budgets. Describe any capability claim with the conditions under which it was measured.

Distillation: The Cheaper Path

Method Typical source of trajectories Supervision Cost to examine
Teacher-response SFT Teacher Target response tokens Generation, filtering, and supervised training
RLVR Current policy Checked outcomes Rollouts, verifier execution, and policy updates
On-policy distillation Current student Teacher feedback on student states Teacher scoring plus training infrastructure

Distillation can transfer useful task behavior to a smaller model without developing an RL system. It is not always cheaper after teacher queries and refresh work, but it is a valuable baseline. Continued training on relevant reasoning data before RL may also improve the starting policy. Treat “mid-training” as a stage whose objective and data must be specified, not a magic capability switch. A controlled study of pretraining, mid-training, and RL investigates their interaction using synthetic reasoning tasks; its conclusions should be interpreted within that experimental scope.

Practical Guidance

Start with an existing model and a measured task baseline. Consider RLVR when the task has a credible verifier, expected gains justify the infrastructure, and the policy can generate some informative successes. Tasks that are always solved or never solved may provide little group-relative signal, though curriculum and exploration choices can change that.

For 256 prompts, eight completions per prompt, and 2,000 generated tokens per completion, one batch produces 256 × 8 × 2,000 = 4,096,000 tokens before the update. Increasing the number or length of responses increases generation work. Budget verifier execution, retries, rejected groups, and checkpointing alongside that work.

Interview practice

  1. What does RLVR verify? Whatever the checker measures under its contract. Hidden-test coverage and parsing are part of the design.
  2. What does GRPO remove? A separate learned value baseline in the described recipe, not all auxiliary memory or rollout cost.
  3. Why can all-wrong groups be uninformative? Equal outcome rewards yield zero relative advantages; regularization can still act.
  4. Why distinguish token and sequence ratios? They define different importance-weighting objectives and can have different stability properties.
  5. Does pass@1 improvement prove new capability? No. It establishes better one-attempt performance in the evaluated setup; stronger claims require further evidence.
  6. When is distillation the better proposal? When teacher supervision can achieve the task target with lower total development and operating cost.
  7. How do you close a reasoning-training design? State the verifier contract, measured quality gain, exploit checks, rollout budget, and release/rollback criteria.

Recall card and closing

The checker supplies the reward, and GRPO compares responses to the same prompt to decide which sampled behavior to encourage. Evaluate the updated model on untouched tasks, including cases where an incorrect response could earn a high reward. Measure the serving cost of the resulting response lengths. Inference fundamentals.

Your notes

Write the decision you would make and the uncertainty you would investigate next. Saved only in this browser.

Explore the diagram