Reinforcement Learning from Verifiable Rewards
Learn how RLVR uses programmatic checks to score responses. See the training objective, verifier design, failure modes, and a worked reward-hacking example.
Language AI HandbookAll chapters Reinforcement Learning from Verifiable Rewards
Suppose a math model answers 3 + 4 with “7, but I will go with 8.” A verifier that reads the first integer gives that answer full credit. If training increases the probability of responses the verifier rewards, the dashboard can report progress even when the model is giving more wrong answers than a policy trained on a sound check. The same measurement problem appears with learned reward models in reinforcement learning from human feedback (RLHF): training targets the score it sees, which can diverge from the quality people care about.
In reinforcement learning from verifiable rewards (RLVR), a checker scores each sampled response against a specification. The resulting score helps drive a policy update. Tülu 3 used PPO with deterministic verification functions for math answers and checkable instructions. DeepSeek-R1-Zero used rules for accuracy and format. These methods use different policy updates. They share a reward signal derived from a check.
For tasks with reliable automated checks, RLVR can reduce the need to collect labels for individual responses. A comparator over bounded integer sums, for example, is inexpensive and reproducible. Running a program against a large test suite can cost much more than checking a single integer. A timeout can also make the observed result depend on the execution environment. A learned reward model can also produce deterministic scores at inference, but changing a rule-based check gives you a direct way to test the changed behavior.
Three quantities distinguish the reward signal from the behavior it is meant to encourage.
- The verifier score is a number a program returns after reading the response string.
- Genuine correctness is whether the response actually solves the problem.
- The policy update is what gradient ascent does to given a stream of values.
The reward objective in this chapter uses . When gives a high score to a response with low , optimization can shift probability toward that response if the policy can sample it and the update favors it. In the arithmetic experiment, a flawed checker rewards the hedged answer. A separate correctness label exposes where the two signals disagree.
We will formalize the training objective, trace the stages of an automatic check, and run a small arithmetic experiment where the checker gives the same maximum reward to correct and incorrect outputs.
Why Verifiable Rewards
In a conventional preference-based pipeline, human comparisons can train a scoring model. The fitted model supplies a proxy for the objective used to update the policy. Annotator disagreement, poor predictions, and overoptimization can be examined separately.
The cost of a preference label
In the handbook’s RLHF pipeline, annotators compare two responses to a prompt. A Bradley–Terry-style likelihood can fit a reward model to those comparisons. A subsequent PPO stage can optimize its scores while penalizing divergence from a reference policy.
- Marginal labeling cost. On a task poorly covered by the existing preferences, some new comparisons may be needed.
- Reward model error. A reward model fitted to finite preference data can be inaccurate on responses that differ from its training examples.
- Optimization pressure. In a controlled synthetic experiment, Gao et al. (2023) used a fixed learned reward model to supply labels for a training proxy. Their gold model's score could fall as optimization continued against the proxy. This evaluates the divergence of two models' scores under optimization. An optimizer can use a scalar reward without differentiating the reward model itself.
The available labels and model fit jointly determine how much you can trust the resulting scores. A shift in which responses the policy samples can expose inaccuracies that were uncommon in validation.
A verifier can replace per-response preference labeling when you already have a usable specification and reference data. The response is scored by executing the check. The check's output can still differ from the intended label, for example because a parser treats an intermediate number as the answer.
What a verifier replaces
Write the checker’s scalar score as , with its answer key and evaluation configuration held fixed. In the binary deterministic case its score is an indicator. It is one when the check passes.
where:
- : the prompt drawn from the task distribution
- : the response string produced by the policy
- : a deterministic program that returns whether the response passes the check
- : the indicator function, returning when its argument is true and otherwise
A check can compare an extracted answer with a gold value, run a bounded test suite, ask a proof assistant to check a proof term, or validate JSON against a schema. Each checks a specified property of the response.
Reinforcement learning from verifiable rewards uses a checkable property of a response to supply a reward during post-training. The check can depend on fixed side information such as an answer key, validation fixtures or a simulator configuration. Binary deterministic verification is the simplest case. The checker and the choice of policy optimizer are separate decisions.
A deterministic checker gives repeatable scores when its input, reference data and environment are fixed. Approximate or randomized evaluation needs its own protocol, with a record of the data and randomness used. Some aspects of quality, such as the usefulness of an open-ended explanation, lack a reliable automatic check.
A reproducible verifier helps isolate failures. If the same cached response changes its score after a checker update, compare the two checker versions before interpreting a change in the policy. Rerunning the whole policy introduces a separate source of variation through sampling.
A practical first question is whether checking a candidate is cheaper or easier to automate than producing a good one. Arithmetic and proof checking illustrate the distinction. A rule for checking a story's word count is easy to write, but a check on its overall quality is a different specification.
The scatter plot uses invented coordinates to illustrate verification cost and generation difficulty as separate dimensions. The shaded rectangle highlights tasks assigned a verification cost of at most 0.4 and a generation difficulty of at least 0.5. The boundary is a teaching device.
VisualizationOut [3]Expand

The RLVR Objective
The verifier score enters the objective as a proxy for the desired behavior. The objective below adds regularization to the reward, so both terms affect the policy update.
A bandit over sequences
Consider a single-turn setup with one terminal reward. The prompt is the context and the complete sampled token sequence is the action, so the objective can be framed as a contextual bandit. Write for that sequence and for the text decoded from it. The policy samples the tokens one at a time, and the verifier scores the decoded response.
A common objective combines the terminal reward with a forward KL penalty to a fixed reference policy . Use the same stopping rule for both policies, and assume both policies terminate with probability one for the prompts under consideration. If a response ends by sampling an end-of-sequence token, include that token in the sum. Under this convention the token log-ratios add up to the sequence log-ratio.
where:
- : the policy parameters
- : the task distribution over prompts
- is the policy's probability of sampling the complete token sequence given .
- is the reward for the sequence. With the bare verifier reward, .
- : the reference policy
- : the nonnegative KL penalty coefficient
- : the token at position and the tokens before it
- counts the sampled tokens in , including the end token when it was sampled.
The reward is one scalar for the response. The regularizer is a sum of realized token log-ratios. At a fixed prompt, averaging that sum under the current policy gives the forward KL divergence between the current and reference distributions over sampled token sequences. When , a finite penalty requires reference support for every sequence the current policy can sample for almost every prompt under . It also requires the prompt-averaged forward KL to be finite. A realized log-ratio may be negative.
The policy gradient
Set here and write the resulting reward-only objective as . Assume a fixed reward and, for each prompt, a set of positive-probability sequences that stays fixed in a neighborhood of the current parameters. A finite softmax over a fixed set of actions satisfies that support condition. If differentiation can pass through the expectation, the gradient uses the reward minus an action-independent baseline as the coefficient of the sequence score function.
where:
- : the gradient with respect to the policy parameters
- : the sequence-level reward for the response
- : a baseline that can depend on the prompt but not on the sampled response
Expanding the log-probability of the sequence into its tokens:
Substituting the token sum shows that this reward-only estimator multiplies every token’s score function by the same advantage .
A positive advantage gives the sampled sequence a positive coefficient. That coefficient does not identify which tokens caused the outcome. A correct response can receive negative advantage if the verifier score is below its baseline. Even a 900-token response receives just one binary reward in this setup.
Outcome supervision scores the completed answer. Process supervision can score or label individual reasoning steps, as in Lightman et al.. A checker can also verify intermediate results if those results have a specification. This chapter uses a terminal check and leaves intermediate-step supervision to the later reward-model chapter.
Where the variance comes from
Under the assumptions above, the gradient estimator is unbiased. The expected reward conditional on the prompt is a useful value baseline. Subtracting it gives the return relative to the policy's expected reward for that prompt. A baseline that minimizes gradient variance can also depend on how much the score-function norm varies across sampled outputs.
Summing over responses to compute the exact expectation is impractical for a language model. These three baselines can be estimated from sampled responses or learned from data.
- A learned value function estimates expected reward at the prompt in this bandit framing. In a token-level actor–critic method the value can instead depend on the generated prefix.
- A group mean uses the average reward of responses to the same prompt. Each response contributes its own reward to the mean, so this baseline depends on the response whose gradient it weights. The arithmetic example below derives the resulting bias for independent draws.
- A leave-one-out mean averages the other sampled responses to the same prompt. With independent draws and at least two samples, the baseline for a response does not depend on that response.
With the within-group sample mean, equal rewards produce zero centered advantages for that prompt. Its reward-gradient contribution is zero in that batch, while a separate KL term can still contribute. Filtering zero-variance batches or resampling their prompts changes which data receive training updates.
The plot shows the variance of the binary reward alone. For a pass probability , that variance is , which reaches at and approaches zero at the extremes. The parameter-gradient variance also depends on the response score functions.
VisualizationOut [5]Expand

Adding a constant to every reward leaves the expected reward-only gradient unchanged. Multiplying rewards by a positive scalar rescales that gradient. When the objective also includes KL or another fixed-scale term, rescaling the reward changes its weight relative to that term. Keep the scales explicit when comparing experiments.
KL regularization
The KL penalty changes the objective by charging for probability shifts away from a reference distribution. Practical uses include the following.
- Reference proximity. Increasing the penalty increases the cost of moving away from under this objective. A soft penalty does not impose a hard divergence bound.
- Proxy optimization. The penalty can oppose a shift toward a verifier shortcut when that shift incurs divergence. A shortcut close to the reference can still be attractive.
- Capability retention. Reference proximity can discourage some behavior changes. A held-out capability measurement is still needed to establish retention.
One option is the sampled estimator described in the DeepSeekMath report. It avoids summing over the full vocabulary for each sampled prefix. The following argument concerns the expected KL value. It does not imply that differentiating the sample gives the same estimator under any sampling scheme.
where:
- : the reference policy's probability of token given the prompt and prior tokens
- : the current policy's probability of the same token
- : the per-token estimate of the KL divergence
For a token sampled from the current policy, with the same positive support for both distributions, this estimator is non-negative and its expectation is the forward KL from the current policy to the reference. At a fixed prefix, the expected ratio is one, so the expected two linear terms cancel. Confirm the support assumptions when comparing this expression with probabilities after token masking. Track verifier reward and held-out correctness separately when tuning the regularization weight.
Anatomy of a Verifier
For free-text outputs, it is useful to split verification into four stages. An error in an earlier stage can change the score even if later stages function as intended.
Stage 1: Extraction
Extraction selects the part of the response that will be checked. Changing this rule can change what counts as a scored answer.
These extraction choices have different failure modes.
- Require a canonical delimiter. A format can place the answer inside
\boxed{...}or afterAnswer:. The checker must define what to do if the delimiter is missing or repeated. - Take the last number in the response. This heuristic reads the committed answer when it is the final number. A later calculation can supply a different number, as in "...so the answer is 8. Checking: 3 + 4 = 7."
- Take the first number in the response. This can select an operand or intermediate result before the actual answer. The worked example includes both cases with the answer first and cases with an operand first.
- Search for the gold answer anywhere in the text. Extremely permissive, and therefore prone to false positives whenever the model mentions the right number while committing to a different one.
- Ask a model to extract. A learned extractor can introduce its own errors. Sampling can also make its output vary between runs.
A checker over text sees the emitted string. If a formatting failure and a wrong answer both map to zero, they give the same reward even though they are diagnostically different.
Stage 2: Normalization
Normalization maps the extracted string to a form that can be compared. The mapping depends on what distinctions the task treats as meaningful.
- Whitespace and case folding, so
" The Answer is 42 "and"the answer is 42"agree. - Unit and currency stripping, so
"42 dollars"matches42. - LaTeX canonicalization, so
\frac{1}{2},\dfrac{1}{2}, and{1 \over 2}all become the same object. - Numeric parsing, which turns strings such as
0.333and1/3into numeric values. - Set and ordering normalization, for answers that are collections.
- Symbolic simplification, so
2(x+1)matches2x+2.
Removing units would make “42 apples” and “42 oranges” indistinguishable to a numeric comparator. Check acceptable and unacceptable cases on both sides of the boundary.
Stage 3: Comparison
The comparison step specifies which candidates pass. Exact equality can define an equivalence relation, whereas closeness within a fixed tolerance need not be transitive. Three common comparisons are:
- String equality after normalization. Simple, interpretable, brittle.
- Numeric comparison within a tolerance . Choose an absolute or relative tolerance based on the range of answers. With an absolute tolerance of around , both 0.333 and 0.334 pass.
- Symbolic equivalence. Canonicalization or a symbolic identity test can compare expressions under stated assumptions. Comparing their syntax trees only tests the particular structural equality the comparator implements.
Execution-based comparison can check a candidate against a finite suite of expected outputs. A passing score establishes agreement on those checks. Expanding the suite can change the reward and training update.
Stage 4: Scoring
Finally, the comparison result is turned into a reward. Options include:
- Binary assigns when the comparison passes and otherwise.
- Partial credit: the fraction of tests passed, or a graded rubric.
- Composite: a correctness term plus a format term plus penalty terms.
A composite reward can score correctness and formatting separately. DeepSeek-R1-Zero used rule-based accuracy and format rewards, with the latter checking the output structure. A format component can reward a well-formed wrong answer. Report the two scores separately to see whether better formatting explains an apparent reward gain.
The edge cases: abstentions, truncation, timeouts, and empty responses
The training loop needs an explicit policy for scoring or excluding exceptional responses. Keep a reason code separate from the scalar reward, even if the optimizer sees only that reward.
- Abstention. If abstaining and giving a wrong answer both score zero, a guess with some probability of success has higher expected reward. Whether to reward abstention depends on the task and how you plan to use the model.
- Truncation. If a response is cut off before a usable answer and the checker assigns zero, an interrupted solution and an incorrect answer have the same score. Track truncation separately when interpreting shifts in answer length.
- Timeouts. A timeout establishes failure to finish within the configured budget. If it maps to zero, a correct but slow candidate gets no credit under that resource limit. Track timeouts separately from wrong answers.
- Empty or refusal responses. These can share the score assigned to wrong answers under an exact-answer rule. Where a refusal is appropriate, include that behavior in the evaluation protocol.
- Verifier crashes. Distinguish checker infrastructure faults from candidate failures. Retries, exclusions, and zero rewards can each change the effective sample or objective. Record which rule you use.
What Can Be Verified
The taxonomy of verifiers closely tracks the taxonomy of tasks with checkable ground truth. The table below summarizes the main families and their characteristic failure modes.
| Verifier family | Typical domains | What it checks | Characteristic failure |
|---|---|---|---|
| Exact match after normalization | Arithmetic, short-answer QA, classification | String/numeric equality | False negatives from formatting; brittle to paraphrase |
| Symbolic equivalence | Algebra, calculus, equation solving | Expression identity | Simplifier gaps; domain restrictions the simplifier ignores |
| Executable specification | Code generation, SQL, data transformation | Input/output behavior on a test suite | Test suite is a partial spec; overfitting to visible tests |
| Formal kernel | Theorem proving in Lean, Isabelle or Coq | Validity of a formal derivation under the prover’s rules | The formal statement may not match the informal problem |
| Constraint and schema | Structured output, JSON, tool calls, regulated formats | Validity against a grammar or schema | Satisfies the schema while being semantically wrong |
| Environment simulation | Agents, games, planners | Task success in a simulator | Simulator-to-reality gap; reward hacking of simulator quirks |
Choose a checker based on the property you need to measure. An exact match checks a different property from a finite test suite or a formal derivation.
Exact answers
Tülu 3 compared the extracted GSM8K answer with the reference. For MATH it tried several extraction rules and accepted a candidate if a symbolic or normalized comparison matched the reference. Tülu 3 release verifier code.
If your intended answer equivalence includes different forms of the same number or expression, define additional normalization rules or a symbolic check and evaluate their errors separately.
Symbolic and numeric equivalence
An algebraic identity can depend on its domain. For instance, cancelling in gives 1 where is nonzero. At zero the original expression is undefined. Preserve such restrictions when comparing forms.
Executable specifications
In code tasks an executable check can run a candidate against tests in an isolated environment. Finite tests cover only the cases they exercise. Record which cases supplied training reward and keep a separate test set for evaluation.
Run untrusted candidate programs in an isolated environment with enforced time and memory limits. Keep training data, credentials and the verifier’s trusted state outside the candidate environment. This chapter’s arithmetic example does not run generated programs.
Formal kernels
A proof assistant checks whether a derivation establishes the stated conclusion under its rules and assumptions. Lean’s kernel type-checks proof terms. Isabelle constructs theorems through primitive inferences and can replay those inferences from a recorded proof term. Lean Tactic Proofs, Isabelle Primitive Logic.
DeepSeek-Prover-V1.5 used Lean 4 feedback in reinforcement learning. Check the statement and allowed assumptions before treating the kernel’s acceptance as an answer to the original question.
A formal checker works relative to the submitted formal statement and environment. If the formal statement misrepresents the informal problem, a correct proof of the formal statement can still miss the intended problem.
Constraint and format checks
Some constraints have direct checks. A schema validator can test structure and a keyword rule can check whether a phrase appears. A schema check and a content check can be run independently.
A schema-valid object can contain incorrect values. If the reward depends only on schema validity, the content error receives no penalty through that term. Check structure and content separately when both matter.
The gray zone: model-judged verification
A model can score outputs on an open-ended rubric. Its score is a learned judgment rather than a mechanically checked task predicate. Even deterministic decoding does not establish correctness of the judge. Compare the judge with independent labels before using its scores as training rewards.
How Verifiers Fail
Reward and correctness can move differently as training changes the output distribution. Compare them over the same task mix and under a documented sampling protocol.
False positives and reward hacking
A false positive is a response the verifier accepts but that is not genuinely correct. Define the latent correctness predicate and the verifier . The false positive rate is
and the false negative rate is
where:
- : the verifier score (a reward of if the program accepts the response, otherwise)
- : the latent correctness label ( if the response genuinely solves the problem, otherwise)
- : the fraction of incorrect responses that the verifier nonetheless accepts
- : the fraction of correct responses that the verifier rejects
Each rate requires a conditioning group with positive probability. In an audit, report how many examples are in that group. The sample rate is undefined if the group is empty.
The reward-only training update optimizes expected . A policy can improve that objective while reducing expected when it shifts mass toward wrong responses that pass the checker. Skalse et al. (2022) formalize reward gaming as a conflict between a proxy and a desired reward.
These checks can accept responses that fail the intended task.
- A test suite can pass a program that hardcodes the outputs for the test inputs and fails on other inputs.
- A checker that accepts any
\boxed{}response can pass a boxed wrong answer. - A check for the correct number anywhere can pass a response that commits to a different answer.
- A symbolic comparator can declare equality after dividing by zero.
- A checker that accepts any response above a length threshold can pass a long wrong answer.
A composite reward can award format or length credit to a response that fails its separate correctness check.
A wrong response that passes has an advantage over an equally likely wrong response that fails the same check, all else equal. Whether this matters in training depends on the policy and the other objective terms.
False negatives and the suppression of good behavior
A false negative is a correct response the verifier rejects. It can reduce the reward for a response style that otherwise solves the problem.
Consider “First compute 3 + 4 = 7. The answer is 7.” The first integer is 3, so the example's first-integer check rejects a correct answer. A bare “7” passes. This creates an incentive to favor the format that the checker can parse.
A verifier that accepts terse answers while missing valid worked answers changes the measured advantage of those behaviors. Pass@ measures how often at least one of sampled responses to a prompt passes the evaluation checker. This toy example cannot establish why pass@ changes in a separately trained language model.
Saturation
For a group of 20 with 19 successes, the baseline reward is 19/20. A success receives a centered advantage of 1/20 and the lone failure receives −19/20. For a group of 20 with one success, the baseline is 1/20. The lone success receives 19/20 and each failure receives −1/20. The rare outcome can have substantial advantage when it appears.
If independent responses pass with probability , a group of size has no mixture of passes and failures with probability . Such a group has zero centered reward advantages. This probability depends on the number of samples per prompt as well as the current pass rate.
Goodhart, formally
Let be the expected genuine correctness and the expected verifier score. The desired objective is
The expected verifier score is the reward term when .
When the verifier provides the entire reward and , is the earlier reward-only objective . With , the training objective subtracts the reference penalty from . Both and average over prompts from and token sequences from . Each score uses the decoded response . If for every decoded response the policies can produce, the two objectives are identical. Distinct reward functions can still have the same maximizers. A verifier measured on base-policy outputs can behave differently on a later policy because it receives a different mixture of responses. Measure its error on the distribution you intend to train or evaluate on.
A verifier measured on base-policy responses can be less accurate on later responses if their mix of formats or errors changes. Audit samples from the policy you expect to use.
Worked Example: A Verifier That Teaches the Wrong Lesson
The following seeded CPU example uses integer addition. A policy chooses among response templates. A checker sees the rendered text and the answer key, while evaluation compares the committed answer with the key. The model under study is a categorical policy over templates.
The design has three deliberately separated layers:
- Responses: literal strings, rendered from templates and the problem's operands.
- Verifier scores: computed by regex over the string, with no access to the strategy's intent.
- Hidden labels: computed from the answer the response actually claims, which the verifier never sees.
The templates provide an explicit committed answer for the evaluation label. The example checker receives the string and gold answer, so it has to infer what the response commits to from the string.
The task and the response space
We start with eight addition problems and a small set of response strategies. Each strategy is a template that produces a string from the operands, plus a record of the final answer that string actually commits to.
PythonIn [6]Expand
import re
import numpy as np
import pandas as pd
# Eight harmless integer addition problems. The gold answer is a + b.
PROBLEMS = [(3, 4), (5, 2), (6, 3), (2, 9), (7, 5), (4, 4), (8, 3), (6, 6)]
GOLD = [a + b for a, b in PROBLEMS]Each fixture contains two small positive integers. The gold answer is their sum. The renderer returns the response text and its committed answer. The hidden correctness label is computed later by comparing that answer with the gold answer.
PythonIn [7]Expand
STRATEGIES = [
"bare", # just the number
"sentence", # a plain declarative answer
"cot", # shows the arithmetic, then answers correctly
"hedge", # names the right number first, then commits to a wrong one
"wrong", # plain wrong answer
"abstain", # declines to answer
"cot_wrong", # shows correct arithmetic, then commits to a wrong answer
"trailing_truth", # commits to a wrong answer, then restates the true sum
]
def render(strategy, a, b):
"""Return (response_text, committed_claim).
The claim is the answer the response ends up asserting, or None if it
declines to answer. The verifier never sees this value.
"""
n = a + b
if strategy == "bare":
return f"{n}", n
if strategy == "sentence":
return f"The answer is {n}.", n
if strategy == "cot":
return f"First compute {a} + {b} = {n}. The answer is {n}.", n
if strategy == "hedge":
return f"{n}, or maybe {n + 1}. I will go with {n + 1}.", n + 1
if strategy == "wrong":
return f"The answer is {n + 1}.", n + 1
if strategy == "abstain":
return "I am not sure. I cannot determine the answer.", None
if strategy == "cot_wrong":
return (
f"First compute {a} + {b} = {n}. Hmm, but the answer is {n + 1}.",
n + 1,
)
if strategy == "trailing_truth":
return f"The answer is {n + 1}. To confirm, {a} + {b} = {n}.", n + 1
raise ValueError(strategy)Let's look at what these strings actually look like for the first problem.
ConsoleOut [8]Expand
bare claim= 7 | 7 sentence claim= 7 | The answer is 7. cot claim= 7 | First compute 3 + 4 = 7. The answer is 7. hedge claim= 8 | 7, or maybe 8. I will go with 8. wrong claim= 8 | The answer is 8. abstain claim=None | I am not sure. I cannot determine the answer. cot_wrong claim= 8 | First compute 3 + 4 = 7. Hmm, but the answer is 8. trailing_truth claim= 8 | The answer is 8. To confirm, 3 + 4 = 7.
The cot response shows the addition and gives the right sum. The hedge response names the correct number first and then commits to the wrong value. The trailing_truth template commits to a wrong value and later mentions the correct sum. Abstention has no committed answer.
Three verifiers, three blind spots
We implement three deliberately narrow heuristics for the toy examples. The fixtures contain only small positive integers and at most a few digit groups. For instance, the first-integer heuristic finds 7 in the sentence “The answer is 7.” and 3 in “First compute 3 + 4 = 7.” A production parser must specify the treatment of signs, decimal points and overlong input separately.
PythonIn [9]Expand
NUMBER = re.compile(r"\d+")
def first_integer(text):
hits = NUMBER.findall(text)
return int(hits[0]) if hits else None
def last_integer(text):
hits = NUMBER.findall(text)
return int(hits[-1]) if hits else None
def verifier_first_int(text, gold):
return int(first_integer(text) == gold)
def verifier_last_int(text, gold):
return int(last_integer(text) == gold)
def verifier_contains(text, gold):
return int(re.search(rf"\b{gold}\b", text) is not None)
VERIFIERS = {
"first_int": verifier_first_int,
"last_int": verifier_last_int,
"contains": verifier_contains,
}Each verifier embodies a different theory of where the answer lives in a response:
first_inttakes the first recognized digit group. It works for a bare answer in this fixture and can mistake the first operand for an answer.last_inttakes the last recognized digit group. It can credit a late mention even when the response explicitly committed to a different value.containschecks whether the gold digit string occurs at a word boundary on both sides. Mentioning the gold number does not show commitment to that answer.
Auditing verifiers against hidden labels
Each strategy is rendered for each problem. The audit records the independent correctness label and the output of each verifier. Per-strategy summaries reveal failures that an overall mean can hide.
PythonIn [10]Expand
records = []
for strategy in STRATEGIES:
for (a, b), gold in zip(PROBLEMS, GOLD):
text, claim = render(strategy, a, b)
row = {
"strategy": strategy,
"gold": gold,
"claim": claim,
"hidden_correct": int(claim is not None and claim == gold),
}
for name, fn in VERIFIERS.items():
row[name] = fn(text, gold)
records.append(row)
audit = pd.DataFrame(records)The hidden column gives the fraction of correct commitments for each strategy. The other three score columns give the fraction of problems on which each checker awarded credit.
ConsoleOut [11]Expand
strategy hidden first_int last_int contains
bare 1.00 1.00 1.00 1.00
sentence 1.00 1.00 1.00 1.00
cot 1.00 0.00 1.00 1.00
hedge 0.00 1.00 0.00 1.00
wrong 0.00 0.00 0.00 0.00
abstain 0.00 0.00 0.00 0.00
cot_wrong 0.00 0.00 0.00 1.00
trailing_truth 0.00 0.00 1.00 1.00Compare the hidden column with the three checkers. first_int pays hedge and rejects cot on all eight problems. last_int accepts all the correct strategies and also accepts trailing_truth. contains accepts bare, sentence, and cot, along with three wrong commitments: hedge, cot_wrong, and trailing_truth. It rejects wrong and abstain.
Now let's quantify the errors directly with a confusion matrix over all 64 (strategy, problem) pairs.
PythonIn [12]Expand
def confusion(df, column):
tp = int(((df[column] == 1) & (df.hidden_correct == 1)).sum())
fp = int(((df[column] == 1) & (df.hidden_correct == 0)).sum())
fn = int(((df[column] == 0) & (df.hidden_correct == 1)).sum())
tn = int(((df[column] == 0) & (df.hidden_correct == 0)).sum())
return tp, fp, fn, tnConsoleOut [13]Expand
first_int TP=16 FP= 8 FN= 8 TN=32 precision=0.67 recall=0.67 last_int TP=24 FP= 8 FN= 0 TN=32 precision=0.75 recall=1.00 contains TP=24 FP=24 FN= 0 TN=16 precision=0.50 recall=1.00
On these 64 pairs, first_int has both false positives and false negatives. last_int has recall 1.00 and precision 0.75. contains reaches the same recall but has precision 0.50. Precision describes the share of accepted outputs whose committed answer is correct. Recall describes the share of correct outputs that receive credit. Both depend on how the audit examples are sampled. The code reports an undefined rate as nan if its denominator is zero.
Training a policy against a broken verifier
Now we put a policy over these eight strategies and run policy gradient against one of the verifiers. The policy is a softmax over strategy indices, shared across all problems, which is a simplification. A real language model conditions on the prompt. With one distribution over strategies, changing the reward affects the mix of response styles applied to the entire problem set.
The reward vector for a verifier is the average payout of each strategy across all problems.
PythonIn [14]Expand
n_strategies = len(STRATEGIES)
reward_first_int = np.array(
[audit[audit.strategy == s]["first_int"].mean() for s in STRATEGIES]
)
reward_hidden = np.array(
[audit[audit.strategy == s]["hidden_correct"].mean() for s in STRATEGIES]
)
reward_table = pd.DataFrame(
{
"strategy": STRATEGIES,
"first_int_reward": reward_first_int,
"hidden_label_reward": reward_hidden,
}
)ConsoleOut [15]Expand
strategy first_int_reward hidden_label_reward
bare 1.00 1.00
sentence 1.00 1.00
cot 0.00 1.00
hedge 1.00 0.00
wrong 0.00 0.00
abstain 0.00 0.00
cot_wrong 0.00 0.00
trailing_truth 0.00 0.00The first_int reward agrees with the hidden-label reward on six of the eight strategies. It misses the correct cot and accepts the incorrect hedge. The highest-reward strategies under the first-integer verifier are bare, sentence, and hedge, each at 1.00.
The training loop applies a REINFORCE-style score-function update to the one-step bandit, using the batch’s own mean reward as its baseline. To compare rewards on this fixture, both runs start from a uniform policy and use the same seed, batch size, learning rate, and number of updates.
PythonIn [16]Expand
def softmax(z):
z = z - np.max(z)
e = np.exp(z)
return e / e.sum()
def train_bandit(objective, steps=600, lr=0.5, batch=256, seed=0):
"""Policy gradient on a tabular bandit. Returns final policy and traces.
`objective` is the per-strategy reward the policy optimizes. The traces
also record what that policy scores on the other reward signals.
"""
if batch < 1:
raise ValueError("batch must be a positive integer")
rng = np.random.default_rng(seed)
n = len(objective)
theta = np.zeros(n)
trace = {"objective": [], "first_int": [], "hidden": []}
for _ in range(steps):
p = softmax(theta)
idx = rng.choice(n, size=batch, p=p)
advantage = objective[idx] - objective[idx].mean()
grad = np.zeros(n)
np.add.at(grad, idx, advantage)
grad -= advantage.sum() * p
theta += lr * grad / batch
p = softmax(theta)
trace["objective"].append(float(p @ objective))
trace["first_int"].append(float(p @ reward_first_int))
trace["hidden"].append(float(p @ reward_hidden))
return softmax(theta), {k: np.array(v) for k, v in trace.items()}The update uses the sample mean as a baseline. The log-softmax gradient for a sampled index is the corresponding one-hot vector minus the current probability vector . This explains the grad -= advantage.sum() * p term. The centered advantages sum to zero in exact arithmetic. Each of the independent draws contributes to its own baseline, so this estimator is biased by a multiplicative factor. To see it, let be draw ’s reward and be its score-function vector. The expected reward-only gradient is . For the batch mean , the contribution of the th reward to is . Every other draw is independent of , whose expectation is zero, so the other terms vanish. Thus . In this softmax example the exact logit gradient has entries , where is strategy ’s reward. The probability factor matters when comparing an empirical gradient to the exact one.
One run uses the first-integer verifier. The other uses the hidden correctness labels as an oracle reward.
PythonIn [17]Expand
policy_verifier, trace_verifier = train_bandit(reward_first_int, seed=1)
policy_truth, trace_truth = train_bandit(reward_hidden, seed=1)
uniform = np.full(n_strategies, 1.0 / n_strategies)Let's see what each policy scores on each signal.
ConsoleOut [18]Expand
policy verifier_score true_accuracy
uniform (no training) 0.375 0.375
trained on first_int 0.994 0.503
trained on truth 0.441 0.994With seed 1 in both runs, the verifier-trained policy reaches verifier score 0.994 and expected accuracy 0.503 on the uniform mix of eight problems. Its probability of choosing hedge is about 0.492. The policy trained on hidden labels reaches expected accuracy 0.994 and verifier score 0.441. These scores average over the policy's strategy probabilities and the toy problem mix.
Reading the results
Two figures make the mechanism visible. The first shows the final policy distribution over strategies for both runs.
VisualizationOut [19]Expand

With the seed held fixed, the correct cot strategy finishes at probability 0.554 under the hidden-label objective. It finishes near 0.001 under the first-integer objective, where the checker reads an operand. In that run, hedge ends at about 0.492 even though it gives a wrong answer on every problem.
The second figure traces the verifier score and true accuracy on the two trained policies across the 600 policy gradient steps.
VisualizationOut [20]Expand

The verifier-trained run finishes near 0.99 on the verifier and 0.50 on expected accuracy. The hidden-label run finishes near 0.44 on the verifier and 0.99 on expected accuracy. Both metrics can improve over their uniform starting values while still ranking the two trained policies differently.
The same eight-strategy policy is applied to every prompt. The example uses no language model, token-level update or KL penalty. The two metrics rank the learned policies in opposite orders for this matched seed. Changing the sampling seed or learning rate can change how much probability goes to each of the three equally rewarded strategies under the flawed verifier. The size of the accuracy gap depends on that mix.
Designing Rewards in Practice
A verifier score is a design choice. Before training, inspect how it scores examples your task considers correct, incorrect or uncertain.
Compose the reward deliberately
A composite reward can combine a correctness term, a format term and penalties. Choose the weights with examples and inspect each component separately.
- Set the relative weight explicitly. If format earns as much as correctness, a wrong answer can receive substantial reward. Check whether the composite scores a correct answer with a nonstandard format above a well-formatted wrong one, when that matches your task.
- Reassess format incentives. Once responses parse reliably, compare behavior with a smaller format weight. A task may still require a formatting constraint even when formatting has become routine.
- Penalties need their own justification. Length, repetition and language-consistency terms can change which responses maximize the objective. Measure the behavior each term is meant to encourage.
Choose the comparison group
A per-prompt mean compares sampled answers against others to the same question. A batch-wide mean can mix variation in prompt difficulty with variation among answers. Different centering and scaling schemes change both the variance and, in some cases, the weighting of the update. The next chapter examines group-relative objectives.
Keep the KL anchor
Monitor verifier reward and held-out accuracy while tuning the reference penalty. Rising reward alongside falling accuracy is a reason to inspect the proxy, sample distribution and optimizer. Low divergence by itself does not establish correctness.
Handle difficulty and zero-variance groups
Groups in which all responses get the same reward contribute zero centered reward advantage in the group-mean estimator. A separate regularizer may still contribute.
- Filter zero-variance groups if omitting their reward updates fits the training plan.
- Resample at most a fixed number of times when feasible. A prompt with pass probability zero or one cannot yield both outcomes.
- Curriculum by difficulty, starting where the model succeeds sometimes.
Filtering, resampling and curricula can change the effective training distribution. Track the prompt difficulty alongside the reward to see which groups reach the optimizer.
Guard against length and format collapse
Record response length, truncation and component-level rewards. A changing delimiter rate can flag a shift in formatting. Compare it with held-out correctness before attributing the overall reward trend to better answers.
Audit the verifier like a model
A rule-based verifier encodes design choices about what to extract and how to score it. Preserve enough information to reproduce those choices and review the resulting errors.
- Maintain a labeled audit set of responses with known correctness, including adversarial ones: hedges, trailing restatements, correct-but-badly-formatted answers, abstentions, truncations.
- Report precision and recall separately. Precision uses accepted answers as its denominator, and recall uses correct answers. Report both counts so an empty group is visible.
- Re-run the audit on samples from the current policy. Keep the prompt mix and decoding protocol fixed when comparing checkpoints, and report both so readers know which responses your estimate describes.
- Inspect stratified samples of accepted and rejected outputs. Retain only examples that your data-handling policy permits storing.
Where RLVR Works, and Where It Does Not
RLVR requires a way to check the specific behavior being rewarded. Properties outside the check can require separate quality judgments.
Conditions for success
A task is a strong RLVR candidate when all of the following hold:
- Verification is practical at the rollout volume. Measure the cost of checking candidates, including failures and timeouts.
- The checked property is defined. An exact numeric answer or required schema is easier to specify than the overall usefulness of a summary.
- The verifier is tested on policy outputs. Repeat the checks on new samples as the distribution changes.
- The policy can sample passing candidates. A group-relative update based on binary outcomes needs variation within the sampled group. Look for actual pass and failure coverage before attributing stalling to the optimizer.
- Training receives useful feedback. For a centered binary group reward, all-pass and all-fail groups contribute no reward-gradient signal.
Strong domains
- Mathematics with checkable answers. Integer-answer and symbolic tasks can use checks appropriate to the answer representation.
- Code generation against tests. Execution checks provide evidence about behavior on the included cases.
- Formal mathematics. A proof checker can validate a proof relative to a formal statement and its assumptions.
- Structured output and tool calls. Schemas and grammars test structure. Validate semantics separately when required.
- Constraint-satisfying instruction following. Length limits, required elements, forbidden phrases, citation presence.
- Simulated environments. Agents in deterministic simulators where task success is measurable, with the standing risk of exploiting simulator quirks.
Weak domains
- Open-ended generation. Story and dialogue quality usually involve criteria that a simple correctness test cannot capture.
- Summarization and translation. More than one answer can be acceptable. Exact equality against one reference cannot capture all valid outputs.
- Helpfulness and harmlessness. Some criteria can be checked mechanically, while broader quality often requires judgment.
- Contested or evolving ground truth. Legal, medical, and empirical questions where the answer changes or is disputed.
- Expensive verification. A check that takes nearly as much work as producing a candidate can be costly at rollout scale.
- Long-horizon tasks with terminal scores. A single terminal reward does not identify which earlier actions contributed to success.
Limitations & Impact
RLVR can substitute a programmatic check for per-response judgments when the task supports one. The work then includes specifying the answer, testing the verifier and monitoring how the current policy interacts with it.
A finite test suite covers its exercised cases. An expression comparator has a domain. A proof kernel checks a formal statement. In each case the scope of measured correctness follows from the specification and the inputs. Track a held-out measure whose labels are separate from the training reward.
Experiments measure different effects across models and sampling budgets. Yue et al. (2025) report small- gains with comparable or lower large- pass rates in their comparisons. Shao et al. (2025) observe large gains from some spurious signals on one tested math model, with results that vary by model and reward. The negative-reinforcement study separates the contribution of penalizing sampled wrong answers from reinforcing sampled correct answers in several settings. These results concern the models, verifiers and test distributions each paper reports.
Exposure to benchmark instances during training can complicate interpretation of gains on that benchmark. Keep an estimate of overlap and use separate evaluation instances when drawing conclusions about generalization.
Summary
RLVR can use automatic checks as a reward source. Tests, answer keys and formal validators make specific properties measurable, while the choice of optimizer remains separate.
For the single-turn bandit formulation, the response is one action. The reward-only score-function estimator weights each sampled token’s score function with the same sequence advantage.
For free text, separate extraction, normalization, comparison and scoring. Define the handling of abstentions, truncation, timeouts and infrastructure faults in the scoring protocol.
The verifier score can differ from the correctness label . Audit errors on samples from the policy you intend to evaluate. The optimizer sees the reward supplied to it.
In the toy arithmetic run, a first-integer verifier accepted a hedged wrong answer and rejected a correct worked answer. With the same training seed, the verifier-trained policy ended at 0.994 verifier score and 0.503 expected accuracy. Using hidden labels as the reward gave a verifier score of 0.441 and expected accuracy of 0.994.
Track separate reward components, precision and recall, and a held-out correctness metric. For centered group rewards, monitor how often groups contain both successes and failures.
Choose verifier-based training when the property you care about is specified clearly enough to check repeatedly and to audit independently.
The next chapter applies the same distinction between reward and update to group-based policy optimization.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about reinforcement learning from verifiable rewards.
Reinforcement Learning from Verifiable Rewards
Join the discussionAsk a question or share what you learned.
Keep exploring
Reference
Citation details
Cite or share this article.


Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!