Skip to content

Deep Reinforcement Learning from Human Preferences

optionalcorefundamentalpaperrubric 11/122017 · ~45 min

Paul F. Christiano, Jan Leike, Tom B. Brown, …, Dario Amodei

Status

TL;DR. Instead of writing a reward function, show a human two short clips of the agent’s behaviour and ask which is better. Fit a reward predictor r^(o,a)\hat r(o,a) so that the clip with the larger summed reward is the one humans prefer (a Bradley–Terry model). Run RL on r^\hat r while new comparisons keep arriving. With feedback on under 1% of interactions, agents learn Atari games and simulated-robot tasks, and novel behaviours such as a backflip from about an hour of human time.

Why it matters now. RLHF pipelines for LLMs such as InstructGPT reuse this paper’s comparison → reward-model → RL pipeline: pairwise comparisons, a Bradley–Terry reward model and RL against it. DPO inherits the pairwise-preference/Bradley–Terry formulation but trains the policy directly, without a separate reward model or online RL rollout loop. Its lessons apply directly to search agents and LLM judges. The reward model must see the policy’s current behaviour, comparisons are easier to give consistently than scores, and a policy will exploit whatever part of the reward the model failed to learn.

A segment σ\sigma is a short sequence of observation–action pairs (1–2 seconds of video). The predicted probability that a human prefers σ1\sigma^1 is (paper Eq. 1):

P^[σ1≻σ2]=exp⁡∑tr^(ot1,at1)exp⁡∑tr^(ot1,at1)+exp⁡∑tr^(ot2,at2)\hat P\big[\sigma^1\succ\sigma^2\big]=\frac{\exp\sum_t\hat r(o^1_t,a^1_t)}{\exp\sum_t\hat r(o^1_t,a^1_t)+\exp\sum_t\hat r(o^2_t,a^2_t)}

r^\hat r is fitted by minimising cross-entropy against the human’s label μ\mu: all mass on the preferred clip, uniform for “equally good”, and the pair is dropped if the human says the clips are incomparable. The authors compare this to Elo ratings: a difference in summed reward predicts a win probability.

Three processes run asynchronously (§2.2):

  1. The policy acts in the environment and is trained by standard RL on r^\hat r: A2C for Atari, TRPO for MuJoCo.
  2. Pairs of segments from recent trajectories are sent to a human.
  3. r^\hat r is retrained by supervised learning on all comparisons so far.

Practical changes that made it work (§2.2.3):

  • an ensemble of predictors, each trained on a bootstrap resample;
  • 1/e of the data held out for validation, with ℓ2 regularisation tuned so that validation loss stays at 1.1–1.5× training loss;
  • a 10% chance that the human answers uniformly at random, so P=0.9P^+0.05P=0.9\hat P+0.05 never reaches 0 or 1;
  • rewards normalised to zero mean and fixed standard deviation, because the reward’s position is not determined by comparisons;
  • queries chosen where the ensemble disagrees most. The authors call this a crude approximation that sometimes hurt.
The asynchronous learning-from-preferences loop Three processes run at once. The policy, trained with A2C or TRPO, acts in the environment and maximises the summed predicted reward. Pairs of short clips from its recent trajectories, chosen where an ensemble of reward models disagrees, are shown to a human, who prefers one, calls a tie, or marks them incomparable. The reward model ensemble is refitted with a Bradley-Terry loss on all comparisons so far and sends a normalised per-step reward back to the policy. A note says that freezing the reward model on early clips teaches only part of the reward, as in Pong agents that volley forever. policy π (A2C / TRPO) acts in the environment, maximises Σ r̂(o, a) human compares two clips 1–2 s clips, 3–5 s per answer reward model r̂ (ensemble) Bradley–Terry fit on all comparisons collected so far clip pairs from recent trajectories chosen where the ensemble disagrees labels μ: prefer one, tie, or drop if incomparable normalised per-step reward r̂(o, a) under 1% of interactions labelled All three processes run asynchronously, so new clips always come from the current policy. Freezing r̂ on early clips teaches only part of the reward: Pong agents that never lose but never score.
Original sketch. Three asynchronous loops: the policy generates trajectories, clip pairs go to a human, and the reward model is refitted on all comparisons. Fresh clips keep the reward model on the policy's current state distribution.
  • MuJoCo (§3.1.1, Fig. 2). 700 real human queries nearly match RL on the true reward in most of the eight tasks. On Ant, human labels clearly beat synthetic ones, because labellers were asked to prefer the robot “standing upright”, which shaped the reward.
  • Atari (§3.1.2, Fig. 3). With 5,500 human queries the method learns most games, although it has more difficulty matching RL than on MuJoCo. On BeamRider and Pong, 3,300 synthetic labels match or come close to RL. Real human labels perform similarly to or slightly worse than the same number of synthetic labels, often comparable to 40% fewer synthetic labels. The authors attribute the gap to labelling errors and inconsistency between contractors.
  • Ablations (§3.3, Figs. 5–6). Offline-only queries are the most damaging. Single frames instead of clips needed far more comparisons on the continuous-control tasks tested.
  • Cost (§4). The authors estimate that this cuts the human oversight needed by about three orders of magnitude, and that for Atari 5k labels (about 5 hours of labour) cost roughly the same as the compute.
  • Query selection is crude. Ensemble disagreement is a stand-in for the expected value of information, and on some tasks it hurt.
  • Human labels are noisier than synthetic ones. Errors, inconsistency between contractors and uneven labelling rates all cost performance.
  • Reward hacking is already visible. The Pong volleys are an early, concrete example of a policy exploiting a partially learned reward (specification gaming examples).
  • Toy domains. Short clips of games and simulated robots are easy to judge. Judging long LLM answers or agent trajectories in seconds is much harder, so later work moved to whole responses with careful labeller instructions.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    In the paper's model, a clip's score is the sum of predicted per-step rewards. Clip σ¹ has predicted rewards (0.2, 0.5, 0.8) and clip σ² has (0.1, 0.1, 0.3). Compute P̂[σ¹ ≻ σ²], the loss if the human prefers σ¹, the loss if the human calls it a tie, and the probability after the paper's 10% random-response adjustment. What happens to a pair the human marks as incomparable?

    What a strong answer covers
    • Sums are 1.5 and 0.5, so P̂ = exp(1.5)/(exp(1.5) + exp(0.5)) = σ(1.0) ≈ 0.731.
    • Prefer σ¹ (μ = (1, 0)): loss = −log 0.731 ≈ 0.313.
    • Tie (μ = (0.5, 0.5)): loss = −0.5·log 0.731 − 0.5·log 0.269 ≈ 0.813, pulling the two sums together.
    • Noise adjustment: 0.9·0.731 + 0.05 ≈ 0.708, so P̂ always stays in [0.05, 0.95].
    • Incomparable pairs are dropped from the database and give no gradient.
  2. Mechanism

    The paper trains the reward predictor on comparisons that keep arriving while the policy learns. Explain, at the level of which states the predictor sees, why training it only on an early fixed batch of comparisons produced Pong agents that volley for ever.

    What a strong answer covers
    • The predictor is accurate only on the state distribution (occupancy) it was trained on. Once the policy improves, it visits states that the old comparisons never covered.
    • A predictor fitted early captures only part of the true reward, for example "do not lose a point" but not "score a point".
    • The policy maximises that partial reward exactly. In Pong, avoiding losses without scoring gives endless volleys.
    • Querying fresh clips from the current policy keeps the comparisons on the policy's own distribution, so feedback must be interleaved with RL, not given once.
  3. What if…

    Section 3.3 removes components one at a time: random instead of disagreement-based queries, no ensemble, offline-only queries, no regularisation, single frames instead of clips, and regressing an oracle's true segment reward instead of predicting comparisons. For the comparison-vs-regression and clip-vs-frame ablations, what did they find and what explanation do the authors give?

    What a strong answer covers
    • On continuous control, predicting comparisons worked much better than regressing scores. The authors blame the widely varying reward scale, which makes regression hard but leaves comparisons easy.
    • On Atari, rewards were clipped so regression effectively predicts a sign; neither variant consistently won there.
    • Single frames instead of clips did much worse on the continuous-control tasks tested. Matching clips would need many more comparisons.
    • Clip length is a cost trade-off: longer clips give more information per clip but less per frame, and human time grows roughly linearly beyond a short length.
  4. Critique

    Queries are chosen where an ensemble of reward predictors disagrees most. The authors call this a crude approximation that sometimes hurt. Explain why disagreement can be a poor proxy for the value of a query, and design an experiment that would show when it helps.

    What a strong answer covers
    • High variance can come from clips that are unlearnable or ambiguous to humans (near-ties), which spend labels without reducing error.
    • It ignores how much the answer would change the policy. Expected value of information, which the authors mention as the ideal, would weight queries by their effect on decisions.
    • Ensemble members trained on bootstrap resamples of the same data can agree confidently and still be wrong off-distribution.
    • Experiment: at a fixed label budget, compare random, disagreement and an expected-improvement proxy on several tasks with several seeds. Measure true return per label and the fraction of tie or incomparable answers per strategy.
  5. Design

    You want to train a web-search agent from analyst preferences without a hand-written reward. Adapt the paper's design: what is a "clip", how do you pick which pairs to show, how do you keep the reward model on-distribution, and what would you budget for human time?

    What a strong answer covers
    • A segment could be a few consecutive search-and-read steps, or a final answer with its citations. It must be short enough to judge in seconds, as the paper's 1–2 second clips were.
    • Pick pairs from the current agent's rollouts where an ensemble of reward models disagrees, and keep a random slice for unbiased evaluation.
    • Run labelling, reward-model training and RL asynchronously so new comparisons always come from the current policy. Retrain the RM regularly; never freeze it on early data.
    • Allow ties and "cannot tell", use soft labels, normalise rewards, and hold out comparisons to watch RM validation loss.
    • Budget: the paper used about 3–5 seconds per query and between 30 minutes and 5 hours of human time per task. Longer agent segments will cost more per label.
  6. Connect

    Write down what changes between this paper's setup and RLHF for language models in InstructGPT: what the "action" and "episode" are, what is compared, what keeps the policy near its start, and which of this paper's safeguards are kept or dropped.

    What a strong answer covers
    • Here: per-step reward r̂(o, a) on robot or Atari states, policy trained with A2C or TRPO from scratch. In InstructGPT: one prompt and response is a bandit episode with reward at the end, and the policy is a pretrained LM fine-tuned with PPO.
    • Compared items change from 1–2 second clips to whole responses, ranked K at a time.
    • InstructGPT adds a per-token KL penalty to the SFT model to stay where the RM is valid. This paper has no reference model, only an entropy bonus.
    • Kept: Bradley–Terry loss and reward normalisation. Mostly dropped: ensembles and disagreement-based querying, and most labelling is batched rather than fully online.

Done with this page?

Status