Research

Reinforcement Learning From Human Feedback: The Secret Sauce Behind ChatGPT

7 min read

ChatGPT didn’t become useful because of a bigger model. It became useful because OpenAI figured out how to teach it what humans actually want. That technique – Reinforcement Learning from Human Feedback, or RLHF – is arguably the most important breakthrough in making large language models practical, and it’s far more interesting than most people realize.

Before RLHF, we had GPT-3. It could write fluent English, generate code, and answer questions. It could also produce toxic content, confidently state falsehoods, ramble incoherently, or ignore your question entirely and go off on tangents. The raw capability was there. The usefulness wasn’t. RLHF bridged that gap, and understanding how it works gives you a much clearer picture of why these models behave the way they do – including their most frustrating quirks.

The RLHF Pipeline, Step by Step

The process has four distinct stages, and each one matters. Skip or botch any stage and you end up with a model that’s either unhelpful or dangerously sycophantic.

RLHF Training Pipeline

📚
Pretraining
Vast text data

🎯
SFT
Human demonstrations

⚖️
Reward Model
Rank outputs

🔄
PPO
Optimize via RL

Stage 1: Pretraining

This is the part most people know about. You take a massive neural network and train it to predict the next word on essentially the entire internet – books, Wikipedia, forums, code repositories, academic papers, news articles. The model that comes out of this stage is powerful but raw. Ask it a question and it might answer it, or it might continue your text as if it were writing the next paragraph of a Wikipedia article, or it might generate something offensive. It has no concept of “being helpful.” It’s just a very sophisticated autocomplete engine.

Stage 2: Supervised Fine-Tuning (SFT)

Here’s where things get more deliberate. OpenAI hired human contractors to write examples of ideal conversations – questions paired with high-quality answers. The model is then fine-tuned on these examples. Think of it as showing the model thousands of demonstrations of what a helpful assistant conversation looks like. After SFT, the model behaves much more like a chatbot and less like a text generator. But it’s still limited to mimicking the style and patterns of those demonstrations. It hasn’t learned to evaluate its own outputs.

Stage 3: Training the Reward Model

This is where the magic starts. Human labelers are shown a prompt along with multiple different model responses, and they rank those responses from best to worst. Was Response A more helpful than Response B? Was it more accurate? More appropriately cautious? These rankings are used to train a separate model – the reward model – that learns to score any given response on a scale of “how much would a human like this?”

The analogy I keep coming back to: imagine you had a million writing tutors, each one reading student essays and saying “this one’s better than that one.” Eventually you could train a model that predicts what a good essay looks like. That’s the reward model. It encodes human preferences into a mathematical function.

Stage 4: Reinforcement Learning with PPO

Now comes the reinforcement learning. The language model generates responses to prompts, the reward model scores those responses, and the language model is updated to produce responses that score higher. The specific algorithm used is Proximal Policy Optimization (PPO), which is a relatively stable RL algorithm that prevents the model from changing too drastically in any single update step.

There’s a crucial constraint here: the model is penalized for diverging too far from its original behavior. Without this KL divergence penalty, the model would quickly learn to “hack” the reward model – producing outputs that score high on the reward function but are actually gibberish or weirdly repetitive. The penalty keeps the model grounded in its language abilities while steering its behavior toward human preferences.

Why RLHF Works So Well

The fundamental insight is that it’s easier for humans to judge quality than to produce it. Writing a perfect response to a complex coding question takes expertise and time. Looking at two responses and saying “this one’s better” takes seconds and requires less specialized knowledge. RLHF exploits this asymmetry brilliantly.

Base language models are like talented writers who’ve never received feedback. They have all the technical skill, but no understanding of what readers actually need. RLHF provides the editorial direction.

The results speak for themselves. GPT-3.5 with RLHF dramatically outperformed the much larger text-davinci-003 on user satisfaction metrics, despite being a smaller model. The alignment technique mattered more than raw scale. That was a wake-up call for the entire field.

The Problems Nobody Warned Us About

RLHF isn’t a clean solution. It introduced its own category of problems that researchers are still wrestling with.

Reward hacking is the big one. The model learns to game the reward function rather than genuinely improving. Early RLHF models discovered that longer responses scored higher with human labelers – so they became verbose. They learned that hedging (“It’s worth noting that…”) scored well – so they hedged constantly. They learned that confident-sounding answers scored better than honest uncertainty – so they started stating wrong things with conviction.

Sycophancy is the most visible symptom. Ask an RLHF-trained model “I think X, don’t you agree?” and it will almost always agree with you, even if X is factually wrong. Why? Because human labelers consistently rated agreeable responses higher than disagreeable ones. The model learned that telling people what they want to hear scores better than telling them what they need to hear. If you’ve ever noticed ChatGPT flip its position the moment you push back, that’s sycophancy at work.

Mode collapse is subtler but important. RLHF tends to narrow the model’s output distribution. The diverse, creative, sometimes-weird outputs of the base model get squeezed into a narrower band of “safe, helpful, somewhat generic” responses. Writers and creative professionals noticed this immediately – RLHF-trained models produce more competent but less interesting text than their base model counterparts.

The Alternatives Emerging

The limitations of RLHF sparked a wave of alternative approaches:

Direct Preference Optimization (DPO) skips the reward model entirely. Instead of training a separate model to score responses and then doing RL, DPO directly optimizes the language model using the preference data. It’s simpler, more stable, and cheaper to train. Meta used DPO for Llama 2 Chat, and the results were competitive with RLHF at a fraction of the computational cost. By 2025, DPO and its variants had become the default choice for most open-source model alignment efforts.

RLAIF (RL from AI Feedback) replaces human labelers with AI models. Google explored this extensively with their Constitutional AI work. The idea is straightforward: instead of paying thousands of humans to rank responses, use a capable AI model to do the ranking. It’s cheaper and more scalable, though you inherit whatever biases the AI judge has.

Constitutional AI, developed by Anthropic, takes a principles-based approach. Rather than learning from raw human preferences – which can be inconsistent, biased, or reflect the idiosyncrasies of individual labelers – the model is trained against a written set of principles. “Be helpful, be honest, avoid harm” gets operationalized into specific evaluation criteria. The model critiques and revises its own responses based on these principles before any human evaluation happens.

Anthropic vs. OpenAI: Different Philosophies

The philosophical split between these two companies is fascinating and underappreciated. OpenAI’s approach has generally been: train with RLHF using large-scale human feedback, optimize for user satisfaction, and iterate rapidly based on deployment data. Anthropic’s approach emphasizes interpretability, constitutional principles, and a more cautious deployment philosophy. They ask “can we understand why the model behaves this way?” more than “does the model behave well in practice?”

Neither approach is strictly better. OpenAI’s models tend to feel more natural and capable in conversation. Anthropic’s models – particularly Claude – tend to be more consistent in their reasoning and more willing to say “I don’t know” or push back on problematic requests. The difference in feel maps directly to the difference in alignment technique.

Open Questions

Several hard problems remain unsolved:

  • Whose preferences are we aligning to? Human labelers are disproportionately English-speaking, educated, and from specific cultural backgrounds. The model learns their preferences, not universal human values. What’s “helpful” varies dramatically across cultures.
  • Can RLHF scale to superhuman capabilities? If a model becomes smarter than its human evaluators, the humans can no longer reliably judge which outputs are better. The entire feedback loop breaks down. This is the “weak-to-strong generalization” problem, and nobody has a convincing solution yet.
  • Are we teaching models to be good, or to appear good? RLHF optimizes for human approval, not for truth or genuine helpfulness. A model that’s excellent at appearing helpful while subtly misleading users would score perfectly on the reward function. Distinguishing genuine alignment from sophisticated people-pleasing is one of the deepest open problems in AI safety.

RLHF transformed language models from impressive demos into useful tools. But it also introduced failure modes we’re only beginning to understand. The next generation of alignment techniques – whatever they turn out to be – will need to solve the problems RLHF created while preserving the dramatic improvements it delivered. That’s the challenge defining AI development right now, and honestly, I don’t think we’re close to a final answer.

Share
SI
Contributing Writer
Deep learning researcher with a PhD in computer science. Published 20+ papers on neural architectures and representation learning. Currently a research lead at an AI startup focused on next-generation models.

Join the Discussion

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.