liveBook · Manning

Reinforcement learning with human feedback

As explained in The AI Pocket Book

A training method that uses human judgments as feedback to guide reinforcement learning and improve model outputs.

Reinforcement learning with human feedback (RLHF) improves an existing large language model by turning human preferences into training signals. People compare alternative answers, and the model is refined toward outputs they judge better. section 1.27 section 1.28

A practical training example

Workers write imaginary prompts, inspect pairs of possible answers, and mark each answer as preferred or not preferred. Those judgments teach a reward model to recognize desirable outputs. The reward model then scores new responses while reinforcement learning nudges the original LLM toward higher-scoring behavior. section 1.27

The process is a pipeline rather than a single training pass:

  • Collect thousands of prompts and pairs of alternative outputs, then have human workers rank the alternatives. section 1.27 section 1.28
  • Train a supervised model on those judgments so it can predict whether an LLM output is good or bad; this becomes the reward model. section 1.27
  • Generate outputs from the existing LLM and use the reward model to score them. section 1.27
  • Apply reinforcement learning to make small improvements repeatedly, aligning the LLM more closely with the human rankings. section 1.27 section 1.28

RLHF makes LLM training considerably more manual than simply collecting internet data. Human-written examples can teach popular tasks, conversation, and refusal of inappropriate requests, but the labeling work is substantial. User ratings and ranked answers may also become later improvement data, so sensitive prompts can create privacy concerns. section 1.28

How The AI Pocket Book covers it

How deep it goes
Explains preference labeling, reward-model training, scoring, and iterative refinement without detailing reinforcement-learning internals.
Examples
Uses imaginary prompts, ranked answer pairs, reward scores, ChatGPT, and thumbs-up or thumbs-down user ratings.
What it assumes
Assumes familiarity with LLMs and basic supervised and reinforcement learning, while explaining the RLHF pipeline plainly.
What you can do after
Understand how human preferences become training signals for refining an LLM and shaping its responses.
How it connects
Connects supervised learning, reinforcement learning, reward models, fine-tuning, and large language models.

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 The AI Pocket Book. The section links point to the parts of the book it draws on.