Back
advanced
Advanced Fine-Tuning

RLHF (Reinforcement Learning from Human Feedback)

Understand the RLHF pipeline: supervised fine-tuning, preference data, reward models, policy optimization, and failure modes

30 min read· RLHF· Reinforcement Learning· PPO· Reward Model

RLHF (Reinforcement Learning from Human Feedback)

RLHF is one way to make a base language model behave more like a helpful assistant.

The model learns not just to predict text, but to prefer responses humans rate better.

Pipeline

text
base model -> supervised fine-tuning -> preference data -> reward model -> policy optimization

Preference data

Humans compare answers:

text
prompt -> answer A vs answer B -> which is better?

The comparisons train a reward model.

Reward model

The reward model predicts which responses humans would prefer. Then policy optimization nudges the language model toward high-reward answers.

Failure modes

FailureMeaning
reward hackingmodel exploits reward flaws
over-refusalmodel refuses harmless requests
sycophancymodel agrees too much
verbosity biaslonger answers score better even when worse
preference driftmodel optimizes judge quirks

DPO simplifies preference optimization by avoiding a separate reward-model training loop. RLHF still matters because it explains much of modern assistant behavior.

Knowledge check

Q1: What does the reward model learn?

It learns to predict which answers humans prefer.

Q2: What is reward hacking?

Optimizing the reward signal without actually improving the intended behavior.