reward model
**Reward Modeling** is the **process of training a neural network to predict human preferences between AI outputs** — serving as the critical bridge between raw human feedback and scalable reinforcement learning (RL) optimization, where a reward model (RM) learns to score outputs such that higher-scored completions align with what humans actually prefer, enabling RLHF, DPO, and other alignment methods to optimize language models toward helpfulness, harmlessness, and honesty without requiring human evaluation of every single output.
**Why Reward Models Are Needed**
```
Problem: Can't run RL with a human in the loop for every training step
- RL needs millions of reward signals
- Humans can label ~1000 comparisons/day
Solution: Train a reward model as a proxy for human judgment
- Collect 50K-500K human preference comparisons
- Train RM to predict preferences
- Use RM to give reward signal for RL training
```
**Reward Model Architecture**
```
[Prompt + Response] → [Pretrained LLM backbone] → [Final hidden state]
↓
[Linear head] → scalar reward r
Training:
Given (prompt, response_win, response_lose):
Loss = -log(σ(r_win - r_lose)) (Bradley-Terry model)
Maximize: RM rates human-preferred response higher
```
**Training Pipeline**
| Step | Description | Scale |
|------|------------|-------|
| 1. Generate | Sample pairs of responses from policy LLM | 100K-1M pairs |
| 2. Annotate | Human annotators choose preferred response | 50K-500K comparisons |
| 3. Train RM | Fine-tune LLM with preference head | 1-3B to 70B params |
| 4. Validate | Check RM accuracy on held-out comparisons | Target: 70-80% |
| 5. Deploy | Use RM as reward signal in PPO/GRPO | Millions of RL steps |
**Reward Hacking**
| Failure Mode | What Happens | Mitigation |
|-------------|-------------|------------|
| Length exploitation | Model generates very long responses → higher reward | Length penalty in reward |
| Sycophancy | Model agrees with user regardless of truth | Diverse training data |
| Formatting tricks | Bullet points/bold text scored higher | Format-controlled comparisons |
| Distribution shift | RL policy moves OOD from RM training data | KL penalty, iterative RM updates |
| Adversarial | RL finds specific token patterns that hack RM | Ensemble of RMs |
**Reward Model Quality Metrics**
| Metric | Meaning | Good Value |
|--------|---------|----------|
| Agreement accuracy | Matches human preferences on held-out set | >70% |
| Cohen's kappa vs. humans | Agreement accounting for chance | >0.5 |
| Ranking correlation | Spearman ρ over response rankings | >0.7 |
| Calibration | Confidence matches true accuracy | Calibration error <5% |
**RM in Practice**
| System | RM Size | Training Data | Approach |
|--------|---------|-------------|----------|
| InstructGPT | 6B | 50K comparisons | Single RM + PPO |
| Llama 2 Chat | 70B | 1M+ comparisons | Safety + Helpfulness RMs |
| Claude | Undisclosed | Constitutional AI + human | RM + RLAIF |
| Nemotron | 70B | Synthetic preferences | LLM-as-judge RM |
**Advanced: Process Reward Models (PRM)**
- Outcome RM: Score the final answer only.
- Process RM: Score each step of reasoning → credit assignment for multi-step problems.
- PRM800K: OpenAI dataset with step-level human labels for math.
- Result: PRM significantly outperforms outcome RM on math reasoning tasks.
Reward modeling is **the foundational component that makes AI alignment scalable** — by compressing human preferences into a learnable function, reward models enable language models to be optimized for human values at a scale that would be impossible with direct human feedback, while the ongoing challenge of reward hacking and distribution shift drives continued innovation in more robust alignment techniques.