How RLHF Works: Reinforcement Learning from Human Feedback
Introduction
Reinforcement Learning from Human Feedback (RLHF) has become the dominant paradigm for aligning large language models with human intent. Instead of asking engineers to handcraft a reward function, RLHF learns what counts as a good response from human preference judgments and then uses that learned signal to steer the model through reinforcement learning. The technique rose to prominence with InstructGPT, where human evaluators preferred a 1.3-billion-parameter model fine-tuned with RLHF over a base model roughly 100x its size — clear evidence that alignment, not raw scale, often determines usefulness. This guide explains how RLHF works, the technical mechanisms behind it, the failure modes practitioners worry about, and where the field is heading next.
Core Concepts
What Problem Does RLHF Solve?
Pretrained language models are excellent next-token predictors but indifferent to user intent. A raw model might answer a question with another question, refuse benign requests, or produce plausible-sounding nonsense. Traditional reinforcement learning needs a numeric reward signal, and writing one that captures “be helpful, harmless, and honest” proves extraordinarily difficult. RLHF sidesteps the problem by learning the reward function from human judgments rather than specifying it by hand.
The core insight is that people are far better at comparing two outputs than at scoring a single one on an abstract scale. When annotators see two candidate responses to the same prompt and pick the one they prefer, that choice implicitly encodes the values we want the model to learn. Aggregating millions of such comparisons yields a training signal rich enough to capture subjective qualities like tone, safety, and helpfulness.
The Three-Stage Pipeline
RLHF is not a single algorithm but a pipeline of three stages, each with its own training objective and data requirements. Understanding this structure matters because most production systems and research papers reference these stages explicitly.
Stage one is Supervised Fine-Tuning (SFT): the pretrained base model is adapted on curated prompt-and-ideal-response pairs. The goal here is purely format and competence — teach the model to follow instructions and produce well-structured answers before any preference learning begins.
Stage two is Reward Model Training: a separate model learns to predict which of two responses a human would prefer. It is typically initialized from the SFT checkpoint and trained as a classifier that outputs a scalar score for any (prompt, response) pair.
Stage three is Policy Optimization: the language model itself is updated with a reinforcement learning algorithm, most commonly PPO (Proximal Policy Optimization). The reward model supplies the RL signal, and the language model — now called the “policy” — learns to maximize expected reward while staying close to the SFT model.
How Does It Work?
- Start with a pretrained base model and run Supervised Fine-Tuning (SFT) on curated prompt-and-ideal-response pairs. This stage establishes baseline instruction-following competence and a consistent output format.
- Collect pairwise preference data by showing human annotators one prompt with several candidate responses. Annotators rank the candidates, and these comparisons become the reward model’s training set.
- Train the reward model on the collected comparisons using a ranking objective, typically the Bradley-Terry likelihood. It learns to assign higher scalar scores to responses humans prefer and lower scores to rejected ones.
- Optimize the language model’s policy with a reinforcement learning algorithm such as PPO. Each generated response receives a reward model score, and the policy updates to produce higher-reward outputs on average.
- Apply a KL divergence penalty during RL optimization so the policy cannot drift too far from the SFT model. This regularization preserves fluency, factual knowledge, and behavioral stability.
- In iterative RLHF setups, sample new responses from the updated policy, gather fresh human preferences, retrain the reward model, and re-optimize. Each round pushes alignment further while the reward model adapts to newly exposed failure modes.
- The final artifact is an assistant that consistently produces responses humans prefer: helpful, safe, and aligned with the values captured in the preference data.
Key Technical Mechanisms
The Bradley-Terry Foundation
Most reward models rest on the Bradley-Terry framework, a probabilistic model that converts pairwise comparisons into a learned scalar utility. Given two responses A and B, the probability that a human prefers A is modeled as the softmax of their reward difference. Training then maximizes the likelihood of the observed preferences — essentially a binary classification loss framed in ranking terms.
The assumption is simple and works well in practice, but it has limits. It treats comparisons as independent and reduces response quality to a single scalar. Annotator disagreement, contextual variation, and multi-dimensional quality judgments can violate both assumptions, which is why research into richer preference models continues.
The KL Divergence Penalty
One of the most consequential design decisions in RLHF is adding a KL penalty to the RL objective. The term measures how far the current policy’s output distribution has moved from the reference SFT model and adds a cost proportional to that distance. Without it, the policy can drift into regions the reward model scores highly but where the base model was never calibrated, producing incoherent or off-distribution text.
The KL penalty also guards against reward hacking. Because the reward model is an imperfect proxy for true human preference, unconstrained optimization can find adversarial outputs that score well on the proxy yet fail the real objective. The penalty confines the policy to the region where the reward model remains reliable, limiting how much exploitation is possible.
Overoptimization and Reward Hacking
A persistent challenge in RLHF is reward model overoptimization, often called reward hacking. As the policy is pushed to maximize reward model scores, it eventually exploits quirks and blind spots in the proxy that do not correspond to genuine quality. The model may adopt stylistic features the reward model associates with high quality — verbose disclaimers, particular punctuation patterns, stock phrasings — without actually becoming more helpful.
Empirically, the gap between reward model score and true human preference widens as training continues. This Goodhart-style failure is the central reason iterative RLHF exists: refreshing the reward model with new human data drawn from the updated policy resets the proxy before exploitation becomes severe.
Common Pitfalls
- Reward overoptimization: the model learns statistical patterns in the reward function rather than genuine quality, producing outputs that score high on the proxy but disappoint real users.
- Annotation noise and bias: inconsistent raters, cultural assumptions, and mismatches between annotator and end-user populations inject noise into preference data and cap alignment quality.
- Proxy-goal mismatch: the reward model inevitably loses information contained in the original human judgments, and the RL policy optimizes the proxy, not the true objective.
- Policy collapse: excessive RL pressure can erode output diversity, collapsing the model onto a narrow band of high-scoring but repetitive responses.
- Early mistakes compounding in iterative setups: errors from early rounds of iterative RLHF can propagate, because later rounds train against preferences generated by an already-distorted policy.
- Bradley-Terry limitations: the single-quality-dimension assumption ignores how multi-faceted a good response is and can distort rankings in heterogeneous comparison sets.
The State of the Art and Emerging Trends
DPO, GRPO, and the Search for Simpler Objectives
One of the most consequential recent shifts is toward methods that bypass the explicit reward model entirely. DPO (Direct Preference Optimization) reformulates the RLHF objective as a supervised learning problem on preference pairs, deriving a closed-form policy update that requires neither a separately trained reward model nor an RL loop. GRPO (Group Relative Policy Optimization) extends this idea by sampling multiple responses per prompt and normalizing advantages within each group instead of relying on a learned value function.
These approaches cut computational cost and implementation complexity dramatically, and they have largely displaced PPO-based RLHF in many open-source fine-tuning pipelines. The trade-off: they rest on different assumptions about preference structure and can be harder to iterate on when preferences evolve over time.
Verifiable Rewards and Reasoning Models
For domains with objective correctness signals — math, code, formal logic — RLVR (Reinforcement Learning with Verifiable Rewards) has emerged as a powerful alternative. Rather than training a reward model on human preferences, the system uses programmatic checkers: unit tests for code, symbolic math verifiers, formal proof checkers. The reward is binary but cheap and reliable.
This paradigm has driven much of the recent progress in reasoning-focused models because it enables RL optimization without the noise and cost of human annotation. It does not replace RLHF for subjective qualities like tone or safety, but it complements it powerfully wherever ground truth exists.
Generative Reward Modeling
A frontier direction is generative reward modeling, where the “reward model” is itself a large generative model that produces natural-language critiques and verdicts instead of scalar scores. Emerging pairwise-RL frameworks use such generative judges to produce richer preference signals, often improving calibration and narrowing the gap between proxy scores and true quality. The advantage: a generative judge can articulate why one response is better, not just that it is, opening the door to more interpretable and steerable alignment.
Cheaper Evaluation with Preference Proxies
Evaluating reward models and RLHF pipelines is expensive: a full pipeline requires running RL training, which can cost millions of dollars at frontier scale. New benchmarks such as PPE (Preference Proxy Evaluations) aim to predict reward model quality through cheaper proxy tasks — static comparisons, discriminative evaluations, held-out preference prediction — without running a complete RL cycle. The trend reflects a maturing field in which evaluation itself is becoming the bottleneck.
RLHF Beyond the Frontier
For years, RLHF was discussed almost exclusively in the context of the largest models, where deployment scale justified the procedure’s cost. That assumption is breaking down. Open-source communities have demonstrated effective RLHF on models in the 7B to 70B range, and DPO-style methods have made preference tuning accessible to anyone with a single GPU. The technique is no longer a privilege of well-resourced labs.
Conclusion
Reinforcement Learning from Human Feedback turned alignment from a theoretical concern into a practical engineering discipline. By translating human preferences into a learned reward signal and optimizing a language model against it, RLHF produced the first generation of instruction-following assistants users genuinely preferred. Its core ideas — pairwise preference learning, reward modeling, KL-regularized policy optimization, and iterative refinement — remain foundational even as the field experiments with simpler objectives like DPO and complementary approaches like RLVR.
The challenges are real: reward hacking, annotation noise, policy collapse, and the persistent gap between proxy and true objective. But the trajectory is clear. Each generation of methods closes some gaps while opening new questions about aligning increasingly capable systems. For practitioners building AI products today, understanding RLHF is not optional — it is the operating system on which most aligned language model behavior runs.
Sources
- Reward Model Overoptimisation in Iterated RLHF (arXiv)
- A Unified Pairwise Framework for RLHF: Bridging Generative Reward Modeling and Policy Optimization (arXiv)
- How to Evaluate Reward Models for RLHF (arXiv)
- Reinforcement learning from human feedback – Wikipedia
- RLHF: Reinforcement Learning from Human Feedback
- Illustrating Reinforcement Learning from Human Feedback (RLHF)
This article was created with AI-assisted tools. The content is produced through original synthesis and contains no direct quotations. The featured image was generated with AI. For technical accuracy, please refer to primary sources.












