liveBook · Manning

Reinforcement learning with human feedback

As explained in Introduction to Generative AI, Second Edition

Reinforcement learning from human feedback (RLHF) is a technique that uses human evaluations or preferences to estimate rewards and optimize model behavior.

Reinforcement learning from human feedback (RLHF) steers a language model by having people judge responses as acceptable, problematic, or preferable. Those judgments estimate a reward function, which then guides the model toward responses that human evaluators rate more favorably. Because evaluators can disagree, the resulting reward approximates rather than perfectly defines ideal behavior. section 2.10

RLHF is useful but not cost-free:

  • It can produce more robust behavioral changes than supervised fine-tuning, while requiring additional data to train a reward model. section 2.11 section 3.8
  • Direct preference optimization (DPO) trains directly on human preference pairs, avoiding the intermediate reward model and often reducing complexity and computation. section 2.11
  • RLHF can accommodate varied feedback and complex reward functions, whereas the original DPO formulation relies on binary comparisons between two responses. section 2.11

Safety post-training

Providers use RLHF among other post-training methods to steer responses away from harms such as privacy violations and dangerous misinformation. This work can expose outsourced annotators to traumatic material, while disagreement about what counts as safe makes the target behavior contested rather than purely technical. section 3.8

Figure 2.7 A typical setup for reinforcement learning from human feedback, after a supervised fine-tuning step for dialogue
A diagram of a diagram

AI-generated content may be incorrect.

Shows a typical RLHF arrangement for dialogue after supervised fine-tuning, clarifying how human feedback enters the training process. section 2.10

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains evaluation, reward estimation, and model improvement conceptually, while deferring implementation details and exact optimization procedures.
Examples
Uses dialogue responses, preference labels, unsafe-input responses, and content such as hate speech, sexual abuse, and violence.
What it assumes
Assumes basic awareness of language-model pretraining and supervised fine-tuning, while introducing reward estimation and preference-based steering.
What you can do after
Evaluate/understand how human preferences shape model behavior and why reward-model design, data demands, and labor conditions matter.
How it connects
Connects reinforcement learning with reward functions, supervised fine-tuning, direct preference optimization, and AI feedback.

Also explained in

Compare how 14 books explain reinforcement learning with human feedback →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.