JA EN
LearnLarge Language Models
·★ MEMBER·PAPER·8 min read

Alignment, Explained — From RLHF to Constitutional AI

What exactly is being aligned with what? This piece separates the gap into three layers — objective, specification, and proxy — shows that RLHF, DPO and Constitutional AI all solve the same skeleton of "reward minus a penalty for drifting from the reference model," explains why pushing that proxy hard always produces reward hacking, and works through the trade between refusing and being useful, down to the implementation traps.

ModalitytextTasksafety

Training language models to follow instructions with human feedback

Primary source — what this article is built on

undefined2022-03-04undefined2026-08-274y 6mo later

Training language models to follow instructions with human feedbackLong Ouyang, Jeff Wu, Xu Jiang et al. · 2022-03-04 · v1arXiv:2203.02155Paper page·PDF
Constitutional AI: Harmlessness from AI FeedbackarXiv:2212.08073Paper page·PDF
Scaling Laws for Reward Model OveroptimizationarXiv:2210.10760Paper page·PDF
A General Language Assistant as a Laboratory for AlignmentarXiv:2112.00861Paper page·PDF
undefined

Making language models bigger does not inherently make them better at following a user's intent. For example, large language models can generate outputs that are untruthful, toxic, or simply not helpful to the user. In other words, these models are not aligned with their users. In this paper, we show an avenue for aligning language models with user intent on a wide range of tasks by fine-tuning with human feedback. Starting with a set of labeler-written prompts and prompts submitted through the OpenAI API, we collect a dataset of labeler demonstrations of the desired model behavior, which we use to fine-tune GPT-3 using supervised learning. We then collect a dataset of rankings of model outputs, which we use to further fine-tune this supervised model using reinforcement learning from human feedback. We call the resulting models InstructGPT. In human evaluations on our prompt distribution, outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters. Moreover, InstructGPT models show improvements in truthfulness and reductions in toxic output generation while having minimal performance regressions on public NLP datasets. Even though InstructGPT still makes simple mistakes, our results show that fine-tuning with human feedback is a promising direction for aligning language models with human intent.


What is alignment actually aligning?

You ask the genie to make you rich and you inherit money from a relative who just died. Genie stories are unsettling not because the genie is malicious, but because the wish you said out loud differs from the thing you wanted. The more literally and the more forcefully your wish is granted, the more that gap turns into an accident.

Language models are the same shape. Pretraining maximizes "predict the next token of text on the web," not "follow the user's intent, be useful, and cause no harm." The InstructGPT paper we read in Instruction Tuning and RLHF calls this state misaligned, and names three things to align to: helpful, honest, harmless.

One term deserves care up front. Alignment is not the work of making a model smarter. What it touches is not capability (what the model can do) but propensity (what it tends to do).

The gap appears in three layers

"Misalignment" is one word for three different failures, and conversations go in circles when they get mixed.

1. The objective gap. Next-token prediction is simply a different objective from following instructions. Supervised fine-tuning (SFT) on demonstrations, plus learning from preferences, closes this one.

2. The specification gap. Nobody can write down "useful" and "harmless" in a form everyone agrees with. Even human labelers disagree with each other. So the spec can only be conveyed by example (preference data) or by principle (the constitution, below). It cannot be written directly as a loss function — that is what defines this layer.

3. The proxy gap. Inside the training loop, what the model is actually pushing up is not human satisfaction but the number emitted by a reward model, which is only a finite-data approximation of people. This layer is where reward hacking breeds.

Intuition: push the proxy hard enough and it detaches from the real thing

Goodhart's law puts it well: the moment a measure becomes a target, it stops being a good measure. Test scores aren't a bad way to gauge learning, but maximize scores alone and what grows is memorization and reflexes for past exam questions.

The reward model is exactly that test. Early on, raising the proxy raises the real thing too. The trouble starts when optimization keeps pushing: the reward model's score still climbs while human judgments plateau and then decline. This turnaround has been measured as reward model overoptimization, and smaller reward models turn around sooner.

FIG 1Raise the polynomial degree and training error keeps falling while test error reverses and climbs. Reward hacking has exactly this shape — the harder you optimize, the better the proxy (training error, i.e. the reward model's score) looks, while the thing you actually care about (test error, i.e. human judgment) turns for the worse

The skeleton: every method solves "reward minus a penalty for drifting"

RLHF, DPO, Constitutional AI — the names keep multiplying, but the problem being solved is nearly identical.

maxπθ ExD,yπθ(x)[r(x,y)]    βDKL(πθ(x)πref(x))\max_{\pi_\theta}\ \mathbb{E}_{x\sim\mathcal{D},\, y\sim\pi_\theta(\cdot\mid x)}\big[r(x,y)\big]\;-\;\beta\, D_{\mathrm{KL}}\big(\pi_\theta(\cdot\mid x)\,\|\,\pi_{\mathrm{ref}}(\cdot\mid x)\big)
(1)

Read aloud: "make the average reward as large as you can, but pay a fine of β\beta for every unit you drift away from the model you started with." Here xx is the prompt, yy the response, πθ\pi_\theta the model being trained, πref\pi_{\mathrm{ref}} the reference model frozen before training, rr the reward, DKLD_{\mathrm{KL}} a measure of how far apart two distributions are, and β\beta the knob for how adventurous you are allowed to be.

Put in words, equation (1) is a single ledger with two columns: the model gains by producing answers people rate highly, and loses by producing answers far from the one it started as. β\beta is the exchange rate between the two columns — turn it up and the standing order becomes "don't drift from who you were"; turn it down and it becomes "do whatever scores points."

With equation (1) as the axis, the differences reduce to two: where comes from, and how the maximization is solved. RLHF learns from human preferences and solves with PPO; DPO substitutes the closed-form optimum, cancels , and collapses everything into a single preference loss ([DPO and What Came After](/en/a/dpo-and-b

What's behind this

§

Members-only from here

371 walkthroughs, 26 textbook chapters, 48 student units and 6 close readings — all included for $4.99/mo, with three new explainers every day. Cancel any time; access runs to the end of the period.

Already a member? Sign in to keep reading

References

  1. Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida et al.. (2022-03-04) Training language models to follow instructions with human feedback. arXiv:2203.02155Paper page·PDF
  2. Constitutional AI: Harmlessness from AI Feedback. arXiv:2212.08073Paper page·PDF
  3. Scaling Laws for Reward Model Overoptimization. arXiv:2210.10760Paper page·PDF
  4. A General Language Assistant as a Laboratory for Alignment. arXiv:2112.00861Paper page·PDF

This article is written from the source paper above. Where they differ, the original is authoritative.

Comments

Sign in to comment