Reinforcement Learning from Human Feedback

Human Preferences as Reward

RLHF replaces hand-crafted reward functions with human preference judgments. It is the primary method for aligning large language models — making ChatGPT, Claude, and Gemini helpful, honest, and safe.

The Three-Stage Pipeline

1

Supervised Fine-Tuning (SFT) — Fine-tune the base model on high-quality human-written examples of helpful behavior. Establishes the right style and capabilities before RL begins.

2

Reward Model Training — Generate pairs of responses for the same prompt. Human raters choose which is better. Train a neural network to predict human preferences. The resulting reward model is a proxy for human judgment — scores any response for quality.

3

RL Fine-Tuning with PPO — Use the reward model as the reward signal. PPO updates the language model policy to generate responses with higher reward model scores. A KL penalty keeps outputs close to the SFT model — preventing reward hacking the imperfect reward model.

RLHF vs DPO

RLHF (PPO)

Separate reward model + PPO fine-tuning. More complex pipeline, two trained models, requires careful KL tuning. Flexible — reward model can be used for many RL fine-tuning runs.

DPO

Directly optimizes on preference pairs in a supervised manner. No separate reward model. Simpler, more stable, fewer moving parts. Comparable or better results in many settings. Increasingly preferred.

Need Help?

Ask the AI assistant about RLHF, how the three-stage pipeline works, what DPO is, or why the KL penalty matters.