Search

Search papers and lessons

Learning to summarize from human feedback

Nisan Stiennon, Long Ouyang, Jeff Wu et al. · 2020

Stiennon and colleagues learned a reward model from people's choices between two summaries, then optimised a summarizer against it, and people preferred its summaries to the human references.

On this page

  • Colour = topic mix
  • Reinforcement learning
  • Probability
  • Discrete math
  • Calculus
  • Linear algebra
  • Neural network basics
  • ReadReady to readNot yet

TL;DR

Stiennon and colleagues asked people which of two summaries of a Reddit post they liked better. They trained a reward model to predict those choices, then fine-tuned a summarizer with reinforcement learning so that the reward model would score its summaries highly. The result was a summarizer whose outputs human labelers preferred over the short human-written summaries that came with the dataset, even when the model was much smaller than the supervised baselines it beat.

Builds on: Reward Model, RLHF, PPO, Kullback–Leibler Divergence, Bradley–Terry Model · Leads to: InstructGPT, DPO

Why it mattered

The recipe in this paper became the template for later assistant models. The same three moves (collect human comparisons, fit a reward model, optimise a policy against it with PPO) were scaled up in InstructGPT (2022) and the chat assistants that followed it. The paper tests the method on a task where quality is easy for a human reader to judge but hard to score automatically: a short summary should convey the post faithfully and cover what matters.

It also gave a concrete warning. The authors showed that a reward model can be optimised so hard that it stops tracking what people want, and that the standard automatic metric for summaries, ROUGE, a score that counts how many words and word sequences a summary shares with a reference summary, is a poor guide to quality once a model is good. Both points still shape how people evaluate preference-trained models.

The problem

Summarization models in the early 2020s were trained to imitate human reference summaries, usually with Supervised Learning on the maximum-likelihood objective, and scored with ROUGE. Both are rough proxies. Imitating references teaches the model to match wording, not to choose what matters. ROUGE rewards overlap with a reference, so a summary can score well by copying phrases while missing the point.

The question the paper asks is simple: if you ask people to compare two summaries, and you use their answers as the training signal, can the resulting model be better than one trained to copy references? The answer needs three things to work together. People must give consistent judgments. A model must learn to predict those judgments from a few thousand comparisons. And a policy must be optimised toward that learned predictor without drifting into nonsense.

How it works

The paper's pipeline runs in three steps, repeated as new comparisons arrive. Here is one pass, traced on a single Reddit post.

flowchart LR
  A[Sample summaries from policies] --> B[Labelers pick the better one]
  B --> C[Train reward model on the picks]
  C --> D[Optimise policy with PPO against reward model]
  D --> A
  1. Start from a supervised model. Fine-tune a language model on the filtered Reddit TL;DR dataset, so it produces summaries of posts in the usual style. Call it the SFT policy. Its outputs are the starting point and the reference for staying close later. Check: the SFT policy writes a plausible summary of a post it has seen before.

  2. Collect comparisons. For one post, sample two summaries, A and B, from the SFT policy or from other sources. A labeler reads the post and says which summary is better. Suppose the labeler picks A. Check: each comparison is one bit of information, A is better or B is better.

  3. Train a reward model on the picks. Give the model the post and one summary and ask for a single number, its score. Train it so that the preferred summary gets a higher score than the rejected one. With scores of 1.0 for A and 0.0 for B, the model is doing well on this pair. Check: the loss for this pair is about 0.313, computed in the math section below. A worse ordering would give a larger loss.

  4. Optimise the policy with PPO. Let the policy write a summary, score the whole summary with the reward model, and update the policy so its summaries score higher. The reward arrives only at the end of the summary, because the reward model scores complete summaries. Check: the policy's next summaries on this post should score higher than the SFT summary did.

  5. Repeat. Use the improved policy to produce new candidate summaries, send new comparisons to labelers, and retrain. The paper ran this loop in batches rather than one comparison at a time.

One extra term matters at step 4. The reward includes a penalty for drifting away from the SFT policy. Without it, the policy can find strange high-scoring text that the reward model happens to like. The penalty is a Kullback–Leibler Divergence between the current policy and the SFT policy, and it keeps the outputs close to text the reward model has seen.

The math

Definition: Preference loss

Given a post x and two summaries y0 and y1, with the labeler choosing y_i, the reward model r_θ is trained to minimise the negative log of the probability that y_i wins, where that probability is the sigmoid of the score gap. The paper writes it as

loss(rθ)=−E(x,y0,y1,i)∼D[log⁡(σ(rθ(x,yi)−rθ(x,y1−i)))]\text{loss}(r_{\theta})=-\mathbb{E}_{(x,y_0,y_1,i)\sim D}\left[\log\left(\sigma\left(r_{\theta}(x,y_{i})-r_{\theta}(x,y_{1-i})\right)\right)\right]

where σ is the sigmoid, D is the dataset of human judgments, and the expectation averages over comparisons.

The sigmoid of a score gap is the Bradley–Terry model of pairwise preference: the chance that one option beats another is a logistic function of the difference of their scores.

Step 1 in symbols

The SFT policy is π^SFT, a language model fine-tuned on the TL;DR dataset. The comparisons come from sampling candidate summaries y from it, or from other policies, given post x.

Step 2 in symbols

For a comparison with winner y_i and loser y_{1-i}, the probability the model assigns to the human choice is σ(r_θ(x,y_i) − r_θ(x,y_{1-i})). Training pushes this probability up. The loss is its negative log, so a confident correct prediction costs little and a confident wrong one costs a lot.

Recall the sigmoid: σ(d) = 1 / (1 + e^(−d)). With d = 1 it is about 0.731.

Step 3 in symbols

The policy π_φ^RL maximises the expected reward. The per-summary reward used in PPO is

R(x,y)=rθ(x,y)−βlog⁡[πϕRL(y∣x)πSFT(y∣x)]R(x,y)=r_{\theta}(x,y)-\beta\log\left[\frac{\pi^{\text{RL}}_{\phi}(y\mid x)}{\pi^{\text{SFT}}(y\mid x)}\right]

Here β is a coefficient that sets how strongly the policy is pulled back toward the SFT model. The log-ratio is the per-sample estimate of the Kullback–Leibler Divergence between the two policies. Larger β means less drift and less reward gained.

The paper also normalises the reward model so that the reference summaries in the dataset have an average score of 0. That choice makes scores comparable across runs but does not change which summary is preferred.

Worked examples

Example
Example 1: one comparison by hand

Setup: a post, two summaries A and B. The labeler picks A. The reward model gives r(A) = 1.0 and r(B) = 0.0.

  1. The score gap is r(A) minus r(B), which is 1.0 minus 0.0 = 1.0. This is the amount by which the model prefers the winner.
  2. The sigmoid of the gap is σ(1.0) = 1 / (1 + e^(−1)) = 1 / (1 + 0.3679) = 0.7311. This is the model's predicted probability that the labeler picks A.
  3. The loss for this pair is −log(0.7311) = 0.3133. Taking the natural log of 0.7311 gives about −0.3133, and the minus sign makes it positive.
  4. Now swap the scores, so r(A) = 0.0 and r(B) = 1.0. The gap is −1.0, the sigmoid is 0.2689, and the loss is −log(0.2689) = 1.3133. The model that ranks the labeler's choice lower pays a bigger penalty.

Interpretation: the loss rewards the model for ranking the human's choice first, and the penalty grows fast when it does not.

Example
Example 2: the KL penalty on one summary

Setup: β = 0.1. The reward model gives the summary a score of 2.0. The RL policy assigns the summary probability 0.6 and the SFT policy assigns it 0.4.

  1. Compute the ratio of the two probabilities, 0.6 / 0.4 = 1.5.
  2. Take its natural log, log(1.5) = 0.4055.
  3. Multiply by β: 0.1 × 0.4055 = 0.04055.
  4. Subtract from the reward score: R = 2.0 − 0.04055 = 1.9594, about 1.96.

Interpretation: the policy gains reward from the reward model but pays a small fee for having moved probability toward this summary relative to the SFT model. If the policy had put probability 0.9 on the summary, the log-ratio would be log(2.25) = 0.811, and the fee would be 0.081. A larger β would make that fee bigger.

Example
Example 3: reading a preference rate

Setup: a labeler panel compares a new summarizer with the human reference on 200 posts, and prefers the new summary on 116 of them. A preference rate of 50% means the two summaries are judged equal on average.

  1. Compute the rate: 116 / 200 = 0.58, or 58%.
  2. Compare it with the 50% line. The new summary is 8 points above it.
  3. Ask whether 58% is a real preference. With 200 comparisons, the sampling noise on a rate near 50% is roughly 3.5 points either way, so 58% is above chance, but only by about two of those noise widths.
  4. Check the confound the paper flags for this kind of comparison: summary length. If the new summaries are longer, part of the 58% may come from length rather than quality, so split the comparisons by length or control for it before claiming a quality gain.

Try it: the same panel now compares a second summarizer on 200 posts and prefers it on 130. What is the rate, and is it a larger gap than the first? Answer: 130 / 200 = 0.65, or 65%. The gap is 15 points above 50%, a clearer preference than 58%, but it still needs the length check in step 4 before it is read as quality.

−4−3−2−10123401234score gap r(winner) minus r(loser)loss
  • loss when the model prefers the winner by x
The preference loss falls as the model separates the winner from the loser. The three points match the worked example: gap 0 gives 0.693, gap 1 gives 0.313, and gap minus 1 gives 1.313.

Results

The main experiment summarises Reddit posts from the TL;DR dataset. Human labelers rated summaries on a 7-point scale and also compared them directly against the reference summaries.

  • Preference against references. Human-feedback models are preferred to the human reference summaries, and the smaller feedback model beats a much larger supervised model. The advantage held up after the authors checked for summary length.
  • Transfer. Models trained on Reddit feedback also do reasonably on CNN/DailyMail news articles, without news-specific feedback training.
  • Reward model quality. The reward model agrees with labelers clearly above chance, and more comparison data and larger models both help.
  • Automatic metrics. ROUGE is a weaker guide to labeler preference for the feedback-trained policies than the reward model is.

The limits matter as much as the numbers. Optimising the policy too far against the reward model makes its scores stop tracking human preferences. The labeling effort and compute were large. Length was a confound: policies learned to write longer summaries, which labelers can prefer, so the authors checked for it.

Reading guide

The paper's main parts map to the lessons you need as follows.

  • Introduction. Read for the three steps and the motivation. Needs Supervised Learning and Reward Model.
  • Method overview. The loop in the How it works section. Needs RLHF.
  • Collecting human feedback. How comparisons were gathered and checked for labeler agreement. Needs Bradley–Terry Model for why pairwise choices are useful.
  • Models and the reward loss. The reward loss and the KL-penalised reward. Needs Kullback–Leibler Divergence, Sigmoid Function and PPO.
  • Results. Read the findings against the Results section above. Needs Log-Odds to read the reward model's output as a log odds ratio.
  • Automatic metrics analysis. Needs Best-of-N Sampling for the simple baseline the authors also compare against.

Check yourself

QuestionRecall: what three steps make up the paper's method, in order?Show answer
Step 1 is to collect human comparisons between summaries sampled from the policies. Step 2 is to train a reward model to predict the preferred summary. Step 3 is to optimise the policy with PPO against the reward model, with a KL penalty toward the SFT policy. The loop then repeats with new comparisons.
QuestionComputation: a labeler prefers summary A. The reward model gives r(A) = 0.5 and r(B) = −0.5. What is the preference loss for this pair?Show answer
The score gap is 0.5 − (−0.5) = 1.0. The sigmoid of 1.0 is 0.7311. The loss is −log(0.7311) = 0.3133.
QuestionWhy does the paper add a KL penalty toward the SFT policy instead of only maximising the reward model's score?Show answer
The reward model is trained on a narrow distribution of summaries and is imperfect. Without the penalty, the policy can find text the reward model scores highly by accident. The penalty keeps the policy near text the reward model has seen, so its high scores are more likely to reflect quality.
QuestionApplied: a team trains a summarizer with this method and sees that its summaries keep getting longer, and labelers' ratings of the newest checkpoint start to fall. Which of the paper's findings explains the pattern, and what would you check first?Show answer
The paper flags length as a confound: policies can learn to write longer summaries, and optimising too hard against the reward model can make its scores stop tracking human preferences. The first check is the length distribution of summaries against labeler ratings at each checkpoint, and whether ratings fall after controlling for length, as the paper did. Then check the KL coefficient, since a larger β would keep the policy closer to the SFT model.

Sources

Read the full paper

Nisan Stiennon, Long Ouyang, Jeff Wu et al., 2020. arXiv:2009.01325