RLVR: how to write problems a program can check
For companies4 min read
RLVR stands for reinforcement learning with verifiable rewards. Instead of asking people which answer they prefer, a program checks the answer and returns a reward. That works only if the problem has a clear correct result and a checker that cannot be fooled. Writing both well is the work.
What RLVR is
The Tulu 3 paper names Reinforcement Learning with Verifiable Rewards as a method used in its training recipe, alongside supervised fine-tuning and Direct Preference Optimization. The reward comes from a program, not a human rater, so each problem needs a checkable answer.
Source: Tulu 3: Pushing Frontiers in Open Language Model Post-Training(opens in a new tab)
What makes a problem checkable
| Domain | Checkable form | Checker |
|---|---|---|
| Maths | A single final value or expression | Compare to reference, with a tolerance |
| Code | A function with a defined signature | Run unit tests |
| Data tasks | Query that returns a table | Compare result sets |
| Logic puzzles | A valid assignment | Verify constraints |
| Formatting rules | Output follows a pattern | Parse and validate |
The point is that a program can say yes or no without a person. Anything that needs taste, such as tone or persuasiveness, does not belong here.
Writing a good problem
- State the task precisely, with inputs, outputs and units.
- Make sure there is one correct result or a well-defined set of them.
- Write the reference solution and run it.
- Write the checker and test it against the reference and against wrong answers.
- Try to break it: look for a wrong answer that passes.
A small example
# Problem: return the median of a list of numbers.def check(candidate): cases = [([1, 3, 2], 2), ([4, 1, 3, 2], 2.5), ([7], 7), ([-1, -5], -3)] for data, expected in cases: try: if not candidate(list(data)) == expected: return 0 except Exception: return 0 return 1This checker passes copies of the input so a candidate cannot modify the originals, and treats an exception as a failure. It still has gaps: it does not test large inputs or time limits. Extending a checker like this is part of a reviewer's job.
Reward hacking
A model trained against a checker will find shortcuts the author did not think of. It may print the expected outputs, hard-code the test cases or exploit a loose comparison. Protect against this.
- Hide test cases from the prompt and add hidden ones.
- Use randomised inputs where possible.
- Run the candidate in a sandbox with time and memory limits and no network.
- Check that wrong-but-plausible answers score zero.
- Read a sample of high-reward outputs for tricks.
Difficulty matters
If the model solves every problem, there is no learning signal. If it solves none, the same. Aim for a range, with many problems the current model solves sometimes. Tag each problem with difficulty and track the pass rate of your current model so you can drop the extremes.
Reviewing problem sets
- A second expert solves the problem independently and compares with the reference.
- Another reviewer tries to write a wrong answer that passes.
- A run on a few existing models shows if the problem is too easy or the checker is off.
- Dedupe against public benchmarks to avoid training on test sets.
Compared with preference data
Verifiable problems give cleaner signal in narrow areas such as maths and code, and cost less to score. They cannot cover open-ended writing or judgement, where preference data remains the tool. Most projects use both.
Review checklist for each problem
- The statement has one reading. Two solvers would answer the same thing.
- The reference answer has been produced by an independent solver, not just the author.
- The checker accepts every correct form, such as 0.5 and 1/2, if both are allowed.
- The checker rejects near misses, such as off-by-one results.
- The tests run quickly and do not depend on the time or network.
Reviewers should write at least one deliberately wrong solution for each problem and confirm that the checker scores it zero. This is a quick test that finds many weak checkers.
Metadata to keep
Store the topic, difficulty, author, reviewer and the pass rate of your reference model next to each problem. When training goes wrong later, you will want to filter by these fields, for example to remove every problem from one author whose checkers turned out to be loose.
Start small
Write twenty problems in one area, build and test the checkers, then train or evaluate on them before you commission a thousand. The first twenty will show which kinds of problem have weak checkers and which writers produce clean ones. It is much cheaper to learn that on twenty items than on a full set.
Experts on Curatrain write problems a program can check (RLVR), including reference solutions, and engineers and maths specialists are vetted with skill tests before they are matched to jobs.