---
topic: ai-technology
author: Crashtech Editorial
published: Jul 14, 2026 · read: 3 min
---

How LLMs Learn to Be Helpful: RLHF with Reward Models vs Direct Preference Optimization

Dissect post-training alignment: compare classic PPO reinforcement learning against Direct Preference Optimization (DPO) and verifiable reward methods.

– –

When a Large Language Model finishes pretraining, it is not a helpful assistant. It is a raw autocomplete engine that was trained on trillions of internet tokens to predict the next token. If you prompt it with “How do I bake sourdough bread?”, it might respond with another question, continue with a fictional dialogue, or generate an unrelated recipe.

Transforming a raw base model into a helpful, honest, and harmless assistant requires Post-Training Alignment.

Historically, alignment relied on Reinforcement Learning from Human Feedback (RLHF) using Proximal Policy Optimization (PPO). However, training separate reward models and managing fragile reinforcement learning loops is notoriously unstable. Today, alignment engineering has evolved into direct mathematical alternatives, principally Direct Preference Optimization (DPO) and Verifiable Reward Reinforcement Learning.

The Evolution: From PPO to DPO

+-----------------------------------------------------------------------+
|  Classic RLHF Pipeline (PPO): Multi-Stage & Compute Heavy            |
|  1. Collect Human Pairwise Comparisons (Win vs Lose)                  |
|  2. Train a separate Reward Model (RM) to predict human preferences   |
|  3. Run PPO Reinforcement Learning on Policy LLM with KL-penalty      |
|  * Bottleneck: Managing 4 models simultaneously in GPU VRAM           |
+-----------------------------------------------------------------------+
|  Direct Preference Optimization (DPO): Single-Stage Closed Form       |
|  1. Mathematically reparameterizes reward function in terms of policy |
|  2. Trains policy directly on (Prompt, Winner, Loser) triples via BCE |
|  * Breakthrough: Zero separate reward model, zero unstable RL loops   |
+-----------------------------------------------------------------------+
+-----------------------------------------------------------------------+
|                    RLHF vs DPO Architecture Pipeline                  |
+-----------------------------------------------------------------------+
|                                                                       |
|  [ Pairwise Dataset: Prompt x, Winner y_w, Loser y_l ]                |
|        |                                                              |
|        +---- (Path A: Classic RLHF / PPO) --------------------------+ |
|        |                                                            | |
|        v                                                            v |
|  [ Train Reward Model r(x, y) ]                               [ DPO ] |
|        | (Scalar reward score)                                      | |
|        v                                                            | |
|  [ Complex PPO Loop: 4 Models in VRAM ]                             | |
|  - Actor (Trained Policy)                                           | |
|  - Critic (Value Network)                                           | |
|  - Reference Model (Frozen Baseline for KL)                         | |
|  - Reward Model (Scoring Network)                                   | |
|        |                                                            | |
|        v                                                            v |
|  [ Aligned Helpful Model ] <----------------------------------------+ |
+-----------------------------------------------------------------------+

The Mathematical Breakthrough of DPO

Why was classic RLHF so difficult to scale?

In standard PPO, four distinct large models must reside concurrently in GPU cluster memory: the active policy, the value network, the reference model, and the reward model. If the policy strays too far from the reference model, it suffers from “reward hacking”: generating bizarre, repetitive text that tricks the reward model into giving high scores while outputting gibberish to humans.

In 2023, Stanford researchers derived Direct Preference Optimization (DPO).

They proved mathematically that the optimal policy under the standard RL objective can be expressed analytically:

r(x, y) = beta * log( pi_theta(y|x) / pi_ref(y|x) )

By substituting this identity directly into the pairwise Bradley-Terry preference loss, the need for a separate reward model evaporates completely.

The DPO loss function optimizes the policy directly:

  • It increases the relative log-likelihood of the preferred response y_w.
  • It decreases the relative log-likelihood of the rejected response y_l.
  • The reference model pi_ref acts as an automatic dynamic regularizer, preventing the policy from degenerating.

RLHF vs DPO: Production Trade-Offs

+---------------------------+-----------------------+------------------------+
| Dimension                 | Classic RLHF (PPO)    | Direct Preference (DPO)|
+---------------------------+-----------------------+------------------------+
| GPU Memory Footprint      | Massive (4 models)    | Standard (2 models)    |
| Training Stability        | Brittle (Hyperparam)  | High (Supervised Loss) |
| Wall-Clock Train Time     | Slow (RL rollouts)    | Fast (Direct Backprop) |
| Out-of-Distribution Skill | Higher Exploration    | Bounded by dataset     |
+---------------------------+-----------------------+------------------------+

While DPO has become the universal default for fine-tuning open-weight models (such as Llama and Mistral chat models), frontier labs still deploy advanced RL for complex reasoning.

The Next Frontier: Verifiable Rewards (RLVR)

For creative writing and conversational empathy, human preference is subjective: DPO on human comparisons works brilliantly.

However, for mathematics, programming, and formal logic, human comparison is flawed: humans often prefer a convincingly written wrong answer over a terse correct answer.

Frontier models (like OpenAI o1 and DeepSeek-R1) leverage Reinforcement Learning with Verifiable Rewards (RLVR):

  • Instead of training a reward model on human vibes, the environment executes the code against unit tests, or evaluates the math proof against a symbolic solver.
  • If the unit tests pass, the model receives a deterministic reward of +1. If they fail, 0.
  • The model autonomously discovers multi-step chains of thought, error-checking, and self-correction through pure trial and error.

Key Engineering Takeaways

  • DPO replaced PPO for general alignment: Eliminating the separate reward model makes fine-tuning conversational chat models stable, fast, and accessible on standard hardware.
  • Beware of reward hacking in classic RL: If using reward models, always enforce strict KL-divergence penalties to prevent the model from gaming the score.
  • Use verifiable rewards for code and math: Don’t ask humans to judge code syntax. Grade code using compilers and unit tests to drive true reasoning capability.
Advertisement

/* Comments */