core-ai
Glossary ↗Reinforcement Learning from Human Feedback (RLHF)
Reinforcement Learning from Human Feedback (RLHF) is a post-training technique used to align a raw, pre-trained LLM's behavior with human preferences — turning a model that's very good at predicting plausible next tokens into one that's actually helpful, follows instructions, avoids harmful content, and produces responses people prefer. The problem RLHF solves: a foundation model trained purely to predict internet text will happily continue a harmful request, ramble unhelpfully, or mimic the (often low-quality) style of random web text, because "predict the next token" and "be a genuinely helpful assistant" are different objectives. RLHF bridges that gap in roughly three stages. First, human labelers rank multiple model-generated responses to the same prompt from best to worst (e.g., given a question, ranking 4 different candidate answers). Second, that ranking data trains a separate "reward model" that learns to predict which responses humans would prefer. Third, the original LLM is further trained using reinforcement learning (commonly PPO — Proximal Policy Optimization, or newer methods like DPO — Direct Preference Optimization) to maximize the reward model's score, effectively steering the model's outputs toward what humans rated highly. This matters for SaaS builders mostly as context for why commercial LLMs (Claude, GPT, Gemini) behave so differently from raw base models — RLHF (and related techniques like Constitutional AI, which Anthropic uses to reduce reliance on human labelers for harmful-content judgments) is why these models default to helpful, safe, instruction-following behavior instead of raw text completion. A concrete illustration: an un-aligned base model given the prompt "How do I pick a lock?" might respond with either an unhelpful non-answer or an overly detailed how-to with no safety framing, because it's just continuing plausible internet text; an RLHF-aligned model is trained to recognize this as a request that deserves a measured, context-aware response — explaining legitimate use cases (locksmiths, being locked out) while declining to provide a detailed criminal how-to. Builders fine-tuning their own models on top of an already-RLHF'd base (like fine-tuning GPT-4o-mini) are building on top of this alignment layer, not starting from scratch. A known trade-off of RLHF that builders should be aware of when troubleshooting model behavior: alignment training can sometimes make a model overly cautious or evasive on borderline requests (declining reasonable requests that merely resemble sensitive topics), a failure mode nicknamed "over-refusal." Different providers tune this balance differently, which is one real reason model choice matters beyond raw capability benchmarks — a model that's excessively conservative for a legitimate use case (a medical-information SaaS tool needing to discuss symptoms factually) may need a more carefully scoped system prompt, additional context establishing legitimate intent, or in some cases a different provider whose alignment tuning is better suited to that domain.
Related terms