The short answer

RLHF and DPO both start from the same preference pairs, one answer marked over another. RLHF trains a separate reward model first, then runs reinforcement learning against it, usually PPO. So DPO skips that separate network and the RL loop entirely. Instead, it optimises one binary cross-entropy loss straight on the preference pairs. Even so, a reward concept survives inside that loss. The paper defines an implicit reward there: β times the log ratio of policy over reference model. So DPO removes the standalone reward network, not the idea of reward itself. Both methods still depend on a reference policy, the same SFT model each one starts from.

Every alignment method starts from preference pairs, one answer marked over another. RLHF and DPO turn that ranking into a training signal in different ways, though. So RLHF adds a separate reward model and a reinforcement-learning loop. DPO instead folds preference learning into one loss on the base policy itself.

This guide leans on one source throughout: Rafailov and colleagues’ paper, “Direct Preference Optimization: Your Language Model is Secretly a Reward Model.” New readers should read our RAG vs fine-tuning guide before this one. That guide covers how a pretrained model becomes task-specific.

RLHF vs DPO pipelines compared, with RLHF running supervised fine-tuning then a reward model then PPO, while DPO goes from supervised fine-tuning straight to a preference loss and skips the reward model
RLHF runs three stages; DPO keeps the supervised stage and replaces the other two with a single loss.

Why Alignment Starts With Preference Pairs

Both methods start from the same material. A prompt x goes to the SFT model, which produces two answers, y1 and y2. Then a human labeller marks one preferred, giving y_w ≻ y_l given x. So that single judgment call feeds everything downstream.

The paper models this ranking with the Bradley-Terry preference model. It assumes a latent reward function r*(x, y) behind every judgment. So the probability that y1 beats y2 follows one equation.

p*(y1 ≻ y2 | x) = exp(r*(x, y1)) / [ exp(r*(x, y1)) + exp(r*(x, y2)) ]

Since that ratio grows whenever r*(x, y1) outweighs r*(x, y2), a higher latent reward means a higher win probability. Neither RLHF nor DPO ever observes r* directly, though. Instead, both only see the pairwise labels, y_w over y_l.

How RLHF Works

The paper reviews RLHF as three phases. Each phase feeds the next, so skipping one breaks the chain.

  • Supervised fine-tuning. A pretrained model is fine-tuned on high-quality task data, producing π_SFT.
  • Preference sampling and reward learning. The SFT model generates answer pairs for each prompt, then human labellers rank them.
  • RL optimisation. The policy is fine-tuned against the learned reward, commonly with PPO, sometimes REINFORCE.

Phase one updates the model’s full set of weights, the same cost our LoRA vs QLoRA vs full fine-tuning guide compares against lighter alternatives. Phase two samples each answer pair with the decoding controls covered in our temperature vs top-p guide.

Then phase three optimises this objective.

max over π_θ:  E_(x~D, y~π_θ) [ r_φ(x, y) − β · D_KL( π_θ(y|x) ‖ π_ref(y|x) ) ]

β controls how far the policy may drift from π_ref, the reference policy. π_ref is the SFT model itself. The policy π_θ also starts from π_SFT, before RL optimisation pulls it toward higher reward.

How DPO Works

DPO collapses phases two and three into one step. Instead of training a reward model and then running RL, it optimises a single loss directly on the preference pairs.

L_DPO(π_θ; π_ref) = −E_(x, y_w, y_l)~D [ log σ( β log( π_θ(y_w|x) / π_ref(y_w|x) ) − β log( π_θ(y_l|x) / π_ref(y_l|x) ) ) ]

The paper describes this as “a simple binary cross entropy objective.” Its own Figure 1 caption states the goal plainly: DPO optimises for human preferences “while avoiding reinforcement learning.”

Three things disappear with that change. DPO needs no sampling from the language model during fine-tuning. Also, it needs no separate reward network. The paper adds that it avoids “significant hyperparameter tuning.” β still remains, though.

The gradient still has structure worth noting. It carries a dynamic, per-example importance weight, one that grows when the implicit reward orders a pair wrongly. Without that weighting, the paper reports, a naive version of the objective causes model degeneration. So in practice, the gradient increases the likelihood of y_w and decreases the likelihood of y_l.

RLHF vs DPO: Comparison Table

Comparison table of RLHF and DPO covering number of stages, whether a reward model is trained, use of reinforcement learning, loss type, where the reward lives, and the reference model requirement
Six differences between RLHF and DPO.

The table below lines up RLHF against DPO, field by field. Every value traces back to the paper’s own description of both pipelines.

AspectRLHFDPO
Training stagesThree: SFT, reward model, RLTwo: SFT, DPO preference loss
Separate reward model trainedYes, r_φ(x, y)No separate network
Reinforcement learning usedYes, dedicated RL phaseNo, avoids RL entirely
Optimiser or algorithmPPO, sometimes REINFORCEGradient descent on the DPO loss
Loss typeReward-model loss, then RL objectiveSingle binary cross-entropy loss
Where the reward livesInside a separate scalar networkImplicit, inside the policy/reference ratio
Reference model neededYes, inside the KL penaltyYes, inside the loss itself
Role of βWeighs the explicit KL penaltyScales the implicit reward
Samples during trainingYes, y ~ π_θ during the RL phaseNo LM sampling during fine-tuning
Offline vs online dataOnline sampling in the RL phaseOffline, fixed preference dataset
Implementation complexityHigher: reward network plus RL loopLower: one cross-entropy objective
Hyperparameter tuningRL phase adds its own tuningAvoids significant tuning; β still matters
What SFT providesπ_SFT seeds the policy and π_refπ_SFT seeds the policy and π_ref
Preference model assumedBradley-Terry model, Eq. 1Bradley-Terry model, Eq. 1
Gradient weightingStandard PPO policy-gradient estimateDynamic, per-example importance weight
Needed at inference timeNothing beyond the trained policyNothing beyond the trained policy

One row deserves a second look, the reward’s location. RLHF keeps it in a separate network. DPO folds it inside the policy instead, as the next section explains.

The Reward Model DPO Removes

Phase two of RLHF trains a reward network, r_φ(x, y). So its loss follows directly from the Bradley-Terry model above.

L_R(r_φ, D) = −E_(x, y_w, y_l)~D [ log σ( r_φ(x, y_w) − r_φ(x, y_l) ) ]

This loss asks for one thing: score the preferred answer higher than the rejected one. Since σ squashes the difference into a probability, the network learns from ordering, not raw magnitude.

The paper notes this network is often initialised from the SFT model itself. A linear layer sits on top of the final transformer layer, the same stack covered in our self-attention vs cross-attention guide, producing one scalar reward. So the reward model is not a different architecture. It reuses the base model discussed in our BERT vs GPT guide, with a small head swapped in.

So DPO removes exactly this network, the standalone r_φ. What replaces it is the subject of the next section.

The Reward That Never Goes Away

DPO does not delete the reward. It reparameterises it instead.

The paper defines the reward implicitly represented by the policy and reference model this way.

r̂_θ(x, y) = β log( π_θ(y|x) / π_ref(y|x) )

So the reward becomes a log-ratio between the trained policy and the reference model. That change of variables, in the paper’s own words, “avoids fitting an explicit, standalone reward model.” The reward concept survives. So only the separate network disappears.

Explicit reward (RLHF):  r_φ(x, y)
Implicit reward (DPO):   β log( π_θ(y|x) / π_ref(y|x) )
Diagram contrasting the explicit RLHF reward network with the DPO implicit reward, written as beta times the log ratio of the policy probability over the reference model probability
The standalone reward network disappears in DPO, but the reward itself does not; it becomes a log-ratio.

Both rows score the same thing, an answer y for a prompt x. RLHF scores it with a separate network. DPO scores it instead from two numbers already on hand, the policy’s probability and the reference model’s probability.

This is why “DPO has no reward model” overstates the case. The explicit, standalone network is gone, true. An implicit reward still sits inside the loss, defined by that same log-ratio.

The Two Losses Side by Side

Both training losses share one shape. Each one asks a policy or a reward network to prefer y_w over y_l.

Reward-model loss (RLHF): L_R(r_φ, D) = −E_(x, y_w, y_l)~D [ log σ( r_φ(x, y_w) − r_φ(x, y_l) ) ]
DPO loss: L_DPO(π_θ; π_ref) = −E_(x, y_w, y_l)~D [ log σ( β log( π_θ(y_w|x) / π_ref(y_w|x) ) − β log( π_θ(y_l|x) / π_ref(y_l|x) ) ) ]

Look at the term inside σ in each line. RLHF subtracts two scalar rewards from a separate network. DPO subtracts two implicit rewards instead, each a scaled log-ratio. Swap r_φ(x, y) for β log( π_θ(y|x) / π_ref(y|x) ), and the two losses collapse into the same form.

That is not a coincidence. It is the paper’s central claim: a language model is secretly a reward model, once its output is compared against a reference.

What Each Approach Costs

RLHF pays for its extra phase. It needs a reward network trained first, then an RL loop on top of that. Since the RL phase samples y ~ π_θ during training, it also needs infrastructure for that sampling.

DPO removes those costs, though not every cost. It still needs a reference model, π_ref, held fixed during training. β still needs a value, and the paper is explicit that DPO avoids significant hyperparameter tuning, not all of it.

Likewise, stability follows a similar pattern. RLHF’s RL phase inherits the tuning and sampling concerns of reinforcement learning generally. DPO instead trains on a fixed dataset with a single cross-entropy objective, closer to standard supervised learning.

One more cost applies to both equally. So neither approach adds anything at inference time. The deployed model is just the trained policy, whichever loss produced it.

When to Use Which

The choice tracks the trade-offs above, not a universal winner. The paper makes no such claim, and neither should a reader.

A team already running a stable RL pipeline can keep the reward model and PPO. That path adds a training stage, but it keeps the reward as an explicit, inspectable network.

A team that wants to skip the RL loop can adopt DPO’s single loss instead. That path removes the separate network and the sampling step, while keeping the same reference-model requirement.

Either way, the underlying assumption stays the same. So both methods trust the Bradley-Terry model to translate pairwise labels into a usable signal.

Interview Questions

Three phases. The paper lists them as supervised fine-tuning, preference sampling and reward learning, then RL optimisation.

Yes, but not a separate one. Instead, DPO removes the explicit, standalone reward network. An implicit reward remains, defined as β log( π_θ(y|x) / π_ref(y|x) ).

Yes. π_ref appears directly inside the DPO loss itself, not just inside a KL penalty like RLHF.

No. The paper’s own Figure 1 caption says DPO optimises preferences while avoiding reinforcement learning. Its objective is a binary cross-entropy loss instead.

In RLHF, β weighs the KL penalty inside the RL objective. In DPO, β scales the implicit reward inside the loss instead.

Frequently Asked Questions

No. Instead, it eliminates the separate, standalone network only. An implicit reward remains inside the DPO loss, defined as β log( π_θ(y|x) / π_ref(y|x) ).

Yes. π_ref appears directly inside the DPO loss, Eq. 7 in the paper. Both RLHF and DPO keep this tether to the SFT model.

It is β times the log ratio of policy over reference model, r̂_θ(x, y) = β log( π_θ(y|x) / π_ref(y|x) ). The paper defines it this way once the reward is folded into the policy.

Three: supervised fine-tuning, preference sampling and reward learning, then RL optimisation. So each phase feeds directly into the next one.

Commonly PPO. The paper also names REINFORCE as an alternative for that same phase.

No. The paper says it avoids significant hyperparameter tuning, not all tuning. β still needs a value, and it still matters.

Both assume the Bradley-Terry model from Eq. 1. It models the probability that one answer beats another through a latent reward.

It is often initialised from the SFT model itself. A linear layer on the final transformer layer then outputs a single scalar reward.

Wrapping Up

RLHF and DPO start from the same preference pairs and the same Bradley-Terry assumption. RLHF then trains a separate reward model and runs reinforcement learning against it. DPO instead folds both steps into one binary cross-entropy loss.

Remember the trap this page exists for. DPO does not delete the reward, it reparameterises it. An implicit reward, β log( π_θ(y|x) / π_ref(y|x) ), lives inside the DPO loss even though the standalone network is gone. So a reference model, π_ref, remains required by both methods too.

Related reading on DiffStudy:

Whatsapp-color Created with Sketch.

By Arun Kumar

Full Stack Developer with a BE in Computer Science, working with React, Next.js, Node.js, MongoDB, and AI/ML tools. Founder of DiffStudy — built to help CS students ace GATE and university exams, and keep developers up to date across AI, cloud, system design, web development, and every field of computer science. Every article is written from real hands-on experience, not just theory.

Leave a Reply

Your email address will not be published. Required fields are marked *


You cannot copy content of this page