Glossary

Reinforcement Learning from Human Feedback (RLHF)

RLHF is the training step that turns a raw language model into a helpful chatbot, using human rankings of answers. Learn how it works and its limits.

Reinforcement learning from human feedback (RLHF) is a training method that teaches an AI model to give the kinds of answers people prefer. Humans compare and rank the model's responses, and the model is then adjusted to produce more of what scored well and less of what scored badly.

It is a big reason chatbots feel helpful and polite rather than rambling. A model fresh from pretraining can predict text well, but it does not naturally follow instructions or avoid harmful replies. RLHF closes much of that gap.

Key takeaways

  • RLHF comes after pretraining and is a form of fine-tuning.
  • It uses a separate "reward model" that learns to predict which answers humans would like.
  • OpenAI's 2022 InstructGPT paper made the method famous, and ChatGPT was built on the same approach.

How does RLHF work?

The classic recipe has three stages:

  1. Show good examples. People write sample answers to prompts, and the model is fine-tuned on them so it learns the basic format of a helpful reply.
  2. Train a reward model. The model writes several answers to the same prompt. Human reviewers rank them from best to worst. A second model learns from thousands of these rankings to score any answer the way the reviewers would.
  3. Optimize with reinforcement learning. The main model generates answers, the reward model scores them, and an algorithm (originally one called PPO) nudges the model's parameters toward higher scores. A guardrail stops it drifting too far from its original behavior.

An example

Ask a raw pretrained model "How do I boil an egg?" and it might continue with a list of other cooking questions, because that is what text on the web often looks like. After RLHF, it answers with clear steps and timings. In the InstructGPT paper, OpenAI reported that reviewers preferred answers from a 1.3-billion-parameter model trained this way over those from the 175-billion-parameter GPT-3.

Why does RLHF show up in the news?

It sits at the center of debates about AI behavior. Critics point out that a model trained to please raters can become sycophantic, agreeing with users or sounding confident when it is wrong, which ties into hallucinations. The values baked in also reflect the choices of the reviewers and the company. Labs have since added related methods, such as using AI-generated feedback guided by written principles, or simpler techniques that learn directly from preference pairs without a separate reward model.

Why It Matters

Every chatbot you use has a personality shaped by this training, which makes it more than a technical detail. When an assistant agrees with you too readily or sounds sure of a shaky answer, that may be a side effect of teaching it to please human raters. Push back, ask for sources and invite it to disagree. It is also worth remembering that a model's sense of a "good" answer reflects choices made by its reviewers and the company behind it.

Frequently asked questions

Who provides the human feedback in RLHF?

Usually paid contractors and specialist annotators hired by AI companies, sometimes through outside data firms. For technical subjects like coding, law or medicine, labs increasingly recruit people with expert knowledge.

Does RLHF make AI models safe?

It helps, but it is not a guarantee. RLHF reduces many harmful or unhelpful replies, yet people still find ways to trick models, and it can introduce problems such as excessive agreement. It is one layer among several safety measures.

Researched and written by The AI Telegraph staff and checked against primary sources. See our editorial policy. Spotted an error? Tell us.