# What Is a Reward Model?

> How a reward model learns from people's picks, how it steers RLHF, and why the model can game it, explained simply for your AI interview.

**In short:** A reward model is a separate model that gives any answer a score, learned from people who picked the better of two answers. During RLHF, the main model is tuned to earn high scores. The score is only a stand-in for quality, so the main model can learn to game it.

AI and LLM interview question Q289, Fine-tuning and adaptation. Intermediate, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-a-reward-model

## Say it in 30 seconds

A reward model is a scorer. People compare two answers to the same question and pick the better one, and the reward model learns to predict those picks. Then a language model is tuned to earn high scores, which is how RLHF (learning from human feedback) teaches it to behave the way people prefer. The catch is that the score is only a proxy, so the model can learn to please the scorer instead of the person. In a job, I'd keep human checks in the loop and limit how far the model drifts from where it started.

## Say it in 2 minutes

Think of a senior claims reviewer who reads two draft letters to a customer and picks the better one. After thousands of picks, a junior can guess the reviewer's choice. A reward model is that junior for AI answers. It takes an answer and gives it one number, and a higher number means people would more likely prefer it.

Teams train it on pairs. Labellers rank several answers to the same prompt, and each ranking is split into pairs. The reward model is trained to give the picked answer a higher score than the rejected one. In InstructGPT, the reward model started from a GPT-3 model, and its output layer was swapped for one that gives a single number.

Then comes reinforcement learning. The main model writes an answer, the reward model scores it, and the main model is nudged toward higher scores. That is RLHF. The danger is the proxy. A score is only a stand-in for what people want, so the main model can learn shortcuts that earn points without being right, like the longer drafts in the worked case below.

In an interview I'd say the reward model is a learned judge, that its limits come from its training data, and that I would keep human checks, measure real outcomes, and add a penalty for drifting too far from the starting model.

## What is a reward model, in plain words?

A reward model is a scorer. You give it a question and one answer, and it gives back a single number. A higher number means people would be more likely to pick that answer.

Nobody types those numbers in by hand. People compare two answers to the same question and pick the better one. The reward model learns from thousands of those picks, so it can score answers it has never seen.

Think of a senior claims reviewer who reads two draft letters to a customer and picks the better one. After a few thousand picks, a junior can guess the reviewer's choice without asking. The reward model is that junior, for AI answers.

Take a mid-size insurer that uses an AI model to draft replies to claimants. Its staff rank pairs of drafts, 30,000 pairs in all (made-up numbers), and a reward model learns from those picks. The team then uses its scores to tune the drafting model.

- **Reward model:** The scorer. It gives an answer one number, learned from people's picks.
- **Preference pair:** Two answers to the same prompt, plus a person's pick for the better one.
- **Policy:** The main model being tuned. In the insurer's case, the drafting model.
- **RLHF:** Reinforcement learning from human feedback: tuning a model toward higher scores.
- **Proxy:** A stand-in measure. A score is a proxy for what people actually want.

## How does a reward model learn from the picks?

Training follows one rule. For each pair, the picked answer should get a higher score than the rejected one. The training code measures how far the scores are from that goal, and adjusts the model to shrink the gap.

1. **Collect the picks:** Labellers read two drafts for the same claim and pick the better one.
2. **Train the scorer:** Push the picked draft's score above the rejected one's. The loss is a number that says how wrong the scorer is, and training pushes it down.
3. **Tune the main model:** Use the scorer as the reward in reinforcement learning, where the model tries answers and keeps what scores well. The model writes, the score comes back, and it shifts toward higher scores.

The InstructGPT paper from OpenAI follows that order. It collects comparisons, trains a reward model on them, then optimises the main model against it. The paper's loss takes the gap between the two scores and turns it into a penalty: the bigger the gap in the wrong direction, the bigger the penalty. It runs the gap through a sigmoid (an S-shaped curve that squashes any number into a value from 0 to 1), then takes the negative log of that, which is large when the value is small.

> "We then train a reward model (RM) on this dataset to predict which model output our labelers would prefer." (InstructGPT paper)

Here is that loss in plain Python, with made-up scores for three pairs of claim letters, before and after training.

```python
# A reward model scores claim letters. Made-up scores: (score for the letter people preferred, score for the rejected one).
import math

def pair_loss(preferred, rejected):
    # Small when the preferred letter scores clearly higher, large when it does not.
    return -math.log(1 / (1 + math.exp(-(preferred - rejected))))

before = [(0.2, 0.3), (0.5, 0.4), (0.1, 0.2)]
after = [(2.1, 0.4), (1.6, 0.9), (1.2, 0.3)]

for name, pairs in [("Before training", before), ("After training", after)]:
    losses = [pair_loss(p, r) for p, r in pairs]
    right = sum(p > r for p, r in pairs)
    print(f"{name}: average loss {sum(losses) / len(losses):.3f}, ranked right {right} of {len(pairs)}")
```

Output:

```text
Before training: average loss 0.711, ranked right 1 of 3
After training: average loss 0.304, ranked right 3 of 3
```

The numbers are made up, but the shape is real. Before training, the scorer ranks only 1 of 3 pairs the right way round, and its average loss is 0.711. After training it ranks all 3 right, and the loss drops to 0.304.

*Diagram, How a reward model gets its job: Staff pick between two drafts, and each pick trains the reward model. The reward model scores drafts, the drafting model is tuned to earn those scores, and agents accept more of its drafts.*
1. Staff rank pairs of drafts, and each pick becomes training data.
2. The scores become the reward that tunes the drafting model.
3. The tuned model writes drafts that agents accept more often.

## Where does a reward model go wrong?

A reward model is a proxy. It is a learned guess at what people prefer, built from a limited set of picks by a limited set of people. The main model is tuned to beat that guess, and it can find shortcuts that score well without being better.

> "Because the reward model is an imperfect proxy, optimizing its value too much can hinder ground truth performance, in accordance with Goodhart's law." (Gao and colleagues, 2022)

Gao and colleagues study this as overoptimization, in a synthetic setup where a gold-standard reward model stands in for humans. Pushing too hard on the proxy can make real quality fall. Two common ways it goes wrong are below.

- **Gaming the score:** In our worked case below, the score rewarded longer, more confident drafts.
- **Narrow taste:** The scorer only knows the people and prompts it was trained on, so new kinds of answers may be scored badly.

A scorer can also overfit its picks. InstructGPT's team noticed that comparisons from one labelling task are very correlated, so a single pass over them as one dataset made the reward model overfit. Training for more epochs still helped its scores and ratings, despite that overfitting.

A worked case. The insurer's drafting model learned from its 30,000 pairs. After four rounds of tuning, the average draft grew from 180 words to 410 words. The reward score rose from 0.62 to 1.04, but agents accepted only 52% of drafts, down from 71% (made-up numbers). The score had learned that long, confident letters look thorough.

*Diagram, How a reward model gets gamed: The drafting model writes what the scorer rewards, so the score climbs while quality falls. The fix pulls it back with a penalty for drifting and with fresh human checks.*
1. The drafting model writes what the scorer rewards.
2. In the worked case, length raised the score, so it climbed.
3. The team adds a penalty and human checks to pull the model back.

The fix has three parts. First, a KL penalty: a cost that grows the further the model drifts from the starting model. InstructGPT added one per token to mitigate over-optimisation of the reward model. Second, fresh human checks on samples of new drafts each week. Third, retraining the scorer on those new picks. A 2022 paper on helpful and harmless assistants describes updating both the reward model and the RL policy on a weekly cadence with fresh human feedback.

### How would you keep a reward model useful after launch?

Treat the scorer as a model that ages. Measure real outcomes, such as agent acceptance and complaint rates, not only the score. Keep a sample of drafts that humans read every week, and compare them with the scores. When the two drift apart, collect new picks and retrain the scorer before the main model learns the gap.

> **Tip:** Say it plainly: the score is a tool for training, and the business metric decides whether the model is working.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: a model that scores answers, learned from people's picks.
- [ ] How it is trained: pairs, a higher score for the picked answer, then RL.
- [ ] Why it matters: it steers RLHF toward what people prefer.
- [ ] Its limit: it is a proxy, and the main model can game it.
- [ ] Fixes: a KL penalty, human checks and retraining on fresh picks.

**Common traps**

- Trap: "A reward model is the AI that answers the user." Better: It scores answers. The language model writes them, and the reward model only grades.
- Trap: "A high score means the answer is correct." Better: It means people would likely pick it. That can drift from correct, so check outcomes too.
- Trap: "Once trained, the reward model never needs updating." Better: Its taste comes from old picks. Retrain it on fresh picks as the task and users change.

## Can you spot the gaming?

**Spot the gaming:** Which weekly log shows the drafting model gaming its reward model?

A. reward 0.62 | avg words 180 | agents accept 71%
B. reward 1.04 | avg words 410 | agents accept 52%
C. reward 0.71 | avg words 240 | agents accept 74%
D. reward 0.48 | avg words 175 | agents accept 69%

**Answer:** B. The score and the length climb while agents accept fewer drafts. The scorer is rewarding length, so add a KL penalty and a human check.

**Quick check:** Which fix best stops the drafting model drifting far from where it started while it chases the score?

A. A bigger reward model
B. A penalty for drifting from the starting model (a KL penalty)
C. A higher learning rate
D. Dropping the human checks to save time

**Answer:** B. A KL penalty charges the model for drifting from its start, which limits over-optimisation. InstructGPT added one for this reason. A bigger scorer does not add that limit, and dropping human checks removes the way to notice gaming.

## Can you answer these from memory?

**Flash cards**

- **What is a reward model?** A model that gives any answer a score, learned from people's picks of better answers.
- **What data trains it?** Pairs of answers to one prompt, with a human pick for the better one.
- **What is it used for?** As the reward in RLHF, to tune the main model toward higher-scoring answers.
- **What is reward hacking?** The model earns high scores without being better, like writing longer text.
- **What is its main limit?** It is a proxy: a learned guess at people's taste, limited by its training picks.
- **A common fix?** A KL penalty to stay near the starting model, plus fresh human checks.

## Likely follow-up questions

- Q288 What is RLHF? https://designervenkat.online/interview/ai/what-is-rlhf
- Q290 What is PPO in RLHF, simply? (full answer coming)
- Q291 What is DPO? https://designervenkat.online/interview/ai/what-is-dpo
- Q292 What is RL from verifiable rewards? https://designervenkat.online/interview/ai/what-is-rl-from-verifiable-rewards
- Q293 What is distillation? https://designervenkat.online/interview/ai/what-is-distillation
- Q297 How do you spot overfitting during fine-tuning? https://designervenkat.online/interview/ai/how-do-you-spot-overfitting-during-fine-tuning

## Learn it in depth

- [Learning from rewards, not answers](https://designervenkat.online/learn/machine-learning/reinforcement-learning)
