When you talk to ChatGPT or Claude, you get back a natural answer that grasps your intent, much like a human assistant. Yet an LLM (large language model) that has merely learned from huge amounts of text is not naturally that “user-friendly.” Even with vast knowledge, it tends to write a plausible-sounding continuation of the text rather than properly answering your question.
The core technology that turns this “smart but hard-to-use AI” into “an AI that responds helpfully and naturally for people” is RLHF (Reinforcement Learning from Human Feedback). Adopted in ChatGPT and its prototype InstructGPT 2, it underpins the usability of today’s conversational AI. This article explains, for non-specialists and drawing on OpenAI’s paper, what RLHF is, why it is needed, and how it works.
Why It’s Needed: Pre-Training Alone Leaves an AI “Smart but Hard to Use”
An LLM is first created through pre-training, in which it reads enormous amounts of text from the internet. At this stage the model picks up grammar, knowledge, and textual patterns, but its objective is simply to “predict the next word.”
As a result, a merely pre-trained model does not necessarily answer a user’s question straightforwardly. Ask it to “tell me about X” and it might start listing similar questions instead of answering, or produce roundabout text. Knowledgeable as it is, it has not been tuned to respond in the way people want.
This is where RLHF comes in. As ITmedia’s @IT explains, RLHF is “a machine learning method that trains an AI model to reflect human preferences and values” 2. By having humans indicate “this way of answering is more preferable” and using that as a cue to adjust the model, the AI learns to respond naturally in line with user intent.
The effect is reported to be large enough to overturn differences in scale. In OpenAI’s paper, an InstructGPT model with 1.3 billion (1.3B) parameters tuned with RLHF was rated more preferable than the pre-tuning GPT-3 with 175 billion (175B) parameters 1. Even at less than one-hundredth the size, tuning to align with human preferences led more directly to “usable answers.”
How It Works: Teaching Human Preferences in Three Steps
RLHF proceeds in roughly three steps 2. OpenAI’s paper likewise reports a flow of fine-tuning by collecting demonstrations, followed by reinforcement learning using human ranking data 1.
1. Supervised fine-tuning (SFT) First, humans write examples of “ideal answers” to create demonstrations, and the model learns from them 2. In OpenAI’s paper, prompts written by labelers and actual prompts submitted via the API were used to collect “demonstration data of desired model behavior,” which was used to fine-tune GPT-3 1. This instills the basic stance of properly answering a question.
2. Training a reward model (RM) Next, a separate AI—a reward model—is built to score “what kind of answers humans prefer.” The model is made to produce several answers to the same question, and humans rank them by “this one is better” 1. By learning from this large set of ranking data, the reward model becomes “a model that uses feedback to compute a reward value” 2—in effect, a grader that evaluates human preferences on our behalf. The human judgment that “output A is more natural and preferable than output B” is converted into a reward signal for the model 3.
3. Optimization via reinforcement learning Finally, the LLM itself is adjusted through reinforcement learning so as to earn high scores from the reward model acting as grader 1. A widely used, representative algorithm here is PPO (Proximal Policy Optimization), released by OpenAI in 2017 2. The model generates an answer, gets scored, and gradually improves toward ways of answering that earn higher rewards—much like refining one’s moves to chase a high score in a game, repeated for text generation.
Through these three stages, the LLM acquires “the way of answering that people want.” What sets RLHF apart from conventional reinforcement learning is that the reward is built not from mechanical rules but from human subjective evaluation, which guides the model toward high-quality, diverse outputs 3.
Its Relationship to Fine-Tuning
RLHF is often discussed alongside fine-tuning, but the two are not opposing concepts. As we saw above, the first step of RLHF is itself supervised fine-tuning; it helps to view RLHF as a method that includes fine-tuning and then stacks a reward model and reinforcement learning on top of it.
Acquire foundational knowledge through pre-training, teach specific behaviors through fine-tuning, and finish by aligning with human preferences through RLHF—this layering is what shapes the natural responses of today’s conversational AI.
Its Relationship to Safety (Alignment)
Another important role of RLHF is AI safety. Making an AI’s outputs conform to human intent and values is called alignment, and RLHF has become a leading means of achieving it.
Being able to teach “desirable ways of answering” through human feedback also means, conversely, being able to steer the model to “avoid harmful content or inappropriate answers.” @IT likewise positions RLHF as a method for aligning outputs with human values 2. The fact that ChatGPT and Claude can respond with restraint to difficult questions owes a great deal to this accumulated tuning.
That said, RLHF is not a cure-all. Bias can enter the human evaluations themselves, and a model can sometimes learn undesirable behaviors that exploit “gaps” in the reward model. Even so, RLHF was a turning point that made conversational AI practical and easy to use 3, and it remains the starting point for subsequent alignment research.
If you want to understand more about why LLMs can answer so naturally, reading this alongside the basics of LLMs, fine-tuning that shapes how a model answers, and hallucination where AI produces plausible-sounding errors will give you a more three-dimensional picture of how conversational AI works.
Sources
- Training language models to follow instructions with human feedback - InstructGPT paper by Ouyang et al. (OpenAI), March 2022
- What Is RLHF (Reinforcement Learning from Human Feedback)? - Japanese explainer by @IT’s “AI/Machine Learning Glossary”
- What Is RLHF? Learning Steps and How It Differs from Fine-Tuning - Japanese explainer by AIsmiley