Zenaique

State what RLHF adds that pretraining alone cannot provide

Flashcard·Easy·4.0 · 0·~30s·Asked atAutodeskHarveyKrutrim
Attempt it
TL;DR

Pretraining teaches a model to imitate internet text; RLHF adds a reward from human judgments of the model's own answers, so it learns to give answers people prefer instead of merely likely text.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine a child who has read every book in a huge library. The child can continue any sentence in any style: a recipe, a rant, a fairy tale, a rude note. But ask the child a question and they might answer, or they might write three more questions, because many pages look like that. Reading taught the child what text usually looks like, not what a helpful reply is. Now a parent listens to the child's own answers and says "this one was better than that one", again and again. The child slowly learns what people want: answer the question, be honest, do not be cruel. The parent taught no new facts. The parent taught which of the child's own habits to keep. That is RLHF on top of pretraining.

Key concepts

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Pretraining and RLHF optimize different things. Pretraining fits a model to the distribution of human-written text. RLHF fits it to human judgments of its own answers. Most of what RLHF adds follows from that change of objective, and so do most of its limits.

A pretrained model is already fluent and knows a lot. GPT-3 at 175B parameters could write essays and code, yet labelers preferred a 1.3B model trained with human feedback. Something other than scale was missing, and the missing piece is a signal about which answers people want.

What the pretraining objective rewards

Pretraining minimizes next-token cross-entropy over a huge text corpus:

LPT(θ)=−Ex∼corpus∑tlog⁡πθ(xt∣x<t)\mathcal{L}_{\text{PT}}(\theta) = -\mathbb{E}_{x \sim \text{corpus}} \sum_t \log \pi_\theta(x_t \mid x_{<t})

The best possible model under this loss reproduces the corpus distribution. That is a demanding goal: to predict text well, the model must learn grammar, facts, code, and reasoning patterns. But it is a goal about what text is likely, not about what text is good. A web corpus contains confident wrong answers, insults, spam, and forum threads where a question is followed by more questions. A perfect predictor reproduces all of these at their natural rates.

The InstructGPT paper states the gap directly. Predicting the next token on a webpage is a different objective from following the user's instructions helpfully and safely. So the paper calls the language modeling objective misaligned. The symptoms are familiar. A base model given a question may continue with a list of similar questions, invent facts in the style of a confident article, or produce toxic text when the prompt looks like a toxic page.

More pretraining does not remove these behaviors, because they are part of the distribution the model is trained to match. A larger model matches the distribution better, including the parts no user wants. What is missing is a signal that ranks outputs by their quality for the person asking.

What RLHF optimizes instead
Three signals only this objective provides
Evidence from InstructGPT
What RLHF does not add
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • InstructGPT: labelers preferred the 1.3B model trained with SFT and RLHF over the 175B GPT-3, and the 175B version was preferred to GPT-3 85 ± 3% of the time.
  • Llama 2-Chat: SFT followed by five rounds of RLHF (RLHF-V1 to V5), using rejection sampling and then PPO, with separate helpfulness and safety reward models.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QIf the RL stage needs so little compute, why not skip pretraining and train with RLHF from scratch?
A

Think about what the reward needs to work: a policy that already writes sensible text worth comparing, and a competent reference model for the KL anchor.

3 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Saying RLHF teaches the model new knowledge. It mainly changes behavior: which answers the pretrained model could already write get chosen, based on human judgments of its own outputs.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Pretraining objective and what it rewards

  • Why a perfect next-token predictor still misbehaves

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is RLHF, and why is it used after pretraining?
MCQ·Easy