Reinforcement Learning from Verifiable Rewards › Anatomy of a Verifier

Michael BrenndoerferNovember 29, 20265 min read
Language AI HandbookAll chapters
Part 40 of 67Reasoning Post-Training and Verifiable Rewards
Chapter 300Reinforcement Learning from Verifiable Rewards › Anatomy of a Verifier
Reading section 4 of 12 · Anatomy of a Verifier · 5 minSection 4 of 12 · 5 min

Section 4 of 12 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

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 after Answer:. 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" matches 42.
  • 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.333 and 1/3 into numeric values.
  • Set and ordering normalization, for answers that are collections.
  • Symbolic simplification, so 2(x+1) matches 2x+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 ϵ\epsilon. Choose an absolute or relative tolerance based on the range of answers. With an absolute tolerance of 10−310^{-3} around 1/31/3, 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 11 when the comparison passes and 00 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.

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!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy