Before you move a control in the demo, say what you expect to change.
Foundation reference
Preference-Based Alignment: RLHF, Reward Modeling, Constitutional AI
Reinforcement learning from human feedback (RLHF) trains a reward model on human comparisons between outputs, then optimizes the policy against that reward. InstructGPT turned GPT-3 into an instruction-following assistant this way, with supervised fine-tuning before the reward model and PPO as the policy update (Ouyang et al., 2022).
Study guide
Where to start
Why can KL-regularized RLHF be read as a Bayesian update, with the reference model as the prior and the exponentiated reward as the likelihood (Korbak et al., 2022)?
How to study this pagePredict · Check · Generalize · Continue
Compare what the demo shows with the key equation and with the papers cited below.
Identify the part of the idea that survives a change of notation or model, so you can recognize it in another paper or system.
The newer notebook covers the same concept and has an interactive demo.
Why It Matters for Modern Models
- Reinforcement learning from human feedback (RLHF) trains a reward model on human comparisons between outputs, then optimizes the policy against that reward. InstructGPT turned GPT-3 into an instruction-following assistant this way, with supervised fine-tuning before the reward model and PPO as the policy update (Ouyang et al., 2022).
- Constitutional AI trains a harmless assistant without human labels that identify harmful outputs; a model judges responses against written principles instead (Bai et al., 2022).
Questions to Think About
- How does optimizing a learned reward too hard lead to reward hacking, where the proxy reward keeps rising while true quality falls (Gao et al., 2023)?
- What does a policy's output distribution look like before and after RLHF?
Interactive Demos
Core Math
If you prefer intuition first, try the demos above, then come back for the math.
Reward modeling from preferences: given human comparisons between outputs , fit a reward model with the Bradley–Terry model:
RLHF objective: fine-tune the policy to maximize reward while staying close to a reference model :
The maximizing policy has the closed form ; in practice it is approximated with PPO (Ouyang et al., 2022).
Constitutional AI: for harmlessness, the preference labels come from a model asked to judge responses against a written list of principles (a constitution), and a supervised stage has the model critique and revise its own responses (Bai et al., 2022).