The high cost of a well-behaved model
Training a large language model (LLM) is just the first step. A freshly trained model has absorbed huge amounts of text, but it doesn't yet know how to be useful in the way a chatbot needs to be: helpful, willing to follow instructions, and quick to refuse dangerous requests. Turning a raw model into one people can actually trust is a separate, difficult, and expensive process called alignment.
For years, the gold standard for alignment was a two-stage technique built on reinforcement learning (RL) — a training method where a system learns by trial and error, adjusting its behavior based on a reward signal rather than being shown the "correct" answer directly. This process required building and training a second, entirely separate AI model just to tell the first one what counted as a good response. It was notoriously unstable and computationally demanding, and the bill for GPU time and engineering hours put it out of reach for most smaller teams and independent researchers.
Then, in 2023, researchers from Stanford introduced a method that changed the calculus. In a paper titled Direct Preference Optimization: Your Language Model is Secretly a Reward Model ↗, Rafailov and colleagues showed that the second model — and the unstable RL step that went with it — simply wasn't necessary. Their method, Direct Preference Optimization (DPO), reaches the same goal in one stable stage of training by reframing the math of the problem so the language model can be optimized directly on examples of human preferences. That single insight dramatically lowered the barrier to building safe, aligned models.

The old way: Reward models and reinforcement learning
To understand why DPO was such a breakthrough, we first need to understand the complex machinery it replaced: Reinforcement Learning from Human Feedback (RLHF). As of the early 2020s, RLHF was the dominant paradigm for aligning powerful LLMs. It was a clever but brittle process that unfolded in two major stages.
Stage 1: Training a reward model
The goal of alignment is to teach a model human preferences. But "preference" is a fuzzy, subjective concept that you can't easily write a loss function for. RLHF's solution was to learn preferences from examples.
First, you take a base language model and use it to generate two or more responses to a given prompt. Human labelers then review these responses and choose the one they prefer. For a prompt like "Explain photosynthesis to a ten-year-old," they might be shown:
Response A: A dense, technical paragraph full of terms like "thylakoid membrane" and "ATP synthase."
Response B: A simple analogy involving a plant kitchen that uses sunlight as energy to cook its food.
The labeler would almost certainly choose Response B. This pair of responses—the prompt, the chosen answer (y_w), and the rejected answer (y_l)—forms a single data point in a preference dataset.
After collecting tens or hundreds of thousands of these preference pairs, you use them to train a completely separate model: the reward model (RM). The RM's job is to act as a proxy for the human labeler. It learns to take any prompt and response and output a scalar score—a reward—that predicts how much a human would like that response. In training, the RM is shown the chosen and rejected pairs and is optimized to assign a higher score to the chosen response than the rejected one.
This stage was a massive undertaking. The reward model itself was often a large language model, requiring its own dedicated training process, GPU resources, and engineering pipeline.
Stage 2: Fine-tuning with reinforcement learning
Once you had a working reward model, the second stage began. Here, you treated your base LLM as an "agent" in a reinforcement learning environment. The process looked like this:
A prompt is given to the LLM.
The LLM generates a response.
The response is shown to the reward model, which outputs a score (the reward).
An RL algorithm, most commonly Proximal Policy Optimization (PPO), updates the weights of the LLM to increase the probability of generating responses that receive a high reward.
This loop sounds simple, but it was fraught with peril. A key danger was the model learning to "reward hack"—finding bizarre, nonsensical outputs that happened to fool the reward model into giving a high score. To prevent this, and to stop the model from drifting too far from its original knowledge base, practitioners used a KL penalty.
The Kullback-Leibler (KL) divergence is a measure of how much one probability distribution differs from another. In RLHF, the KL penalty constrained the fine-tuned model's outputs to stay statistically close to the outputs of the original, base model. This acted as a regularizer, ensuring the model didn't completely forget how to write coherent text in its quest for reward.
This entire RL stage was a source of immense frustration for ML engineers. PPO is notoriously sensitive to hyperparameters, and training could be unstable, leading to models that collapsed or failed to converge. It required managing four separate models at once during training: the policy model being trained, a reference model for the KL penalty, the reward model, and sometimes a "critic" model to stabilize PPO.
The DPO breakthrough: A direct path to preference
The core insight of the DPO paper is both mathematical and elegant. The authors realized that the entire reward modeling and RL loop was an indirect way of solving a problem that could be tackled directly. They showed that the reward function optimized by the RLHF process has an exact, analytical solution that depends on the optimal policy and the reference policy. In simple terms, you can calculate the implicit reward from the language model itself.
This means you don't need to explicitly train a reward model first. You can skip that step and instead optimize the language model's policy directly on the preference data. This collapses the complex, two-stage, multi-model RLHF pipeline into a single, straightforward supervised fine-tuning stage.
How DPO works
DPO reframes alignment as a simple classification problem. For each preference pair (y_w, y_l), the goal is to make the model more likely to produce y_w and less likely to produce y_l.
The DPO loss function does this by comparing two ratios:
How much more the current model (
policy) prefers the winning response over the losing one.How much more the original model (
reference) prefers the winning response over the losing one.
The objective is to increase the log-probability of the chosen response while decreasing the log-probability of the rejected one. The "steepness" of this adjustment is controlled by a single hyperparameter, β, which plays a role similar to the KL penalty in RLHF: it controls how much the aligned model is allowed to deviate from the reference model. A low β means a weak penalty, allowing the model to change more drastically to fit the preference data. A high β keeps the model closer to its original behavior.
A simplified worked example
Imagine we have a prompt and a single preference pair. Our models assign the following log-probabilities to the chosen (y_w) and rejected (y_l) completions:
Model | Log-Prob of | Log-Prob of |
|---|---|---|
Reference Model (Original) | -10.5 | -12.0 |
Policy Model (Current) | -11.0 | -11.5 |
First, let's see what the models think.
The reference model already prefers the winning response. The log-prob difference is
-10.5 - (-12.0) = 1.5.The policy model also prefers the winner, but less confidently. The log-prob difference is
-11.0 - (-11.5) = 0.5.
DPO's goal is to increase the policy model's confidence. The loss function will calculate a gradient that nudges the policy model's weights so that, in the next step:
The log-probability of
y_wwill increase (e.g., from -11.0 to -10.8).The log-probability of
y_lwill decrease (e.g., from -11.5 to -11.8).
This directly increases the gap in favor of the preferred response. By doing this over an entire dataset of preference pairs, the model learns a general policy that reflects the aggregate human preferences, all without ever seeing an explicit reward score.
Why DPO unlocked preference tuning for everyone
The shift from RLHF to DPO has been one of the most significant practical developments in LLM training in recent years. By 2026, it has become the default method for most open-source and academic alignment projects, for several key reasons.
Simplicity and stability
The most immediate benefit is the radical simplification of the alignment process.
Before DPO (RLHF): Collect preference data -> Train a separate reward model -> Set up a complex PPO pipeline with four models -> Tune dozens of hyperparameters -> Hope for stable convergence.
After DPO: Collect preference data -> Run a single fine-tuning job with a simple loss function.
DPO turns alignment into a process that looks and feels almost identical to standard supervised fine-tuning (SFT). It is far more stable than PPO and requires tuning only one major hyperparameter (β) instead of a whole suite of them. This makes experiments faster, more repeatable, and less likely to fail catastrophically.
Resource efficiency
The second major win is the massive reduction in computational and engineering overhead. Training, storing, and running inference on a separate, multi-billion-parameter reward model is expensive. The RLHF training loop also has a high memory footprint, since it needs multiple models and their states loaded into GPU memory simultaneously.
DPO eliminates the reward model entirely. The training process requires only the policy model and the reference model (which can often be the same model initially). This drastically lowers the hardware requirements for alignment, making it accessible to university labs, startups, and even individuals who could never have afforded a full-scale RLHF setup.
A practical implementation
The difference is stark even in the code. In a library like Hugging Face's TRL, setting up an RLHF run with PPO requires instantiating a PPOTrainer and managing a complex loop of generation, reward calculation, and optimization steps.
In contrast, a DPO run uses a DPOTrainer that inherits from the standard Trainer. The setup is declarative and clean. You simply provide the model, the reference model, the dataset formatted with prompt, chosen, and rejected columns, and the β parameter.
# A simplified conceptual example of a DPO training setup
from trl import DPOTrainer, DPOConfig
training_args = DPOConfig(
beta=0.1,
output_dir="./dpo_model",
# ... other standard training arguments
)
trainer = DPOTrainer(
model,
ref_model=None, # Trainer can create a copy automatically
args=training_args,
train_dataset=preference_dataset,
tokenizer=tokenizer,
)
trainer.train()This simplicity means an engineer who knows how to run a standard fine-tuning job can now run a preference alignment job with minimal extra learning.
What do you give up? The trade-offs of DPO
While DPO has become the new default for many, it's not a complete replacement for RLHF. The older, more complex method still holds advantages in certain scenarios, and choosing DPO involves trade-offs.
Interpretability
A standalone reward model, for all its complexity, is an inspectable artifact. You can take it and "ask" it questions: feed it a dozen different responses and see which ones it scores highest. This helps you debug your alignment process and understand what kind of preferences it has learned. Has it learned to be concise? Has it learned to avoid certain topics? The RM can tell you.
With DPO, the reward is implicit, baked directly into the weights of the final language model. There is no separate object to query. You can see the model's final behavior, but you can't easily isolate the "preference" component to understand why it behaves that way.
Data quality sensitivity
The RLHF pipeline has a smoothing effect. When you train a reward model on a large, noisy preference dataset, the model is forced to learn a general function that approximates the preferences. It can effectively average out some of the noise and inconsistency from individual human labelers.
DPO is more direct. It optimizes the policy on every single preference pair, which can make it more sensitive to noise in the dataset. A few contradictory or low-quality preference pairs can more easily pull the final model in the wrong direction, since there's no intermediate reward model to regularize the signal. Consequently, DPO places an even higher premium on meticulously cleaned and highly consistent preference data.
Modularity and control
The RLHF framework is inherently modular. The reward signal is an input to the system, and you can combine it with other signals. For example, you could have a primary reward from your RM, and add a penalty from a toxicity classifier, a bonus for including citations, or a constraint from a grammar checker. This allows for complex, multi-objective optimization.
DPO, by contrast, is designed around a single objective: matching a set of pairwise preferences. While there are newer variants that extend the DPO concept, the base method is less flexible for combining multiple, disparate reward sources. For large, industrial applications where engineers want to shape model behavior with a complex suite of incentives and penalties, the explicit reward signal in RLHF remains a powerful tool.
The world after DPO
Writing in 2026, the effect of DPO shows up less in headlines and more in who gets to participate. What used to require a dedicated research team, a multi-model training pipeline, and a large GPU cluster can now be done by one person with a single high-end graphics card and a clean dataset. That shift is why DPO and its variants have become the default choice across open-source projects producing aligned models.
It has also moved where the hard work actually happens. Engineers spend less time firefighting unstable PPO runs and hunting for the right combination of four interacting hyperparameters, and more time on the question that was always the real bottleneck: where does good preference data come from, and how do you keep it clean and consistent? That's not a fully solved problem — DPO's sensitivity to noisy or contradictory preference pairs makes data curation more important, not less, and teams that skip this step will see it show up directly in model behavior. Nor does DPO give you the debugging handle that a standalone reward model provided; when an aligned model behaves oddly, there's no separate scoring function to interrogate, only the model's own weights.
What DPO did was strip away a layer of incidental complexity — the extra model, the unstable RL loop, the four-model memory footprint — that had nothing to do with the actual goal of teaching a model what people value. The underlying challenge of alignment is still there. It's just easier now to see clearly, and cheaper for more people to work on directly.

