Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Handbooks  /  RLVR
Reasoning Training~16 min readAdvanced
The technique

Reward what you can check, not what sounds good.

The leap in reasoning models came from a deceptively simple idea: stop training on a learned model of human taste, and start training on rewards you can verify — a unit test that passes, a math answer that matches. RLVR is why DeepSeek R1 could teach itself to reason. Here’s how it works, why verifiability is the whole point, and where it runs out.

01

What RLVR is

RLVR — reinforcement learning from verifiable rewards — trains a language model with RL, where the reward for an output comes from an automatic, objective check rather than a human or a learned model. Did the generated code pass the tests? Does the final math answer equal the known result? Is the output in the required format? Reward = 1 if yes, 0 if no. The model generates, gets scored by the checker, and is nudged toward whatever raised its score.

That’s the entire trick, and it’s powerful precisely because the reward is grounded in reality. There is no reward model to fool, no rater to charm — only a verifier that is right by construction. It is the training method behind the current generation of reasoning models: give a model checkable problems, reward correct final answers, and let it figure out how to get there.

→ The core claim

If you can automatically check whether an answer is right, you can turn that checker into a reward — and RL will find reasoning strategies that make the checker say “right” more often. No step-by-step labels required.

02

Why verifiable, and not RLHF?

RLVR is best understood against the method it complements: RLHF, reinforcement learning from human feedback.

RLHF trains a reward model to imitate human preferences, then optimizes the policy against that learned reward. It’s how models were aligned to be helpful and harmless — but it has a structural weakness: the reward model is an approximation of what humans like, and the policy will happily exploit its errors. That’s reward hacking — the model learns to produce outputs the reward model scores highly but humans don’t actually want (sycophancy, confident-sounding nonsense, gaming length or format).

RLHF (learned reward)RLVR (verifiable reward)
Reward sourceModel trained on human preferencesProgrammatic check of the output
Gameable?Yes — exploit the reward model’s errorsVery hard — a test either passes or it doesn’t
Cost per labelExpensive human annotation~Free once the checker exists
SignalDense, subjective, noisySparse, objective, clean
Best forTaste, tone, safety, open-ended qualityCorrectness — math, code, logic, format

The trade is subjectivity for verifiability. RLVR gives up the ability to reward “nice writing” and gains a reward that can’t be charmed. Because the signal is honest, you can crank the RL much harder without the model drifting into convincing-but-wrong territory — which is exactly what you need to push reasoning. The two are complementary: many production models use RLVR for reasoning skills and preference-based methods for tone and safety.

03

The training loop

Mechanically, RLVR is a standard policy-optimization loop with a verifier standing in for the reward function.

One RLVR update
1 · PromptDraw a problem with a known-checkable answer (a math problem, a coding task with tests).
2 · RolloutThe policy samples one or many full responses, each including its chain of thought and a final answer.
3 · VerifyRun the checker: execute the tests, compare the answer, validate the format. Reward = pass/fail (± shaping).
4 · AdvantageCompare each sample’s reward to the group’s average — better-than-average answers get pushed up.
5 · UpdatePolicy-gradient step (PPO / GRPO), with a KL penalty to a reference model so it doesn’t drift or degrade.
Repeat over millions of problems. The checker is the only teacher.

A key practical detail is how the advantage is estimated. PPO uses a separate value network; DeepSeek’s GRPO (Group Relative Policy Optimization) skips it — it samples a group of responses per prompt and uses their mean reward as the baseline, which is cheaper and fits the sparse pass/fail signal well. The KL penalty to a frozen reference keeps the model from collapsing into degenerate high-reward text or forgetting its general ability while it learns to reason.

Reward design stays deliberately simple: a correctness reward (the answer is right) plus, often, a small format reward (the reasoning is delimited, the answer is where expected). Simplicity is a feature — every knob you add is a new thing the policy can hack.

04

What emerges — the R1 story

The striking finding is what the model learns without being told to. In DeepSeek’s R1-Zero experiment, RLVR was applied to a base model with no supervised reasoning examples at all — pure RL on verifiable math and code. Over training, two things emerged on their own:

Reasoning length grew

  • The model spontaneously started producing longer chains of thought as training progressed.
  • Longer thinking correlated with higher accuracy — it learned that spending test-time compute pays.
  • No one specified how long to think; the reward selected for it.

Self-correction appeared

  • “Wait — let me reconsider” style backtracking emerged (the so-called aha moment).
  • The model learned to re-examine a step and fix its own mistakes mid-solution.
  • These are behaviors of a reasoner, discovered because they raise the pass rate.

R1-Zero had rough edges (messy, sometimes language-mixed output), so the full R1 recipe added a small cold-start supervised phase for readability, then RLVR, then a final polish — the RL is where the reasoning ability comes from; the SFT bookends make it usable. The headline is that reasoning is not hand-crafted; it’s an emergent solution to “get the answer right.”

05

Where it works — and where it breaks

RLVR is bounded by one thing: you need a cheap, reliable verifier. That draws a sharp line across problem types.

DomainVerifierRLVR fit
MathCompare to known answerExcellent
CodeRun unit testsExcellent
Formal logic / proofsProof checkerStrong (where formalized)
Structured extractionSchema / exact-matchGood
Open-ended writing, taste, safetyNo objective checkPoor — use preference methods

Even where a verifier exists, RLVR has failure modes worth respecting. Verifier gaming: a model can pass weak tests without solving the problem (hardcoding an output, exploiting a loose checker) — your reward is only as good as your checker. Reward sparsity: on very hard problems the model almost never gets a positive reward early, so training stalls without curriculum or partial credit. And a subtle one — RLVR mostly sharpens and elicits abilities the base model already latently has, rather than teaching brand-new knowledge; it makes a model reason better, not know more.

→ The extend-verifiability frontier

Much current work is about widening where RLVR applies — using LLM judges, generative verifiers, or rubric-based checkers to create verifiable-ish rewards for softer domains. The more reliably you can check an answer, the more of the world RLVR can teach a model to reason about.

06

Why this matters for builders

You may never run an RLVR loop yourself, but it shapes how you use the models it produces.

  • It explains reasoning models’ strengths. They’re disproportionately good at exactly the checkable tasks RLVR trains on — math, code, logic — and no better at pure recall. Route work accordingly.
  • Verifiers are leverage for you too. The same generate-and-verify logic works at inference: if you can check outputs (run the tests, validate the schema), you can sample more and keep the ones that pass — RLVR’s idea applied at test time.
  • It’s why open reasoning models caught up fast. RLVR is data-efficient in human labels — the checker replaces annotators — which lowered the barrier to training strong reasoners and is part of why capable open models appeared quickly.
Related concepts
RLHF Reward hacking GRPO / PPO Process reward models Chain-of-thought KL regularization
By the numbers

Worked example: one GRPO group, step by step

One prompt, “What is 17 × 24?”, with a known answer of 408. The policy samples a group of six responses. The verifier reads only the final boxed answer and checks the reasoning is inside think tags. Say correctness is worth 1 and format 0.1. The group’s mean reward is 0.583 and its standard deviation 0.485; each advantage is (reward − mean) / std.

SampleFinal answerTags?CorrectFormatRewardAdvantage
1408yes10.11.1+1.07
2418 (slip in a partial product)yes00.10.1−1.00
3408no101.0+0.86
4384yes00.10.1−1.00
5“408? or maybe 480”, boxes 480yes00.10.1−1.00
6408yes10.11.1+1.07

The update raises the probability of samples 1, 3 and 6 and lowers the rest, in proportion to those advantages. Sample 3 is right but untidy, so it is pushed up slightly less than 1 and 6: the format reward is a nudge, not a gate. Now swap in a loose checker that accepts the answer if “408” appears anywhere in the text. Sample 5 scores 1.1, the group mean rises to 0.75, and its advantage flips from −1.00 to +0.76. The policy is now being taught to hedge by listing several answers. One sloppy line in the verifier changed what the model learns, which is the whole case for keeping checkers strict. And if all six had been right, every reward would be equal and every advantage zero: a solved prompt teaches nothing.

Trade-offs

Reward sources compared: cost and trade-offs

Here Time means what each reward costs per scored sample, and Space means what has to exist before training can start.

CaseTimeSpaceWhy
Verifiable reward (RLVR)A test run or an answer comparison; cheap and deterministicA checker and problems with known answersClean and hard to game, but sparse, and only where a checker exists.
Learned reward model (RLHF)One forward pass of the reward modelHuman preference labels, then a trained reward modelCovers taste and tone; the policy exploits its errors if pushed hard.
Process reward modelA score per reasoning stepStep-level labels, which are expensive to collectDenser credit than pass/fail, but a learned model again, so gameable again.
Rubric + LLM judgeA judge call per sampleRubrics, plus human labels to check the judgeStretches RLVR towards softer domains; precision has to be measured, not assumed.
PPO vs GRPO baselinePPO: a value network forward pass. GRPO: several samples per promptPPO trains a second network; GRPO trains noneGRPO trades memory for extra rollouts, which suits a cheap pass/fail verifier.

The columns explain the pattern in the page’s domain table. RLVR is cheapest per label and most honest, but it needs the most structure up front: a problem with one checkable answer. Every step down the table buys reach into softer tasks by putting a learned model back between the output and the reward. Pick the highest row your task can honestly support.

In the wild

Where this shows up in production and interviews

  • Generate and verify at inference

    Code tools that run the tests before showing a patch, and pipelines that validate output against a JSON schema and retry on failure, are the RLVR idea at test time. If a single sample passes 30% of the time and samples are independent, 8 samples give at least one pass 94.2% of the time.

  • Choosing a model for a task

    Reasoning models trained with verifiable rewards are strongest on checkable work: math, code, logic, structured extraction. For recall or tone, a reasoning model is not automatically better, and it bills for its thinking tokens.

  • Your eval suite is a verifier

    The tests and answer keys a team writes to evaluate a model are exactly what RLVR would train on. A weak eval that a hard-coded output can pass is the same hole that becomes verifier gaming in training.

  • Interview angle

    Expect “why can’t you use RLVR to train summarisation?” (no objective checker; you would be back to a learned judge) and “what happens when every sample in a group fails?” (zero advantage, no update; use curriculum, filtering or partial credit).

Self-check

Check yourself

A model passes a coding task’s tests on 30% of single samples. You sample 8 and keep any that pass. How often do you get a working answer? What if single-sample accuracy is 5%?

Assuming independent samples, 1 − 0.7 to the 8th power ≈ 94.2%. At 5% it is 1 − 0.95 to the 8th ≈ 33.7%. A verifier turns extra samples into accuracy, but only when the base pass rate is not tiny, the same reason RLVR stalls on problems the model almost never solves.

Every one of 8 samples on a hard prompt is wrong. What does GRPO learn from that prompt?

Nothing. All rewards are equal, so every advantage is zero and the gradient vanishes, while the rollouts still cost compute. Fixes are easier curriculum problems, dropping such prompts from the batch, or partial credit that separates nearly-right from wrong.

You want to train text-to-SQL with RLVR by running the generated query and comparing results with the expected rows. Where can this verifier lie?

A wrong query can return the right rows on a small test database, for example one that forgets a filter no test row needs. That is a false positive. Use test data where the wrong queries return different rows, or several databases per question.

Training-set accuracy climbs from 40% to 70% but a held-out benchmark stays flat. Name two explanations to check.

Verifier gaming: read high-reward samples for answers that pass the checker without solving the task. Or overfitting to the training distribution: the skill is narrow, so check whether held-out problems resemble the training ones. RLVR mostly sharpens what the base model already has, so a big held-out jump was never guaranteed.

Frequently asked

Quick answers

What is RLVR?

Reinforcement learning from verifiable rewards: RL where the reward comes from an automatic, objective check of the output — a unit test passing, a math answer matching, a format being valid — rather than a learned reward model or human preference. It’s the core technique behind modern reasoning models like DeepSeek R1.

How is RLVR different from RLHF?

RLHF rewards outputs with a reward model trained on human preferences, which can be gamed and is costly to label. RLVR replaces that with a programmatic verifier that checks correctness. The reward is sparser but far harder to game, which lets you scale RL on reasoning without the model learning convincing-but-wrong answers.

Why do reasoning behaviors emerge from RLVR?

When the only reward is a correct final answer, the model is free to discover whatever process raises its success rate. Optimizing that causes longer chains of thought, self-checking, and backtracking to emerge on their own — R1-Zero showed reasoning length and self-correction growing during pure RL, with no step-level supervision.

What are the limits of RLVR?

It only applies where a cheap, reliable verifier exists — math, code, formal logic, structured tasks. Open-ended writing and judgment have no objective checker and still need preference methods. Verifiers can also be gamed (weak tests, format exploits), reward is sparse, and RLVR mostly elicits latent ability rather than adding new knowledge. Put that verifier inside a loop that trains on its own output and it stops being plumbing: self-improving agents works through the two ways a verifier is wrong, and which one a loop actively hunts.

RLVR: Reinforcement Learning from Verifiable Rewards · a Vibe Engines handbook · 2026
Finished this one? 0 / 209 Handbooks done
NextRL Environments Engineering Next on the “Training and adaptation” ladder · rung 7 of 7

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Handbooks