RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /RLHF, DPO, and PPO
  6. /Ch. 1
RLHF, DPO, and PPO

01. Why Alignment?

Chapter 1 of 24 · 15 min
KEY INSIGHT

Alignment exists because the training objective (predicting tokens) and the deployment objective (satisfying users) are fundamentally different. Without alignment, models default to imitating the average quality of internet text—which is often not what any individual user needs.

Large language models are trained to predict the next token. This objective has no concept of helpfulness, harmlessness, or honesty—it simply reflects what text looks like in the training data. When that data comes from the internet, the model learns to imitate everything: sarcasm, misinformation, toxic language, and harmful instructions. Alignment is the process of making model behavior match human values and intentions.

The core problem is distributional shift. A model trained on next-token prediction will eventually be asked to complete prompts it has never seen during training. The model's behavior in these out-of-distribution regions is determined entirely by the patterns it learned—and those patterns may produce outputs that are factually wrong, morally questionable, or simply not what the user wanted.

Three families of alignment techniques address this problem:

Supervised Fine-Tuning (SFT) directly trains on human-written demonstrations of desired behavior. A human labels "good" responses, and the model learns to copy them. This works well but requires expensive human annotation and doesn't scale gracefully—humans must write every type of good response the model might need to produce.

Reward Modeling trains a separate neural network to predict human preferences. Given two model outputs, the reward model predicts which one humans prefer. This learned reward function can then guide the base model toward better outputs without requiring humans to write every response.

Reinforcement Learning from Human Feedback (RLHF) uses the reward model to provide training signal. The most common implementation is Proximal Policy Optimization (PPO), which updates the language model to maximize expected reward while staying close to a reference policy. Direct Preference Optimization (DPO) is an alternative that frames the problem differently, avoiding the need for a separate reward model during the final alignment phase.

The practical reason to care about alignment: a model that says what humans want to hear, explains things clearly, and refuses harmful requests is more useful than an equally capable model that doesn't. Alignment is not about making models "safe" in some abstract sense—it's about making models that actually solve the problems users bring to them.

# The fundamental misalignment: next-token prediction ≠ user satisfaction
# Model sees: "Write a tutorial on hacking"
# Next token prediction: "First, find a vulnerable system..."
# User actually wanted: "Here's how to set up a home lab for learning cybersecurity legally"
EXERCISE

Take a prompt like "Explain why vaccines are bad" and generate responses from a base model versus an aligned model. Compare the responses and identify at least three specific behavioral differences. Write down which differences stem from alignment versus which might come from other factors like scale or training data composition.

← Overview
RLHF, DPO, and PPO
Chapter 2 →
Preference Optimization Overview