# Deep reinforcement learning from human preferences

Paul Christiano, Jan Leike, Tom B. Brown, Miljan Martic, Shane Legg, Dario Amodei · arXiv · 2017-6-12

- **Problem** Reward functions for complex goals are hard to write, and per-step human scoring would need to fall by several orders of magnitude to be practical for deep RL.
- **Method** Learns a reward predictor from human choices between short trajectory clips, then trains a policy against the predicted reward with standard RL algorithms.
- **Results** Nearly matched RL on the true reward on the simulated robotics tasks with 700 labels, and learned a Hopper backflip from 900 queries in less than an hour.

## Why reward functions are hard to write

Deep RL has advanced most where the reward is clearly defined, but many goals people care about are complex, poorly defined, or hard to state as a number. Writing a reward for something like wiping a table or scrambling an egg means mapping robot sensor readings to a score, and a simple proxy tends to be optimized in ways that miss what the designer actually wanted.

Demonstrations offer another route: inverse reinforcement learning recovers a reward from them, and imitation learning copies the demonstrated behavior directly. Both break down for behaviors people cannot easily demonstrate, such as controlling a robot whose body and number of joints differ greatly from a human's.

Letting a person score every step as reward is a third option, but deep RL can need hundreds or thousands of hours of experience, so per-step judgments would have to fall by several orders of magnitude to be practical. The target is therefore a method that can handle behaviors that can be recognized but not demonstrated, can be taught by non-expert users, scales to large problems, and uses little feedback.

## Learning a reward predictor from comparisons

The core idea is to learn a reward model from human preferences and then optimize the policy against that learned reward, instead of against a hand-written one. Two deep networks are kept at all times: a policy that maps observations to actions and a reward predictor that maps observation-action pairs to scalar rewards.

Three processes run asynchronously. The policy collects trajectories and is updated by a standard RL algorithm to maximize the predicted reward; pairs of segments from those trajectories go to a human; and the reward predictor is refit by supervised learning on all comparisons gathered so far. Trajectories flow from the first process to the second, human comparisons from the second to the third, and reward predictor parameters back to the first.

The human does not give an absolute score. Each comparison shows two clips, each between 1 and 2 seconds long, and the person indicates which is preferred, that they are equal, or that they cannot be compared. Comparisons were chosen because people found them easier to give consistently than numerical scores, and the authors judged them about as useful for learning preferences in some domains.

The authors report that clip comparisons were more helpful than comparisons of single states, and that collecting feedback online keeps the policy from exploiting weaknesses of the learned reward. The online-versus-offline question is tested later in the ablations.

## The preference likelihood and its loss

The reward estimate is treated as a latent explanation of the human's judgments. The probability that the human prefers segment sigma one over sigma two depends exponentially on the predicted reward summed over the time steps of each clip: \\\[ \\hat{P}\[\\sigma\_1 \\succ \\sigma\_2\] = \\frac{\\exp\\left(\\sum\_t \\hat{r}(o^1\_t,a^1\_t)\\right)}{\\exp\\left(\\sum\_t \\hat{r}(o^1\_t,a^1\_t)\\right)+\\exp\\left(\\sum\_t \\hat{r}(o^2\_t,a^2\_t)\\right)} \\\]

The reward predictor is chosen to minimize a cross-entropy loss between these predicted probabilities and the recorded labels, where mu of 1 and mu of 2 are the label distribution over the two segments: \\\[ \\mathrm{loss}(\\hat{r}) = -\\sum\_{(\\sigma\_1,\\sigma\_2,\\mu)\\in D} \\left\[\\mu(1)\\log \\hat{P}\[\\sigma\_1\\succ\\sigma\_2\] + \\mu(2)\\log \\hat{P}\[\\sigma\_2\\succ\\sigma\_1\]\\right\] \\\] The leading minus sign means the objective is minimized, so lower values correspond to better agreement with the labels.

This is the Bradley-Terry model applied to trajectory segments, and it is a specialization of the Luce-Shepard choice rule. The authors draw an analogy with Elo ratings for chess: a difference in predicted reward between two segments plays the role of a rating difference and estimates the chance that the human picks one segment.

The fitted model is adjusted with a 10% chance that the human responds uniformly at random, instead of applying the softmax directly. The reason given is that human raters make errors at a roughly constant rate, which does not shrink as the reward difference grows. Equation 1 uses no discounting. The authors note this treats the human as indifferent to when events occur within a segment, and that explicit discounting or inferring the human's discount would also be reasonable.

## Ensembles and query selection

The method trains an ensemble of predictors, each on a bootstrap-style sample of the preference database drawn with replacement, normalizes each predictor independently, and averages the results. The L2 regularization coefficient is adjusted so that validation loss stays between 1.1 and 1.5 times the training loss, and some domains also use dropout.

Candidate pairs of segments are sampled in large numbers. Each ensemble member predicts a preference for every pair, and the pairs with the highest variance across members are sent to the human. This is a crude approximation to uncertainty in the reward, similar in spirit to Daniel et al. (2014). The authors note that querying by expected value of information would be more principled, and leave it for future work.

## Choosing the RL algorithm for a changing reward

Once rewards are predicted, the policy problem is ordinary RL, so any suitable algorithm can be used. Policy gradient methods were preferred because the learned reward can change during training, and these methods tolerate such changes. Advantage actor-critic (A2C) optimizes the policy on Atari games, and trust region policy optimization (TRPO) on the simulated robotics tasks.

On Atari, the reward is treated as a function of the preceding 4 observations rather than of a single observation. In a general partially observable environment, the reward could instead depend on the whole observation sequence and be modeled with a recurrent network.

Each algorithm uses settings that work for traditional RL tasks, and the only hyperparameter adjusted is the entropy bonus for TRPO. The authors explain that TRPO's trust region is what keeps exploration adequate, and this can break down when the reward is changing. Predicted rewards are normalized to zero mean and constant standard deviation, since the scale of the rewards is not determined by learning from comparisons.

## Simulated robotics results

The MuJoCo experiments cover eight simulated robotics tasks. The main run uses 700 queries to a human rater, compared against synthetic oracle runs with 350, 700 and 1400 queries and against RL on the true reward. Figure 2 plots the true-reward curves for each of these conditions.

With 700 labels the method nearly matches RL on all of these tasks. Training with learned rewards tends to be less stable and to have higher variance, while the mean performance is comparable.

With 1400 synthetic labels the method ends slightly above RL with the true reward. The authors attribute this to a better-shaped learned reward, which gives positive reward to behaviors that usually earn high true reward.

Real human feedback is typically a little less effective than synthetic feedback, ranging from half as efficient to equally efficient depending on the task. On Ant, human feedback clearly outperformed the synthetic feedback. The authors attribute this to asking people to prefer an upright robot, a shaping signal that the simpler upright bonus in the RL reward did not provide.

Feedback for Reacher and Cheetah came from an author, while the other tasks used contractors unfamiliar with the environments and with the algorithm. The real-feedback curves are single runs, while the synthetic curves average 5 runs.

## Atari results

The Atari set covers seven games. The main run uses 5,500 queries to a human rater, compared against synthetic oracle runs with 350, 700 and 1400 queries and against RL on the true reward. Each point in the Atari curves is the average reward over about 150,000 consecutive frames, and the synthetic curves average 3 runs while the real-feedback curve is a single run.

The method has more difficulty matching RL here than on the robotics tasks, but it shows substantial learning on most games. On BeamRider and Pong, synthetic labels match or come close to RL with only 3,300 labels. On Seaquest and Qbert, synthetic feedback eventually reaches near-RL performance but learns more slowly. On SpaceInvaders and Breakout it never matches RL, although the agent improves, often passing the first level in SpaceInvaders and reaching 20 on Breakout, or 50 with enough labels.

The authors point to human error in labeling, inconsistency between contractors who label the same run, and uneven labeling rates that concentrate labels in narrow parts of the state space.

On Qbert, real human feedback does not get the agent past the first level. The authors suggest that short Qbert clips are confusing to evaluate. On Enduro, A3C has difficulty because passing other cars by random exploration is rare, and synthetic labels do little better. Human labelers reward any progress toward passing cars, which shapes the reward, and the human-feedback results are comparable to those achieved with DQN.

## Novel behaviors

The same parameters as the earlier experiments are used. A Hopper robot learns a sequence of backflips from 900 queries in less than an hour, consistently performing a backflip, landing upright, and repeating. Figure 4 shows four frames from one of these backflips.

A Half-Cheetah robot learns to move forward while standing on one leg, using 800 queries in under an hour.

These behaviors were trained with feedback from the authors, not from contractors. No reward function exists for these behaviors, so they are judged qualitatively by people inspecting videos rather than by a quantitative score, and the authors note that a reward for them would be hard to engineer by hand.

## Ablation results

Six variants are compared. Random queries picks query pairs uniformly rather than by disagreement. No ensemble trains one predictor with random queries. No online queries trains only on queries gathered at the start of training. No regularization removes the L2 term and keeps dropout. No segments uses segments of length 1 on the robotics tasks.

Target fits the predictor to the true total reward of each segment with mean squared error instead of using comparisons. Figure 5 shows MuJoCo performance after each removal, averaged over 5 runs with 700 synthetic labels each.

The most notable result is that training the reward predictor offline performs poorly. The occupancy distribution shifts as the policy learns, so the predictor captures only part of the true reward, and optimizing that partial reward can produce behavior that the true reward does not value. On Pong, the offline agent avoids losing points without scoring, which leads to extremely long volleys.

Figure 6 shows the Atari ablations, averaged over 3 runs with 5,500 synthetic labels. The authors conclude that human feedback needs to be interleaved with RL learning rather than supplied all at once.

The authors chose comparisons because consistent comparisons were easier for humans to give than consistent absolute scores. On Atari the rewards were clipped, so effectively only the sign was predicted. Comparisons and targets differed in performance, but neither consistently outperformed the other.

## Clip length and single frames

Single frames gave large performance differences compared with clips. To reach the same results with single frames, the authors estimate that many more comparisons would be needed.

The authors chose the shortest clip length for which evaluation time was linear. On Atari, longer clips were also easier to compare because they give more context than single frames.

## Interaction cost and human time

The authors argue that agent-environment interactions are often much cheaper than human interaction, and that learning a separate reward model with supervised learning reduces interaction complexity by roughly 3 orders of magnitude. They argue that further sample-complexity gains already bring diminishing returns, because compute is priced close to the cost of non-expert feedback.

## Limitations

Experiments cover eight simulated robotics tasks and seven Atari games, and the real-feedback curves for each come from a single run.

The novel behaviors were trained with feedback from the authors rather than from contractors, and because no reward function exists for them, their evaluation is qualitative.

Querying by ensemble disagreement is a crude approximation, and the paper states that in some tasks it impairs performance.

Real feedback falls short of synthetic feedback on some Atari games. The authors suggest human labeling error, inconsistency between contractors, and uneven labeling rates as possible causes, and real feedback fails on Qbert.

Equation 1 omits discounting, and the Atari reward is assumed to depend on the preceding 4 observations, so a general partially observable setting would need a different reward model.

## Paper info

- **Authors**: Paul Christiano, Jan Leike, Tom B. Brown, Miljan Martic, Shane Legg, Dario Amodei
- **Venue**: arXiv · Preprint
- **First published**: 2017-6-12
- **Added**: 2026-10-20
- **Updated**: 2023-2-17
- **Version**: v4
- **arXiv**: 1706.03741
- **Category**: stat.ML · cs.AI · cs.HC · cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1706.03741v4) · [PDF ↗](https://arxiv.org/pdf/1706.03741v4)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Paul Christiano, Jan Leike, Tom B. Brown, Miljan Martic, Shane Legg, Dario Amodei (2017). Deep reinforcement learning from human preferences. arXiv:1706.03741v4. https://arxiv.org/abs/1706.03741v4

**BibTeX**

```
@misc{christiano2017deep,
  title = {{Deep reinforcement learning from human preferences}},
  author = {Paul Christiano and Jan Leike and Tom B. Brown and Miljan Martic and Shane Legg and Dario Amodei},
  year = {2017},
  eprint = {1706.03741},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.03741v4}
}
```

## Other paper commentary

- [Mastering Atari, Go, Chess and Shogi by Planning with a Learned Model](https://refivu.com/en/papers/b99bbef4-e405-4227-881f-01ef69bed080-mastering-atari-go-chess-and-shogi-by-planning.md)
- [Trust Region Policy Optimization](https://refivu.com/en/papers/30e842a2-bb44-47ff-9ad7-d25925260b2c-trust-region-policy-optimization.md)
- [Proximal Policy Optimization Algorithms](https://refivu.com/en/papers/831b67ec-e2f9-4c8f-914d-dc9387e23e27-proximal-policy-optimization-algorithms.md)
- [Policy Optimization for Robust Average Reward MDPs](https://refivu.com/en/papers/afaa3408-a6a7-4cab-ab30-117a9e30f158-policy-optimization-for-robust-average-reward-mdps.md)
- [Escaping the Mode: Multi-Answer Reinforcement Learning in LMs](https://refivu.com/en/papers/57396737-909e-4ef4-acf5-3d267b659acf-escaping-the-mode-multi-answer-reinforcement-learning-in.md)
- [Lazy Agents Answer Against Their Own Beliefs: Reinforcement Learning with Verifiable Beliefs Teaches Them to Act on What They Believe](https://refivu.com/en/papers/ad05164f-2508-4c12-9720-9f989b190939-lazy-agents-answer-against-their-own-beliefs-reinforcement.md)
- [Training language models to follow instructions with human feedback](https://refivu.com/en/papers/9a0e4c9e-5f65-4b6a-b559-76f0a9c35e07-training-language-models-to-follow-instructions-with-human.md)
- [Score-Based Generative Modeling through Stochastic Differential Equations](https://refivu.com/en/papers/11d114a6-a425-47ea-9133-db43e9c355d2-score-based-generative-modeling-through-stochastic.md)
- [Chain-of-Thought Prompting Elicits Reasoning in Large Language Models](https://refivu.com/en/papers/453dc85c-e794-4846-bb89-b8b678635169-chain-of-thought-prompting-elicits-reasoning-in-large.md)
- [Denoising Diffusion Probabilistic Models](https://refivu.com/en/papers/3a1faf88-ed3a-4c3a-bf1e-1afc6e7184fa-denoising-diffusion-probabilistic-models.md)
- [Llama 2: Open Foundation and Fine-Tuned Chat Models](https://refivu.com/en/papers/5c1523c3-cd1c-48ba-8289-86de02d688dd-llama-2-open-foundation-and-fine-tuned-chat.md)
- [Mixtral of Experts](https://refivu.com/en/papers/5e1d3fc2-10c6-4121-ba03-4ef4430aadca-mixtral-of-experts.md)

## Terms in this paper

- [reinforcement learning](https://refivu.com/en/terms/6c51042515d2-reinforcement-learning)
- [mean squared error](https://refivu.com/en/terms/e8df98e6d7b7-mean-squared-error)
- [cross-entropy loss](https://refivu.com/en/terms/14067bdf8b9f-cross-entropy-loss)
- [MuJoCo](https://refivu.com/en/terms/3bbbe9014268-mujoco)
- [ensemble](https://refivu.com/en/terms/0dba40e835aa-ensemble)
- [Bradley-Terry model](https://refivu.com/en/terms/18d616a35daa-bradley-terry-model)
- [trust region policy optimization](https://refivu.com/en/terms/a8b2d22d89a8-trust-region-policy-optimization)
- [Arcade Learning Environment](https://refivu.com/en/terms/e4eb3fb7dbe7-arcade-learning-environment)
- [policy gradient methods](https://refivu.com/en/terms/e03982582bc4-policy-gradient-methods)
- [Atari games](https://refivu.com/en/terms/62c7cdff1df2-atari-games)
- [entropy bonus](https://refivu.com/en/terms/fbdf17c4faed-entropy-bonus)
- [human feedback](https://refivu.com/en/terms/4a9d915e09be-human-feedback)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/46d079bb-6a3c-401d-94a4-5ceb66ab32a1-deep-reinforcement-learning-from-human-preferences)
