AI Guides · 8 min read

What Is RLHF? How Human Feedback Helps Train Language Models

RLHF uses human preferences after supervised fine-tuning: a reward model, then reinforcement learning. DPO is a direct alternative, not a guaranteed upgrade.

Two unglazed ceramic vessels side by side on a dark table, one lit by warmer amber light, with no text or logos

Reinforcement Learning from Human Feedback (RLHF) is a technique that further trains a model so its behavior better matches human preferences or instructions. In the InstructGPT pipeline, teams run supervised fine-tuning on demonstrations, train a reward model on output comparisons, and optimize the policy with reinforcement learning.

What is RLHF and where did it come from?

Reinforcement Learning from Human Feedback (RLHF) uses human preferences as a reward signal to fine-tune models on complex, subjective goals that simple automatic metrics fail to capture. Standard pretraining teaches a language model to predict likely next tokens across internet text, which leaves the model capable of generating untruthful, toxic, or unhelpful replies. RLHF bridges that gap by using human judgments to steer model outputs after pretraining.

The reinforcement-learning foundation predates modern chat products. In 2017, Paul Christiano and coauthors published “Deep reinforcement learning from human preferences” (arXiv:1706.03741, submitted June 2017 and last revised February 2023 on arXiv). Their research explored learning goals from non-expert human preferences between pairs of trajectory segments rather than hand-coded reward functions. They showed that an agent could solve complex reinforcement learning tasks, including Atari games and simulated robot locomotion, “while providing feedback on less than one percent of our agent’s interactions with the environment,” and learn novel behaviors “with about an hour of human time.” That 2017 study was an RL-from-preferences milestone rather than a language-model product launch.

Five years later, OpenAI brought that core idea to large language models in the March 2022 paper “Training language models to follow instructions with human feedback” by Long Ouyang and coauthors, alongside the official post “Aligning language models to follow instructions”. InstructGPT became the widely cited LLM formulation of RLHF, and it was how OpenAI first productized the pipeline on its API in 2022 (historically deployed as the API default at that time, before newer model generations replaced it well ahead of November 2026).

How does the three-stage RLHF pipeline work?

The InstructGPT-style RLHF pipeline combines supervised fine-tuning, reward modeling, and reinforcement learning in three sequential stages. When I walk engineers through post-training for the first time, I find it helps to separate the human data collected at each step from the optimization algorithm applied to the model weights.

Stage 1: Supervised fine-tuning builds the baseline

Supervised fine-tuning (SFT) creates the initial instruction-following policy from human-written demonstrations. On OpenAI’s official InstructGPT page, the team described collecting a dataset of human-written demonstrations on prompts submitted by customers to the API, then using standard supervised learning to fine-tune GPT-3 into a supervised baseline. Instead of guessing what a helpful answer looks like from scratch during reinforcement learning, the model starts from an SFT checkpoint that already imitates the tone, structure, and task completion patterns demonstrated by labelers.

Stage 2: The reward model learns human preferences

A reward model (RM) is a neural network trained on human comparison data to predict which model output a labeler would prefer. In the InstructGPT workflow, OpenAI collected a larger set of API prompts, generated multiple model outputs for each prompt, and asked labelers to rank or compare pairs of outputs. Training an RM on pairwise comparisons turns qualitative human judgment into a scalar score, which is much easier for labelers to provide consistently than writing full ideal responses for every prompt.

Stage 3: Reinforcement learning updates the policy

The reinforcement learning step fine-tunes the supervised policy to maximize scores from the reward model without drifting too far from the starting model. OpenAI’s InstructGPT pipeline used Proximal Policy Optimization (PPO) with the reward model acting as the reward function. Keeping the updated policy anchored close to the SFT starting point prevents the language model from chasing high reward scores through repetitive or incoherent text that exploits flaws in the reward model.

Why does supervised fine-tuning come before RLHF?

Supervised fine-tuning comes before preference ranking and reinforcement learning because demonstrations give the model a workable baseline of desired behavior before any reward optimization begins. Starting reinforcement learning directly from a raw pretrained base model means most sampled completions ignore user intent, giving human labelers and the reward model weak signal to compare.

Ouyang and coauthors highlighted this gap in their 2022 InstructGPT paper, noting that “Making language models bigger does not inherently make them better at following a user’s intent.” Because pretraining optimizes next-token prediction, larger models can still produce untruthful, toxic, or unhelpful outputs. By running SFT first and RLHF second on GPT-3, the authors produced InstructGPT models that showed clear preference gains in their 2022 evaluations. On their prompt distribution, “outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters.” That comparison reflects a specific 2022 study on GPT-3 and InstructGPT prompts rather than a universal scaling rule for later model families. The same paper also reported improvements in truthfulness and lower rates of toxic generation, with minimal performance regressions on public NLP datasets, even though InstructGPT still made simple mistakes.

DPO vs RLHF: how Direct Preference Optimization differs

Direct Preference Optimization (DPO) solves the standard RLHF preference-alignment objective with a simple classification loss, removing the separate reward-model training and reinforcement learning loop. Introduced by Rafael Rafailov and coauthors in the paper “Direct Preference Optimization: Your Language Model is Secretly a Reward Model” (submitted May 2023, revised July 2024 on arXiv), DPO grew out of practical frustration with PPO-based RLHF.

In their paper, Rafailov and coauthors described standard RLHF as “a complex and often unstable procedure, first fitting a reward model that reflects the human preferences, and then fine-tuning the large unsupervised LM using reinforcement learning to maximize this estimated reward without drifting too far from the original model.” DPO sidesteps that complexity through “a new parameterization of the reward model in RLHF that enables extraction of the corresponding optimal policy in closed form, allowing us to solve the standard RLHF problem with only a simple classification loss.” According to the authors, that formulation makes training “stable, performant, and computationally lightweight, eliminating the need for sampling from the LM during fine-tuning or performing significant hyperparameter tuning.”

In the DPO paper’s experiments, fine-tuning with DPO matched or exceeded PPO-based RLHF on sentiment control and matched or improved response quality in summarization and single-turn dialogue while remaining substantially simpler to implement. As of November 2026, those findings support treating DPO as a major alternative formulation to PPO-based RLHF, rather than claiming DPO wins in every training setup or task.

Stage or Method Training Signal Used Separate Reward Model Online RL Sampling Loop Primary Role in Post-Training
Supervised Fine-Tuning (SFT) Human-written demonstrations No No Builds initial instruction-following baseline
PPO-based RLHF (InstructGPT) Ranked output comparisons Yes Yes Optimizes policy against learned preference scores
Direct Preference Optimization (DPO) Ranked output pairs Implicit via policy parameterization No Optimizes RLHF objective via classification loss

How RLHF relates to system prompts, LoRA, distillation, and RAG

RLHF defines a training objective based on human preference data, which separates RLHF from prompting techniques, adapter methods, model compression, and retrieval pipelines. Teams working on LLM applications regularly combine several of these tools, so separating what happens at inference time from what updates model weights keeps architecture decisions clear.

  • System prompts act at inference time. Adding instructions inside a system prompt steers model tone, formatting, and constraints without changing model weights, whereas RLHF permanently alters the policy during post-training.
  • LoRA reduces the cost of weight updates. LoRA fine-tuning updates low-rank adapter matrices instead of every parameter in the base network. Engineers can apply LoRA during SFT or preference optimization, making it an efficiency mechanism rather than a preference-alignment objective by itself.
  • Model distillation transfers behavior across sizes. In model distillation, a smaller student model learns from a larger teacher model’s outputs or distributions, whereas RLHF optimizes a policy against human preference comparisons.
  • RAG supplies external facts at runtime. Choosing RAG vs. fine-tuning decides whether to fetch fresh documents into the context window or modify model parameters through training stages like SFT and RLHF.

Limits and tradeoffs of RLHF

RLHF aligns a model with the preferences of specific labelers and researchers rather than universal human values, and the process introduces measurable tradeoffs. On OpenAI’s official InstructGPT page, the authors stated this scope limit directly: “Our procedure aligns our models’ behavior with the preferences of our labelers, who directly produce the data used to train our models, and us researchers, who provide guidance”. Knowing who wrote the demonstrations and ranked the completions matters whenever evaluating what a fine-tuned model treats as helpful or safe.

Another documented constraint is what OpenAI termed the “alignment tax”: aligning models strictly on customer tasks can hurt performance on some academic NLP benchmarks. To address that tradeoff in InstructGPT, OpenAI mixed a small fraction of the original GPT-3 training data back into the RL fine-tuning loop using normal log-likelihood maximization, reporting that the adjustment “roughly maintains performance on safety and human preferences, while mitigating performance decreases on academic tasks.” Even with careful preference tuning, Ouyang and coauthors observed that InstructGPT still made simple mistakes, reminding builders that preference optimization reduces undesirable behavior without eliminating errors.

FAQ

What does RLHF stand for in machine learning?

RLHF stands for Reinforcement Learning from Human Feedback. In machine learning, RLHF is a training approach where human evaluators compare or rank model outputs, and those preferences guide a reinforcement learning loop. Rather than relying solely on fixed automatic metrics, RLHF uses human judgment to steer model behavior toward helpfulness, truthfulness, and safety.

Is a reward model the same as the language model being trained?

A reward model is a separate network from the language model policy being optimized in standard RLHF. Teams train the reward model on pairs of human-ranked outputs so the network learns to score which response labelers prefer. During the reinforcement learning stage, that reward model acts as the scoring function guiding updates to the language model.

Does DPO replace RLHF for every language model?

Direct Preference Optimization (DPO) offers an alternative way to solve the standard RLHF problem without training a separate reward model or sampling outputs in an RL loop. In Rafailov et al.’s experiments, DPO matched or improved on PPO-based RLHF across sentiment control, summarization, and single-turn dialogue, though it remains a related alternative rather than a guaranteed universal upgrade.

What is the alignment tax in RLHF?

The alignment tax is OpenAI’s term for performance drops on some academic NLP benchmarks when a model is aligned solely on customer task preferences. On the InstructGPT page, OpenAI reported mitigating this effect by mixing a small fraction of original GPT-3 pretraining data into RL fine-tuning using normal log-likelihood maximization, which roughly preserved safety and preference gains.

Can a system prompt replace RLHF?

A system prompt guides a model at inference time through input instructions without changing any model weights. RLHF changes the model’s underlying parameters during post-training so preferred behavior becomes part of the learned policy. Teams often rely on prompting for fast behavioral steering at runtime, while training-time alignment shapes baseline tendencies across prompts.

Sources

Written by

Chunyu Cai

Chunyu Cai is the CEO of Lotook, LLC and an entrepreneur who writes about AI models, agents, and how they change everyday work. Chunyu holds a master's degree from Imperial College London.