Module 5 · Lesson 13
Once a model can generate many plausible responses, another question appears: which responses should it prefer?
That is the problem addressed by preference-based post-training. RLHF is one influential approach, but it is not the umbrella term for every modern preference-optimization method.
Where the feedback comes from
Before looking at the pipeline, it helps to spell out the two terms.
- RLHF stands for Reinforcement Learning from Human Feedback.
- RLAIF stands for Reinforcement Learning from AI Feedback.
Both approaches try to answer a problem that pre-training alone does not fully solve. A language model may be capable of producing several plausible answers to the same prompt, but which answer should it prefer? Which one is more helpful, accurate, relevant, safe, or aligned with the behavior we want from an assistant?
In RLHF, people provide the preference signal
Human evaluators are shown a prompt and two or more candidate responses produced by the model. Instead of writing the perfect answer from scratch, they may simply rank the responses or choose the one they prefer according to defined criteria.
For example, imagine the prompt asks the model to explain a medical term in plain language. Response A may be technically accurate but confusing. Response B may be equally accurate and much easier to understand. A human evaluator can mark Response B as preferred. Repeating this process across many prompts creates a dataset of human preferences.
Prompt
↓
Model produces several responses
↓
Human evaluator compares them
↓
Response B preferred over Response A
↓
Preference data
In a classic RLHF pipeline, that preference data can be used to train a separate reward model. The reward model learns to predict which kinds of responses people tend to prefer. Reinforcement learning can then update the language model so that responses receiving higher predicted rewards become more likely.
Human preferences
↓
Reward model learns what tends to be preferred
↓
Language model generates responses
↓
Reward model scores them
↓
Reinforcement learning updates the language model
The important point is that humans are usually not directly editing millions or billions of model parameters. They provide examples of preferred behavior, and the training process converts those preferences into a learning signal.
In RLAIF, another AI system provides some of the feedback
RLAIF follows a related idea, but an AI evaluator generates some of the rankings, critiques, or preference signals that humans would otherwise provide manually. The evaluator might compare two responses against a set of written principles and decide which response better follows them.
This can make preference generation easier to scale, but it does not mean humans disappear from the process. People still define goals, write or select principles, design evaluation criteria, inspect results, and decide whether the AI-generated feedback is trustworthy enough to use.
Prompt + candidate responses
↓
AI evaluator applies human-defined criteria
↓
AI-generated preference
↓
post-training signal
So the simplest distinction is: RLHF gets preference feedback primarily from people, while RLAIF uses another AI system to generate some of that feedback at scale. Both are ways of shaping which behaviors a model learns to prefer after pre-training.
RLHF, RLAIF, and DPO are related, but not identical
RLHF usually refers to pipelines where human preference data helps define a reward signal and reinforcement learning is used to optimize the model against that signal.
RLAIF uses AI-generated evaluations or preferences for some of the feedback that humans would otherwise provide, usually within a process still guided by human-written principles, examples, or evaluation criteria.
Direct Preference Optimization, or DPO, takes a different route. It can learn directly from preferred and rejected response pairs without training a separate reward model and then running a traditional reinforcement-learning loop.
The useful umbrella is therefore preference-based post-training. RLHF, RLAIF, DPO, and related methods are different ways of using preference information to shape model behavior.
Feedback improves behavior; it does not guarantee perfection
It would be misleading to say RLHF “prevents” a model from producing harmful, false, or inappropriate content. Preference data can be incomplete. Evaluators can disagree. Reward signals can be exploited. New prompts can expose behaviors that were not represented in training.
Safety therefore relies on layers: training data, post-training, system instructions, tool permissions, filters where appropriate, monitoring, evaluation, and product-level controls.
Alignment is a continuing engineering problem
The deeper lesson is that model behavior is not determined by pre-training alone. We can shape behavior after pre-training using feedback, but the quality of that feedback and the surrounding system still matter.
Alignment is not a switch that turns a model from “wrong” to “right.” It is an ongoing process of defining desired behavior, measuring it, finding failures, and improving the system.