# Reward model

> Canonical: https://skillalmanac.com/glossary/reward-model | Last verified: 2026-11-25 | Index status: index-eligible

A reward model predicts a scalar reward for an agent's behaviour from relevant inputs. In language-model RLHF, it commonly scores candidate responses according to learned human preferences, and that score guides reinforcement-learning updates.

Also called: reward models.

## In plain language

A reward model is a learned scoring function used when success is difficult to write as a fixed rule. In language-model RLHF, people compare responses to the same prompt and the model learns to predict those preferences. Reinforcement learning then adjusts the language model toward responses with higher predicted reward. The learned score reflects the supplied evaluators and criteria, not objective truth: reviewers may disagree or be wrong, and collecting their feedback is costly.

## Technical definition

A reward model approximates a reward function with a learned scalar score. In the InstructGPT pipeline, labelers ranked multiple outputs for a prompt; a reward model was trained to predict which output labelers would prefer, then used as the reward function for PPO fine-tuning. This optimizes behaviour toward the preferences represented by those comparisons, not a universal notion of human values. [DPO](/glossary/dpo) instead solves the standard preference-optimisation problem with a classification loss without first fitting a separate reward model and then running PPO.

## How it shows up when you use agents

In the published InstructGPT workflow, a reward model trained from human preference comparisons supplies a signal for [RLHF](/glossary/rlhf) training. This is a documented language-model example, not evidence about the internals of every coding assistant.

Scoring can also be used during generation-time selection. The versioned TRL v0.23.0 documentation demonstrates a BestOfNSampler: generate several candidate responses, score them with a reward pipeline, and return the top-scoring candidate or candidates. This is a concrete historical implementation example, not a claim that the same API exists in every current TRL release or that a particular commercial assistant uses it.

What breaks when this is misunderstood: a high model score is treated as a verified answer. A learned score reflects the objective and training evidence used to build the scorer. For a preference-trained reward model, it estimates preference rather than independently proving correctness. Test the behaviour you need on suitable cases, including examples that could exploit the scorer's weaknesses. The [reinforcement learning](/glossary/reinforcement-learning) page explains how a reward signal can guide a policy.

## Common confusions

- **Reward model versus generator.** A reward model assigns scores to the inputs it was designed to evaluate; a generator proposes outputs or actions. These are roles, not necessarily unrelated neural architectures. The text-scoring reward model used in language-model RLHF is one application.
- **Reward model versus LLM-as-a-judge.** In the common preference-learning setup, a reward model is trained to assign scores from comparison data. An [LLM-as-a-judge](/glossary/llm-as-a-judge) is often a language model prompted with evaluation criteria. Neither role guarantees a correct judgment.
- **Reward model versus DPO.** The original [DPO](/glossary/dpo) algorithm learns a policy from preference pairs without separately fitting an explicit reward model. This does not turn preference labels into verified facts.
- **High reward versus truth.** A high score means the scorer rates an input highly under its learned objective. For a preference-trained scorer, preferred wording can still contain a factual error.

## Worked examples in this catalogue

### [What Is an LLM? The Facts Agent Users Need](https://skillalmanac.com/learn/what-is-an-llm-for-agent-users)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide explains the model from an agent user's point of view: what goes into the context window, how per-token pricing works and which errors the API returns.

Why it exercises the concept: A reward model shapes how a chat model behaves before you ever call it, but the guide covers the part you control: what you send and what you pay. It does not explain reward models themselves.

### [llm-eval-test-sets](https://skillalmanac.com/skills/skill-almanac/llm-eval-test-sets)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An eval dataset for an LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.

Why it exercises the concept: A learned preference score is not a test of your task. This skill builds your own graded cases, so you check the behaviour you care about instead of trusting the model's tuning.

### [skill-authoring-and-evals](https://skillalmanac.com/skills/skill-almanac/skill-authoring-and-evals)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A SKILL.md written from what a plain agent gets wrong, then checked with trigger evals and with-versus-without evals.

Why it exercises the concept: It is a small, hand-built version of the same idea: compare outputs with and without a change and judge which is better. It is not a reward model and trains nothing.

## Related terms

- [Reinforcement learning from human feedback (RLHF)](https://skillalmanac.com/glossary/rlhf.md)
- [Reinforcement learning](https://skillalmanac.com/glossary/reinforcement-learning.md)
- [Direct preference optimization (DPO)](https://skillalmanac.com/glossary/dpo.md)
- [AI alignment](https://skillalmanac.com/glossary/ai-alignment.md)
- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Fine-tuning](https://skillalmanac.com/glossary/fine-tuning.md)

## Sources

- [Best of N sampling (TRL v0.23.0 documentation)](https://huggingface.co/docs/trl/v0.23.0/best_of_n), Hugging Face (accessed 2026-11-25)
- [Training language models to follow instructions with human feedback](https://arxiv.org/abs/2203.02155), arXiv (Ouyang et al.) (accessed 2026-11-25)
- [What is reinforcement learning from human feedback (RLHF)?](https://www.ibm.com/think/topics/rlhf), IBM (accessed 2026-11-25)
- [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://arxiv.org/abs/2305.18290), arXiv (Rafailov et al.) (accessed 2026-11-25)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
