---
title: "Verifier"
url: https://www.daytona.com/compute-glossary/reinforcement-learning/verifier
---

# Verifier

Part of the [Compute Glossary](https://www.daytona.com/compute-glossary.md), section [Reinforcement learning](https://www.daytona.com/compute-glossary/reinforcement-learning.md).

Also called Reward function, Grader.

A verifier is a program that checks the result of a [rollout](https://www.daytona.com/compute-glossary/reinforcement-learning/rollout.md) and turns it into a reward. It answers a narrow question, such as whether the tests pass or whether the final answer matches the expected one. The reward is usually a number, often one for success and zero for failure. Training then favors the actions that led to high rewards.

A reward is the only thing the model learns from in [reinforcement learning](https://www.daytona.com/compute-glossary/reinforcement-learning/reinforcement-learning.md). Everything the verifier checks, the model is pushed to achieve, and everything it ignores, the model is free to neglect. A verifier that checks only part of a task produces a model that solves only that part. Writing the verifier is therefore as important as choosing the tasks.

Some rewards are hard to compute exactly with ordinary checks, such as whether an essay is clear or an answer is helpful. Those rewards come instead from a reward model, a separate model trained to predict which output a person would prefer. A reward model can be fooled more easily than a test suite. Tasks with checkable results are popular in training for that reason.

## Verifiable rewards

Verifiable rewards are rewards that a program can compute exactly from the result. A math problem has a known answer, and code either passes its tests or does not. Training on such rewards is called reinforcement learning with verifiable rewards, or RLVR. It avoids the cost and the drift of a learned reward model.

Code tasks are well suited to verifiable rewards. The verifier runs the project's tests, or hidden tests written for the task, against the code the model produced. Tests that pass earn the reward, and tests that fail or crash earn nothing. Some verifiers give partial credit for the fraction of tests that pass.

A verifiable reward is still only as good as the check behind it. Weak tests let code pass that does not really work. Answers can match the expected format while being wrong in ways the check does not see. Good tasks use thorough, hidden tests and check that the solution is not simply copying them.

## Verifiers in sandboxes

Verifiers in sandboxes run the checks inside the same isolated machine as the rollout. The code the model wrote has to run before it can be tested, and it is [untrusted code](https://www.daytona.com/compute-glossary/agents/untrusted-code.md) like any other. Running it on the trainer's own machines would put those machines at risk. The [sandbox](https://www.daytona.com/compute-glossary/sandboxes/sandbox.md) already holds the project and its dependencies, so the tests can run where the work was done.

The model must not be able to change the verifier. If the tests live in the same environment, the model could edit them, delete them, or read the expected answers. Verifiers therefore often copy their tests in only after the rollout ends, or run them in a fresh copy of the environment. [Isolation](https://www.daytona.com/compute-glossary/sandboxes/isolation.md) between the model's work and the checks is what keeps the reward honest.

Running tests can take longer than the rollout itself, so verification adds to the cost of training. Large test suites need processors and memory of their own. Some tasks also need services such as a database to run their tests. A verifier has to finish within a time limit, so a broken solution that hangs cannot stall training.

## Related terms

- [Reward hacking](https://www.daytona.com/compute-glossary/reinforcement-learning/reward-hacking.md)
- [Rollout](https://www.daytona.com/compute-glossary/reinforcement-learning/rollout.md)
- [Environment](https://www.daytona.com/compute-glossary/reinforcement-learning/environment.md)
- [Untrusted code](https://www.daytona.com/compute-glossary/agents/untrusted-code.md)
- [Isolation](https://www.daytona.com/compute-glossary/sandboxes/isolation.md)
