RLHF in one paragraph
Reinforcement learning from human feedback (RLHF) is a training technique in which human judgments about model outputs are used to steer a model's behavior. Instead of telling the model the single "correct" answer, humans compare or rate several candidate answers. Those preferences are turned into a learning signal — usually by training a reward model — and the language model is then optimized to produce outputs that score well under that signal, while staying close to its original behavior.
RLHF became widely known through its use in instruction-following and chat models, but the underlying idea — learning from human preferences rather than hand-written objectives — predates large language models and has been applied in robotics, games and summarization research.
Why models need human feedback
A pre-trained language model learns to predict the next token on large text corpora. That makes it fluent and knowledgeable, but not necessarily useful. Next-token prediction doesn't distinguish between a helpful answer and an unhelpful one that is statistically plausible, between a correct claim and a confident fabrication, or between a safe response and a harmful one.
Many of the qualities we want from AI systems are hard to specify with a formula:
- Is this explanation clear for the person who asked?
- Did the model follow every constraint in the instruction?
- Is the reasoning sound, or did it get lucky?
- Is the tone appropriate, and is the uncertainty honest?
Humans can judge these qualities — especially when comparing two answers side by side — even when they couldn't write a perfect rule for them. RLHF turns that judgment into a scalable training signal.
Models don't improve through more data alone. They improve through better feedback, better judgment and better evaluation.
The RLHF pipeline
The classic RLHF recipe has three stages. Modern variants often change or merge steps, but the logic is the same.
Supervised fine-tuning
Train on high-quality human-written demonstrations so the model learns the target format and behavior.
Reward modeling
Collect human preferences between model outputs and train a model that predicts which response humans prefer.
Policy optimization
Optimize the model against the reward signal, with a penalty for drifting too far from the SFT model.
1. Supervised fine-tuning (SFT)
Human experts write ideal responses to a diverse set of prompts. The pre-trained model is fine-tuned on these demonstrations. SFT data is expensive per example because writing a great answer takes far longer than judging one — which is one reason preference data scales better. Learn more about SFT and instruction-following datasets.
2. Preference collection
The SFT model generates several responses to each prompt. Human evaluators compare them — most often pairwise ("which is better, A or B?"), sometimes as rankings of more than two responses, often supplemented by rubric scores (accuracy, helpfulness, safety) and a short written rationale. This is human preference data.
3. Optimization
The preferences are used to improve the model, either indirectly via a reward model and reinforcement learning, or directly with methods such as DPO. We cover both below.
Reward modeling
A reward model takes a prompt and a response and outputs a scalar score. It is usually initialized from a language model and trained on pairwise preferences using a Bradley–Terry style objective: the probability that response A is preferred over B is modeled as the logistic function of the difference between their scores. Training maximizes the likelihood of the observed human choices.
Two consequences matter for anyone producing data:
- The reward model learns whatever the labels encode. If evaluators systematically prefer longer answers, confident tone or a particular format, the reward model will reward those features — whether or not they reflect quality.
- Noise caps performance. Where evaluators disagree randomly, there is little signal to learn. Measuring agreement and resolving genuine disagreements is therefore part of model quality, not just data hygiene.
PPO, DPO and friends
PPO (Proximal Policy Optimization) is the reinforcement learning algorithm used in the classic RLHF recipe. The language model (the "policy") generates responses, the reward model scores them, and PPO updates the policy to increase expected reward. A KL-divergence penalty against the SFT model keeps the policy from drifting into degenerate text that happens to exploit the reward model.
DPO (Direct Preference Optimization) skips the explicit reward model and RL loop. It reformulates the objective so the policy can be trained directly on preference pairs with a simple classification-style loss. DPO is easier to implement and more stable to train, which has made it popular; it still depends entirely on the quality of the preference pairs.
Many other variants exist — methods that use AI-generated feedback (see RLHF vs RLAIF), methods that learn from single good/bad labels instead of pairs, and online approaches that collect fresh preferences on the current model's outputs. Whatever the algorithm, the common denominator is the same: the preference data defines what "better" means.
What makes good RLHF data
From our experience running human feedback programs, high-quality RLHF data has six properties:
- Representative prompts. Prompts reflect the real distribution of tasks — including hard, ambiguous and adversarial ones — not just easy examples.
- Qualified evaluators. Judging a proof, a code diff or a clinical answer requires domain expertise. Generalists tend to reward fluency over correctness. See expert data annotation.
- Clear, calibrated guidelines. Written criteria with worked examples, plus calibration rounds until evaluators apply them consistently.
- Multiple judgments and measured agreement. Several reviewers per item, with inter-annotator agreement tracked (e.g. Cohen's or Fleiss' kappa, Krippendorff's alpha).
- Adjudication. Real disagreements are escalated to senior reviewers rather than averaged away.
- Rich metadata. Rubric scores, rationales, evaluator expertise and confidence make the data reusable for reward modeling, analysis and evaluation.
Salyvian's Human Feedback Framework builds these properties into every project — with acceptance thresholds agreed before production.
Common pitfalls
- Reward hacking. The policy learns to exploit quirks of the reward model — verbosity, flattery, hedging — rather than improving. Mitigations include KL penalties, diverse data and ongoing human evaluation of the optimized model.
- Length and style bias. Evaluators may prefer longer or more confident answers. Guidelines and calibration must explicitly address this.
- Sycophancy. If evaluators reward agreement with the user, models learn to tell people what they want to hear.
- Distribution shift. Preferences collected on an old model's outputs may not reflect the current model's failure modes. Iterative collection helps.
- Optimizing for volume. Large volumes of low-agreement data can be worse than a smaller, carefully adjudicated set.
Choosing the right partner matters as much as choosing the algorithm. Our guide on how to choose an AI training data provider covers what to look for.
Frequently asked questions
What does RLHF stand for?
Reinforcement learning from human feedback — a technique that uses human judgments about model outputs to train and align AI models.
Is DPO a form of RLHF?
DPO learns from the same human preference data as RLHF but optimizes the model directly, without a separate reward model or reinforcement learning loop. It is commonly grouped with RLHF under "preference optimization".
How much preference data does RLHF need?
It depends on the model, domain and goal. Focused projects can begin with a few thousand high-quality comparisons; large alignment efforts collect far more. Quality and coverage usually matter more than raw count.
Can AI feedback replace human feedback?
Partially. AI feedback (RLAIF) can scale cheap judgments, but human experts remain essential for defining standards, validating AI judges and handling specialized or high-stakes domains.