RLHF and DPO are two ways to teach an AI model which answers people prefer. RLHF (reinforcement learning from human feedback) first trains a separate reward model on human rankings, then uses reinforcement learning to push the chatbot toward high-scoring answers. DPO (direct preference optimization) skips the reward model and the reinforcement learning loop and trains the chatbot directly on pairs of “better” and “worse” answers. DPO is simpler and cheaper to run; RLHF is more complex but can keep learning from fresh answers during training, which still gives it an edge on some hard tasks.
Both methods come after the main training of a large language model, in the “alignment” or “post-training” stage that turns a capable model into a helpful, well-behaved assistant. This guide explains how each one works in plain English, compares them side by side, and sums up what the research says about which one is better.
RLHF vs DPO in one sentence each
- RLHF: people rank the model’s answers, a reward model learns to predict those rankings, and reinforcement learning (usually an algorithm called PPO) trains the chatbot to score well on that reward model.
- DPO: people (or another AI) pick the better of two answers, and the chatbot is trained directly to make the picked answer more likely and the rejected one less likely, with no reward model and no reinforcement learning.
The DPO authors at Stanford summed up their pitch in the title of their 2023 paper: “Your Language Model is Secretly a Reward Model”. Their insight was that the math of RLHF can be rearranged so the chatbot itself plays the role of the reward model, which lets you solve the same problem “with only a simple classification loss.”
What RLHF and DPO have in common
It helps to start with the overlap, because the two methods are closer than the names suggest.
- The same kind of data. Both learn from preferences: for a given prompt, which of two (or more) answers is better. You do not need anyone to write the perfect answer, only to judge which answer is better.
- The same starting point. Both usually begin with a model that has already gone through supervised fine-tuning (SFT), so it can already produce reasonable answers worth comparing.
- The same goal and the same guardrail. Both try to make preferred answers more likely while stopping the model from drifting too far from where it started. RLHF does that with a penalty (called a KL penalty) that compares the model to a frozen copy of itself; DPO builds the same frozen “reference model” directly into its loss.
So the real difference is not what the model learns from. It is how those preferences get turned into changes to the model’s weights.
How RLHF works
The classic RLHF recipe comes from OpenAI’s InstructGPT paper, the research behind the first ChatGPT-style models. It has three stages. (Our full RLHF explainer goes deeper on each one.)
1. Supervised fine-tuning
People write good example answers to prompts and the model is trained to imitate them. InstructGPT’s SFT dataset contained about 13,000 training prompts.
2. Train a reward model
The SFT model generates several answers to the same prompt, and human labelers rank them. To speed up collection, OpenAI showed labelers anywhere between 4 and 9 responses to rank at a time. A separate model, the reward model, is then trained to take a prompt and an answer and output a single score that predicts how much people would like it. InstructGPT’s reward-model dataset had 33,000 training prompts, and OpenAI used 6-billion-parameter reward models because they saved compute and larger ones trained less stably.
3. Optimize with reinforcement learning
Now the chatbot practices. It answers new prompts, the reward model scores each answer, and a reinforcement learning algorithm, Proximal Policy Optimization (PPO), nudges the chatbot toward higher-scoring answers. InstructGPT’s PPO stage used 31,000 prompts with no human labels, because the reward model did the grading.
The strength of this setup is that the model keeps generating fresh answers during training and the reward model can grade answers it has never seen. The weakness is complexity. The DPO paper describes RLHF as “a complex and often unstable procedure”: you are training and coordinating several models at once, and the chatbot can learn to exploit blind spots in the reward model instead of genuinely improving (a problem known as reward hacking).
How DPO works
DPO starts from the same preference data but cuts out stages 2 and 3. Each training example is a simple trio. Hugging Face’s TRL library, one of the most widely used tools for DPO, shows the format like this:
- Prompt: “What color is the sky?”
- Chosen: “It is blue.”
- Rejected: “It is green.”
(That is the example from TRL’s DPO Trainer documentation; real datasets use full-length answers.)
During training, the model looks at how likely it is to produce the chosen answer and the rejected answer, and compares both with a frozen reference copy of itself, usually the SFT model. The loss then rewards the model for widening the gap: the chosen answer should become more likely, relative to the reference, than the rejected one. TRL describes the objective as directly widening “the margin between the log-likelihoods of preferred and dispreferred completions, relative to a reference model, without requiring an explicit reward model.”
One setting, called beta (β), controls how hard the model leans into the preferences versus staying close to its old behavior. OpenAI’s fine-tuning docs explain it plainly: a higher beta is more conservative and favors previous behavior, while a lower beta follows the new preferences more aggressively. Meta used a beta of 0.1 for Llama 3.
Because there is no reward model to train and no answer generation during training, DPO looks a lot like ordinary fine-tuning. Its authors describe it as “stable, performant, and computationally lightweight,” with no need to sample from the model during fine-tuning or do significant hyperparameter tuning.

RLHF vs DPO side by side
| RLHF (reward model + PPO) | DPO | |
|---|---|---|
| Training data | Human rankings or comparisons of model answers | Pairs of chosen and rejected answers to the same prompt |
| Separate reward model | Yes, trained first | No |
| Reinforcement learning | Yes, usually PPO | No, a classification-style loss |
| Generates new answers during training | Yes (online) | No, usually a fixed dataset (offline) |
| Models involved in training | Policy, frozen reference, reward model, plus a value model in standard PPO | Policy and frozen reference |
| Setup and tuning | Complex; many moving parts | Simple; close to normal fine-tuning |
| Compute and memory | Higher | Lower |
| Main risk | Instability and reward hacking | Can overfit a static dataset and struggle when the data doesn’t match the model’s own outputs |
| Best known for | InstructGPT and early ChatGPT | Zephyr, Llama 3, many open-source models |
Which one works better? What the research says
The honest answer is “it depends on the task, the data and how much tuning you can afford.” Here is what the main studies found.
The case for DPO
In the original paper, DPO beat PPO-based RLHF at controlling the sentiment of generated text and matched or improved response quality in summarization and single-turn dialogue, while being “substantially simpler to implement and train.”
Meta’s experience is the most-cited real-world example. For Llama 3, the team explored PPO but “found that DPO required less compute for large-scale models and performed better, especially on instruction following benchmarks like IFEval.”
Hugging Face showed how far DPO can stretch a small budget. Its Zephyr-7B model was aligned with DPO on answers ranked by a stronger AI model rather than by people; the approach “requires only a few hours of training,” used no human annotation, and beat Llama2-Chat-70B, an RLHF-trained model ten times its size, on the MT-Bench chat benchmark.
The case for RLHF with PPO
Other researchers pushed back. A 2024 study from Tsinghua University, titled “Is DPO Superior to PPO for LLM Alignment?”, argued that DPO “may have fundamental limitations” and found that a well-tuned PPO surpassed other alignment methods in all of its test cases, including code competitions. The authors also found DPO is sensitive to mismatches between the model’s own outputs and the preference data, and that retraining DPO iteratively on fresh data works better than a single pass on a static dataset.
A separate study by researchers at the Allen Institute for AI and the University of Washington found that PPO outperformed DPO by up to 2.5% in math and 1.2% in general domains. But the same study found something more important: better preference data produced the largest improvements, ahead of the choice of algorithm.
The takeaway
DPO is the easier, cheaper default and is often good enough, especially for tone, style and instruction following. Online reinforcement learning tends to win when the task has hard, checkable answers, such as math and code, and when a team has the engineering muscle to tune it. And whichever you choose, the quality of your preference data matters more than the algorithm.
Where PPO and GRPO fit (RLHF vs DPO vs PPO)
People often search “DPO vs PPO” as if PPO were a third method. It isn’t quite: PPO is the reinforcement learning algorithm inside classic RLHF. So “RLHF vs DPO” and “PPO vs DPO” usually mean the same comparison.
PPO is expensive partly because it needs a value model (also called a critic) on top of the reward model. DeepSeek’s researchers noted that this value model is “typically another model of comparable size as the policy model”. Their alternative, Group Relative Policy Optimization (GRPO), drops the critic and instead compares a group of answers to the same prompt against each other, which they say significantly reduces training resources. GRPO is still reinforcement learning, so it sits on the RLHF side of the family, and it is closely associated with today’s reasoning models.
The broader point: the field did not simply swap RLHF for DPO. Many modern pipelines mix the pieces.
Real models: who uses what
- InstructGPT (OpenAI, 2022): the textbook RLHF pipeline, with SFT, then a reward model, then PPO.
- Zephyr-7B (Hugging Face, 2023): SFT followed by DPO on AI-ranked answers, with no human annotation.
- Llama 3 (Meta, 2024): a hybrid. Meta still trained a reward model on human preference data, used it to pick the best of many generated answers for further SFT (rejection sampling), and then aligned the model with DPO instead of PPO, repeating the cycle over six rounds.
- OpenAI’s fine-tuning API: offered DPO as a training method, where each example has a prompt, a preferred output and a non-preferred output, and recommended running SFT first and then DPO on top. Note that OpenAI is winding down that fine-tuning platform: it is closed to new users, and eligible existing customers can create training jobs until January 6, 2027.
When to use RLHF vs DPO
If you are fine-tuning your own model, for example an open model with LoRA or QLoRA, this rough checklist covers most situations.
Choose DPO if
- You already have, or can collect, pairs of better and worse answers.
- You want to adjust tone, style, format, helpfulness or refusals.
- You have limited GPUs or a small team, and want something that trains like normal fine-tuning.
- You want results that are easier to reproduce and debug.
Consider RLHF-style reinforcement learning (PPO or GRPO) if
- Answers can be scored automatically or by a reward model you trust, for example math problems with known answers or code that must pass tests.
- You want the model to keep exploring and learning from its own new answers.
- You have the engineering time to run and tune a multi-model training loop.
Start with SFT either way
Both methods work best on top of a model that already answers reasonably well. If you don’t have that yet, begin with supervised fine-tuning; our guide to fine-tuning in AI covers the wider set of options.
A final caution that applies to both: preference training makes a model better at producing answers people like, which is not the same as answers that are true. Neither method fixes AI hallucinations on its own, and both can shift a model’s safety behavior, so re-test your guardrails after every training run.
Frequently asked questions
What is the main difference between RLHF and DPO?
RLHF trains a separate reward model on human preferences and then uses reinforcement learning to optimize the chatbot against it. DPO skips the reward model and reinforcement learning, training the chatbot directly on pairs of preferred and rejected answers.
Is DPO a type of RLHF?
Loosely, yes. DPO solves the same problem as RLHF, learning from human preferences, and its authors derived it from the RLHF objective. Strictly, though, it is not reinforcement learning, because it uses a simple classification-style loss with no reward model and no generation during training.
Is DPO better than RLHF?
Not universally. DPO is simpler and cheaper and matched or beat PPO-based RLHF in its original tests, and Meta chose it for Llama 3. Other studies found well-tuned PPO still wins on some tasks, especially math and code. Better preference data usually matters more than the algorithm.
What is the difference between DPO and PPO?
PPO is the reinforcement learning algorithm used in classic RLHF: the model generates answers, a reward model scores them, and PPO updates the model. DPO needs no reward model and no generated answers; it trains directly on a fixed set of chosen and rejected answer pairs.
What is the difference between DPO and SFT?
SFT trains a model to imitate example answers. DPO trains it to prefer one answer over another. SFT usually comes first to teach the model to follow instructions, and DPO then refines the model’s choices using preference pairs.
What data do you need for DPO?
A preference dataset where each example has a prompt, a chosen (preferred) answer and a rejected answer. The preferences can come from human reviewers or from a stronger AI model acting as a judge.
The bottom line
RLHF and DPO both teach a model what good answers look like using comparisons rather than perfect examples. RLHF does it the long way, with a reward model and reinforcement learning; DPO does it directly, with a single training step on preference pairs. For most teams adjusting an open model’s tone, style and helpfulness, DPO is the practical starting point. For hard, checkable tasks like math and code, reinforcement learning methods such as PPO and GRPO still earn their extra complexity. To go deeper, read our explainers on RLHF, SFT and knowledge distillation.



