Nestor G Pestelos Jr · Reference · Print this page

Artificial Intelligence · Model Alignment

Reinforcement Learning from Human Feedback (RLHF)

Reference entry · last updated September 11, 2026 · Previous version (20260911)

Reinforcement learning from human feedback (RLHF) uses human evaluations to guide reinforcement learning. In a common language-model pipeline, a reward model learns from human comparisons, and the language model is optimized against that reward.[1, 4]

1. First Principles: Preference as the Training Signal

RLHF uses human feedback to learn objectives that are difficult to specify directly. In preference-based RLHF, people compare outputs or behavior, and a reward model learns from those judgments.[1]

A common preference model assumes a latent reward function \(r^*(x, y)\) over prompt \(x\) and response \(y\), and models a human's pairwise choice with the Bradley-Terry model: given a preferred response \(y_w\) and a rejected response \(y_l\), the probability that a rater picks \(y_w\) is[2, 8]

$$P(y_w \succ y_l \mid x) = \sigma\big(r^*(x, y_w) - r^*(x, y_l)\big)$$

where \(\sigma\) is the logistic function. Only reward differences are identifiable, so an additive constant is free, and the model treats disagreement between raters as logistic noise around a single shared utility.

Given a reward function, a common language-model objective adds a Kullback-Leibler (KL) penalty to expected reward. The tuned policy \(\pi_\theta\) is penalized for moving away from a reference policy \(\pi_{\text{ref}}\), usually the supervised fine-tuned model:[4, 8]

$$\max_\theta \; \mathbb{E}_{x \sim \mathcal{D}} \left[ \mathbb{E}_{y \sim \pi_\theta(\cdot \mid x)}[r(x,y)] - \beta D_{\text{KL}}\big(\pi_\theta(\cdot \mid x) \,\|\, \pi_{\text{ref}}(\cdot \mid x)\big) \right]$$

This is a KL-regularized objective: divergence has a cost rather than a hard upper bound. For a fixed reward scale, a larger \(\beta\) penalizes departure from the reference policy more strongly. A smaller \(\beta\) permits more departure, which can increase exposure to reward-model errors; neither setting guarantees fluency or diversity.[8, 9]

2. The Standard Three-Stage Pipeline

The InstructGPT pipeline runs in three stages: supervised fine-tuning, reward model training, and reinforcement learning against that reward.[4]

2.1 Supervised Fine-Tuning

A base model is first fine-tuned on curated prompt-response demonstrations so that it follows the conversational schema and produces on-task answers. This model becomes both the starting point for reinforcement learning and the reference policy \(\pi_{\text{ref}}\) in the KL term.[4]

2.2 Reward Modeling

Human labelers rank or compare multiple sampled responses to each prompt. A reward model \(r_\psi(x, y)\), typically the SFT model with a scalar output head, is trained on these comparisons by minimizing the negative log-likelihood of the Bradley-Terry model:[3, 4]

$$\mathcal{L}(\psi) = -\,\mathbb{E}_{(x,\, y_w,\, y_l) \sim \mathcal{D}} \Big[ \log \sigma\big( r_\psi(x, y_w) - r_\psi(x, y_l) \big) \Big]$$

The reward model compresses a finite set of human comparisons into a function that can score any response. Its accuracy on held-out comparisons, and its behavior far from the data it was trained on, affect the quality of the optimized policy.

2.3 Policy Optimization with PPO

The policy is optimized against the reward model with Proximal Policy Optimization (PPO) in the InstructGPT pipeline.[4, 6] A per-token KL penalty is folded into the reward, giving this regularized reward for a full response:

$$R(x, y) = r_\psi(x, y) - \beta \, \log \frac{\pi_\theta(y \mid x)}{\pi_{\text{ref}}(y \mid x)}$$

Token generation is treated as a sequential decision process: the state is the prompt plus the tokens produced so far, each action is the next token, and the environment transition is deterministic concatenation. PPO's clipped surrogate objective discourages large policy updates; see reinforcement learning for that objective in full. A separate value network estimates the advantage, which adds memory and tuning cost.

3. Direct Preference Optimization

Direct Preference Optimization (DPO) removes the separate reward model and the online sampling loop.[8] Rafailov et al. showed that the optimal policy for the KL-regularized objective corresponds to an implicit reward

$$r(x, y) = \beta \, \log \frac{\pi_\theta(y \mid x)}{\pi_{\text{ref}}(y \mid x)} + \beta \, \log Z(x)$$

where \(Z(x)\) is a partition function that cancels inside a Bradley-Terry difference. Substituting this parameterization into the preference loss gives an objective in the policy alone, trained on a fixed dataset of comparison pairs with a binary cross-entropy loss:

$$\mathcal{L}_{\text{DPO}}(\theta) = -\,\mathbb{E}_{(x,\, y_w,\, y_l)} \left[ \log \sigma \left( \beta \log \frac{\pi_\theta(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)} - \beta \log \frac{\pi_\theta(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)} \right) \right]$$

Rafailov et al. evaluated DPO on sentiment control, summarization, and single-turn dialogue. DPO outperformed PPO on sentiment control and matched or improved response quality on the other two tasks in their experiments.[8]

Standard DPO trains on a fixed preference dataset. PPO-based RLHF samples new responses during optimization and scores them with a reward model that can remain fixed. Collecting new human comparisons is a separate labeling step.[4, 8]

4. Reward Model Overoptimization

A reward model approximates human judgment. Strong optimization can exploit its errors: the proxy score may rise while the quality it is intended to measure falls.[9]

Gao et al. studied this using a larger "gold" reward model to generate synthetic preferences and evaluate policies trained against smaller proxy models. Gold-model reward often rose and then fell as optimization increased. Their fitted relationships depend on the optimization method, reward-model size, and preference-data size. The gold model was a synthetic stand-in for human judgment.[9]

A KL penalty and early stopping can limit optimization against a flawed reward model. These controls reduce exposure to errors without establishing that the reward captures human preferences.[9, 12]

5. Reinforcement Learning from AI Feedback

Collecting human comparisons can be expensive and slow. Reinforcement learning from AI feedback (RLAIF) replaces some or all of the human labels with preferences generated by another language model.[10, 11]

Constitutional AI applies this to harmlessness: the model critiques and revises its own responses against a written list of principles, then a preference model is trained on AI-labeled comparisons and used for the RL stage, keeping human input mostly at the level of the principles.[10] Lee et al. compared RLAIF against RLHF on summarization and dialogue and reported comparable human win rates, along with a variant that scores responses directly with an off-the-shelf model instead of training a separate reward model.[11] AI feedback inherits the biases and blind spots of the labeling model.

6. Limitations and Open Problems

Casper et al. survey the failure modes of RLHF and separate problems that better engineering can address from ones that are structural to the approach.[12] The recurring issues:

7. Development

See also

References

  1. [1] P. Christiano, J. Leike, T. B. Brown, M. Martic, S. Legg, and D. Amodei, "Deep reinforcement learning from human preferences," in NeurIPS, 2017. https://arxiv.org/abs/1706.03741
  2. [2] R. A. Bradley and M. E. Terry, "Rank Analysis of Incomplete Block Designs: I. The Method of Paired Comparisons," Biometrika, vol. 39, no. 3/4, pp. 324–345, 1952. DOI: 10.2307/2334029
  3. [3] Y. Bai, A. Jones, K. Ndousse, et al., "Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback," arXiv:2204.05862, 2022. https://arxiv.org/abs/2204.05862
  4. [4] L. Ouyang, J. Wu, X. Jiang, et al., "Training language models to follow instructions with human feedback," in NeurIPS, 2022. https://arxiv.org/abs/2203.02155
  5. [5] D. M. Ziegler, N. Stiennon, J. Wu, T. B. Brown, A. Radford, D. Amodei, P. Christiano, and G. Irving, "Fine-Tuning Language Models from Human Preferences," arXiv:1909.08593, 2019. https://arxiv.org/abs/1909.08593
  6. [6] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov, "Proximal Policy Optimization Algorithms," arXiv:1707.06347, 2017. https://arxiv.org/abs/1707.06347
  7. [7] N. Stiennon, L. Ouyang, J. Wu, D. M. Ziegler, R. Lowe, C. Voss, A. Radford, D. Amodei, and P. Christiano, "Learning to summarize from human feedback," in NeurIPS, 2020. https://arxiv.org/abs/2009.01325
  8. [8] R. Rafailov, A. Sharma, E. Mitchell, S. Ermon, C. D. Manning, and C. Finn, "Direct Preference Optimization: Your Language Model is Secretly a Reward Model," in NeurIPS, 2023. https://arxiv.org/abs/2305.18290
  9. [9] L. Gao, J. Schulman, and J. Hilton, "Scaling Laws for Reward Model Overoptimization," in ICML, 2023. https://arxiv.org/abs/2210.10760
  10. [10] Y. Bai, S. Kadavath, S. Kundu, et al., "Constitutional AI: Harmlessness from AI Feedback," arXiv:2212.08073, 2022. https://arxiv.org/abs/2212.08073
  11. [11] H. Lee, S. Phatale, H. Mansoor, et al., "RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback," in ICML, 2024. https://arxiv.org/abs/2309.00267
  12. [12] S. Casper, X. Davies, C. Shi, et al., "Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedback," Transactions on Machine Learning Research, 2023. https://arxiv.org/abs/2307.15217
  13. [13] M. Sharma, M. Tong, T. Korbak, et al., "Towards Understanding Sycophancy in Language Models," in ICLR, 2024. https://arxiv.org/html/2310.13548v4
  14. [14] OpenAI, "GPT-4 Technical Report," arXiv:2303.08774, 2023. https://arxiv.org/html/2303.08774v6