← Blog

/

Essential ML Guide

Essential ML Guide

Complete Guide to RLHF for LLMs

What is RLHF? Reinforcement learning from human feedback explained

What is RLHF? Reinforcement learning from human feedback explained

Toloka Arena is live. See how your model ranks.

Collect RLHF preference data

Collect RLHF preference data

Launch pairwise comparisons, rankings, and rubric reviews with domain experts across 90+ fields, AI-assisted setup, and built-in quality control. No minimums.

Updated November 2026 | Originally published February 2026

RLHF stands for reinforcement learning from human feedback. It is a post-training technique that teaches a language model to produce the responses people prefer: people compare model outputs, a reward model learns from those comparisons, and reinforcement learning tunes the model to score well on that reward. It is the step that turned GPT-3, a capable but erratic text predictor, into the assistant behavior people now expect from ChatGPT, Claude, and Gemini.

Key takeaways

• RLHF means reinforcement learning from human feedback: human preference judgments, turned into a reward signal, used to shape how a model behaves.

• It works in three stages: collect preference comparisons, train a reward model, then optimize the model with reinforcement learning (usually PPO) while keeping it close to the original.

• In 2026 it is one layer among several. Labs combine preference tuning (RLHF or DPO) with verifiable rewards for math, code, and agents, plus rubric rewards for open-ended domains.

• Its failures are well documented: sycophancy, length bias, and reward hacking. OpenAI rolled back a GPT-4o update in April 2025 after an added user-feedback reward made it sycophantic.

• Preference data quality matters more than the algorithm. Clear criteria, expert annotators, and continuous agreement checks decide whether RLHF helps.

What is reinforcement learning from human feedback?

Reinforcement learning from human feedback is applied after a model has been pre-trained on large text corpora and, usually, after supervised fine-tuning on example answers. It does not add knowledge. It changes how the model uses the knowledge it already has: which answer it gives, how it phrases it, when it refuses, and how sure it sounds.

The reinforcement learning part is literal. The model is treated as a policy that picks tokens, and training shifts the probability of whole responses toward those that earn a higher reward. What makes RLHF different from classical reinforcement learning is where the reward comes from. Nobody writes a reward function by hand. A reward model learns it from human judgments.

Diagram comparing standard reinforcement learning, where rewards come from the environment, with RLHF, where a reward model learns from human labels

Standard reinforcement learning (left) gets its reward from the environment. In RLHF (right), a reward model learns from human labels. Source: Kaufmann et al., A survey of reinforcement learning from human feedback (2023)

What RLHF means in practice

RLHF optimizes for acceptability as judged by people, not for objective truth. The model learns which responses humans tend to prefer when shown alternatives, including the biases and inconsistencies of those humans. That is why RLHF is excellent at tone, helpfulness, and refusal behavior, and why it cannot by itself guarantee that answers are correct.

Why RLHF matters

Most real requests have no single correct answer. Automated metrics such as BLEU or perplexity do not measure whether a response is helpful, appropriately cautious, or misleading. Human comparisons do. RLHF turns them into something a model can optimize, usually toward the goals Anthropic described as helpful, honest, and harmless (HHH).

The evidence that made RLHF standard came from OpenAI’s InstructGPT in 2022. Labelers preferred outputs from the 1.3-billion-parameter InstructGPT model over the 175-billion-parameter GPT-3, despite the 100x size difference. At equal size, InstructGPT outputs were preferred 85% of the time, and the model gave truthful, informative answers on TruthfulQA about twice as often as GPT-3.

Line chart of human ratings by model size, with InstructGPT trained with RLHF scoring above supervised fine-tuning and GPT-3 at 1.3B, 6B and 175B parameters

Human quality ratings by model size. The RLHF-trained InstructGPT scores highest at every size. Source: OpenAI, Aligning language models to follow instructions (2022)

A short history of RLHF

Year

Milestone

Why it mattered

2017

Christiano et al., Deep RL from human preferences

Agents learned Atari games and robot locomotion from feedback on less than 1% of their interactions, using about an hour of human time

2020

Stiennon et al., Learning to summarize from human feedback

First large-scale RLHF on language: summaries beat human references and larger supervised models

2022

InstructGPT, then ChatGPT

RLHF made instruction following reliable at product scale

2022

Anthropic HH and Constitutional AI

Helpful-harmless training at scale; AI feedback guided by written principles (RLAIF)

2023

Direct preference optimization (DPO)

Preference tuning without a separate reward model or RL loop

2024–2025

Reinforcement learning with verifiable rewards and reasoning models

Rewards from automatic checks for math and code; human preference stays for everything else

2025–2026

Rubric rewards and hybrid pipelines

Open-ended domains scored against expert-written criteria

How does RLHF work?

RLHF works by indirection. Human judgment never touches the model directly. It is captured first by a reward model, which then scores millions of responses during training. This is what lets a few tens of thousands of human comparisons shape a model’s behavior, and it is also the source of most RLHF failures, because the model learns to please the reward model rather than the people behind it.

Three-step InstructGPT RLHF pipeline: supervised fine-tuning on demonstrations, reward model training on ranked outputs, and PPO policy optimization against the reward model

The three steps of RLHF as used for InstructGPT: demonstrations, comparisons, and policy optimization. Source: Ouyang et al., OpenAI (2022)

Stage 1: Collect preference data

Annotators see a prompt and two or more model responses and record which is better. Three formats are common:

  • Pairwise comparisons: choose the better of two responses. The most common format, because it forces explicit trade-offs and reduces differences in how people use rating scales. Llama 3 annotators also rated how much better, on four levels from “significantly” to “marginally”.

  • Rankings and ratings: order several responses (InstructGPT used 4 to 9 per prompt) or score each one. Ratings are faster to collect but noisier across annotators.

  • Behavioral flags: mark specific problems such as hallucinations, bias, or unsafe content, often used to train separate safety reward models.

For scale: InstructGPT used about 40 contractors and 33,000 prompts for reward model training, and its labelers agreed with each other about 73% of the time. That agreement rate is typical, and it is a reminder that preference data is a measurement of human judgment, not ground truth.

Stage 2: Train the reward model

The reward model takes a prompt and a response and returns a single score. It is usually a copy of the language model with its output layer replaced by a scalar head, trained so that preferred responses score higher than rejected ones (the Bradley-Terry formulation). Reward models are imperfect proxies, and they generalize worst on exactly the prompts that matter: on RewardBench 2 (2025), leading reward models scored about 20 points lower than on the original benchmark, below 40% on precise instruction following.

Stage 3: Optimize the policy with PPO

The language model generates responses, the reward model scores them, and proximal policy optimization (PPO) updates the model toward higher scores. A KL divergence penalty keeps the model close to its starting point, because without it the model drifts toward outputs that exploit the reward model rather than satisfy people. This stage is the most expensive and the most sensitive to tuning.

RLHF policy optimization: the tuned model's output is scored by the reward model, a KL penalty compares it with the frozen initial model, and PPO updates the policy

PPO update with a KL penalty against the frozen initial model. Source: Lambert et al., Illustrating RLHF, Hugging Face (2022)

RLHF in 2026: How it fits with DPO, RLAIF and RLVR

RLHF is no longer one stage in a fixed recipe. It is a family of preference-based methods used alongside other reward sources. The question for a team is which reward fits which behavior.

Diagram of LLM post-training in 2026: pre-training, supervised fine-tuning, preference optimization with RLHF or DPO, RL with verifiable and rubric rewards, and final preference and safety RL, with the data source for each stage

Where human feedback sits in a typical 2026 post-training pipeline. Simplified: not every lab uses every stage. Source: Toloka, based on published recipes from InstructGPT, Llama 3, Tülu 3, DeepSeek-R1 and Qwen3.

Method

Where the reward comes from

Best for

Main weakness

RLHF (PPO)

Reward model trained on human comparisons

Helpfulness, tone, safety, open-ended quality

Expensive, unstable, reward model can be exploited

DPO

Preference pairs used directly, no reward model

Simple, stable preference tuning

Offline; slightly weaker on reasoning tasks

RLAIF

AI judge, often guided by written principles (Constitutional AI)

Scaling feedback cheaply

Inherits the judge’s blind spots

RLVR

Automatic checks: answer match, unit tests, environment state

Math, code, agent tasks

Only where correctness is checkable; verifiers can be gamed

Rubric rewards

Expert-written criteria scored per item

Medicine, law, science, long-form answers

Only as good as the rubric authors

What major labs actually do

The pattern is consistent: verifiable rewards took over the parts of training that can be checked automatically, and human preference covers the parts that cannot. A deeper look at that shift is in how post-training teaches LLMs to reason.

RLHF vs DPO: what the evidence says

A 2024 study, Unpacking DPO and PPO, ranked what matters most: preference data quality first, then the algorithm, then the reward model. Better preference data gave up to 8% gains, while PPO beat DPO by up to 2.5% on math and 1.2% in general. Xu et al. (2024) reached a similar conclusion: well-tuned PPO outperformed DPO, including on code competitions. DPO is the practical default for smaller teams; PPO-based RLHF pays off when the reward model is strong and the team can afford the tuning.

Need human preference data for post-training?

Toloka delivers expert preference comparisons, rankings, rubric evaluations, and red teaming for frontier and enterprise models, with multi-layer quality control.

Explore post-training data →

Where RLHF fails

RLHF shapes behavior; it does not guarantee correctness, honesty, or reasoning. Its failures follow from the reward model being a proxy for people, and most have a known mitigation.

Failure

Evidence

Mitigation

Sycophancy

OpenAI rolled back a GPT-4o update in April 2025 after a reward from user thumbs-up data “weakened the influence of our primary reward signal”. Anthropic research found humans and preference models sometimes prefer convincing sycophantic answers to correct ones.

Track sycophancy explicitly in evals; weight correctness in annotation criteria; be careful with raw user-feedback rewards

Length bias

Singhal et al. showed a reward based only on response length reproduced most RLHF gains

Length-balance preference pairs; tell annotators not to reward verbosity

Reward overoptimization

Gao et al. showed that optimizing too hard against a proxy reward lowers true quality

KL penalty, early stopping, refreshed reward models

Distribution shift

Reward models are least accurate on new domains and rare prompts (RewardBench 2)

Collect preferences on the prompts your users actually send

Value disagreement

Preferences vary across cultures and contexts; ~73% agreement is typical

Diverse annotator pools; explicit, written criteria

Alignment tax

InstructGPT lost ground on some public benchmarks after RLHF

Mix in pre-training data during PPO (PPO-ptx)

RLHF also cannot see what it cannot read. Hidden reasoning problems or deceptive behavior may not show up in individual responses, which is why preference training is paired with red teaming and independent AI evaluation.

How to collect high-quality RLHF preference data

Every comparison above depends on the people producing it. These practices separate preference data that improves a model from data that teaches it noise:

  1. Write criteria before collecting. Define what “better” means for your use case: accuracy, completeness, safety, tone. When Toloka annotators built a preference dataset for the ELOQUENT lab at CLEF 2025, they judged relevance, naturalness, truthfulness, safety, and overall quality separately, so trade-offs stayed visible.

  2. Allow honest answers. Options such as “both good”, “both bad”, and “I don’t know” reduce forced, random choices.

  3. Ask for a short justification. One sentence explaining the choice makes reviews and disagreement analysis possible.

  4. Make responses meaningfully different. Pairs that differ only in wording waste annotation time and teach the reward model little.

  5. Cover edge cases. A reward model trained on easy prompts generalizes poorly. Include refusals, ambiguous requests, and the long tail of your domain.

  6. Use domain experts where it matters. For code, medicine, law, or finance, general annotators reward answers that sound right. Domain experts catch answers that are wrong.

  7. Budget time realistically. A careful multi-criteria comparison of long responses took 10 to 15 minutes in the ELOQUENT project, which also capped annotators at 30 tasks a day to limit fatigue and individual bias.

  8. Treat disagreement as signal. Track agreement continuously. Low agreement usually means unclear guidelines, not careless annotators.

  9. Combine human and AI review. LLM-based quality checks can triage routine items and flag anomalies, while people handle ambiguous and high-stakes cases.

Volume matters less than quality. NVIDIA’s HelpSteer2 showed that 10,000 well-annotated response pairs, an order of magnitude fewer than earlier datasets, could train a top-ranked reward model. For open-ended domains, rubric-based evaluation extends the same discipline to criteria experts can check. Open-source libraries such as Hugging Face TRL handle reward modeling, PPO, and DPO; the data is the part tooling cannot supply.

When does a model need RLHF?

Your goal

Use

Why

Better tone, helpfulness, refusals, safety in a chat product

RLHF or DPO with human preferences

Subjective qualities with no checkable answer

Correct math, passing code, completed agent tasks

RLVR, plus preference tuning for style

Correctness can be verified automatically

Narrow, deterministic tasks (extraction, classification)

Supervised fine-tuning

Preference optimization adds cost without benefit

Feedback at very large scale

RLAIF anchored by human samples

AI feedback performs comparably but needs human calibration

Expert domains with long-form answers

Rubric rewards written by experts

Turns judgment into checkable criteria

How to choose an RLHF data provider

If you are outsourcing preference data, these questions reveal whether a provider can deliver signal rather than noise:

  • Who are the annotators? Ask for domain coverage, how experts are verified, and how many work on your project.

  • How is quality measured? Look for inter-annotator agreement reporting, control tasks, and review of disagreements, not just a final accuracy figure.

  • Can you shape the criteria? You should own the definition of “better” and see justifications.

  • Which formats are supported? Pairwise comparisons with preference strength, rankings, rubric scoring, safety flags, and edited responses.

  • How fast is a pilot? A small paid batch shows agreement levels and turnaround before you commit.

  • How is data secured and licensed? Confirm data handling, confidentiality, and ownership of the outputs.

Toloka provides RLHF data in two ways. Toloka Platform is self-serve: teams launch comparison, ranking, and rubric tasks with AI-assisted setup, LLM-based quality assurance, and access to domain experts across 90+ fields, paying as they go. For frontier and enterprise models, Toloka’s managed post-training data service covers preference data, SFT demonstrations, rubric evaluation, and red teaming and safety with a dedicated team. Ready-made datasets are also available on request: request off-the-shelf datasets.

Talk to Toloka about your post-training data

Tell us what your model needs to learn. We will scope preference data, rubrics, and evaluation around it.

Talk to an expert →

Frequently asked questions

What does RLHF stand for?

RLHF stands for reinforcement learning from human feedback. In AI, it means training a model with a reward signal learned from human judgments: people compare model responses, a reward model learns their preferences, and reinforcement learning tunes the model to produce responses that score well.

Is RLHF still used in 2026?

Yes. The major published post-training recipes, including Llama 3, Tülu 3, DeepSeek-R1, and Qwen3, all include preference tuning through PPO-based RLHF, DPO, or a preference reward model. What changed is its scope: verifiable rewards now handle math, code, and agent tasks, while human preference data shapes helpfulness, tone, and safety, which automatic checks cannot measure.

Does DeepSeek use RLHF?

Yes, in a modified form. DeepSeek-R1 trained reasoning with rule-based rewards, then added a final stage with reward models for helpfulness and safety. Its helpfulness preferences were generated by another model, closer to RLAIF, and the safety reward model was trained on 106,000 prompts labeled against written guidelines.

What is the difference between RLHF and DPO?

RLHF trains a separate reward model on human comparisons and then optimizes the language model against it with reinforcement learning, usually PPO. DPO skips the reward model and the RL loop, updating the model directly from preference pairs. DPO is simpler and more stable; well-tuned PPO can perform slightly better, especially on reasoning tasks.

What is the difference between RLHF and RLAIF?

The source of the feedback. RLHF uses human judgments; RLAIF uses an AI model’s judgments, often guided by written principles as in Constitutional AI. Google researchers found RLAIF performs comparably to RLHF on summarization and dialogue, but AI judges share each other’s blind spots, so production pipelines keep humans in the loop.

How much preference data does RLHF need?

There is no fixed number. InstructGPT used about 33,000 prompts for reward model training, Anthropic’s public HH-RLHF dataset has about 169,000 comparisons, and NVIDIA’s HelpSteer2 trained a top reward model from 10,000 carefully annotated pairs. Quality and coverage of your actual use cases matter more than raw volume.


Conclusion

RLHF changed what language models are optimized for: not the most likely next word, but the response people prefer. In 2026 it shares the work with verifiable rewards and rubrics, yet the published pipelines still rely on human preference for the qualities no automatic check can measure. Teams that get the most from it treat preference data as the product: clear criteria, the right annotators, continuous quality checks, and a reward signal they keep testing against real users.

Related reading

• RLHF for honest AI

• Improving text-to-image models by prompt engineering with RLHF

• The data behind DeepSeek’s success

• Evaluating LLMs



Subscribe to our newsletter

Product updates, case studies and the latest news from our team, straight to your inbox