What it is used for
RLHF is used to make a language model's outputs match what users actually want: following instructions, answering truthfully, and not producing toxic or unhelpful content. A raw language model trained only to predict the next word of internet text is good at continuing text, but that skill is not the same as obeying an instruction; such a model may answer a question with another question, invent facts, or produce offensive wording. Human judgment is used to close that gap, because qualities such as being helpful and not being offensive are far easier to show through ranked examples than to write as a formula.
The best known result of the method is InstructGPT. At the level of the method itself, RLHF is the bridge between a raw language model and an assistant that answers instructions: the raw material is the same model, and what changes is the behavior of its outputs after tuning with human judgment.
How to use it
End users do not use RLHF directly; they meet its result, a model that has already been tuned. For builders, the recipe follows its anchor paper and runs in three stages.
The first stage is supervised fine-tuning. Raters, called labelers, write example answers of the desired kind for a set of prompts, and the base model is trained to imitate those examples. The prompts come from two sources: prompts written by the labelers themselves, and real prompts submitted by users through the OpenAI API.
The second stage trains a reward model. The model from the first stage is asked to produce several answers to one prompt, and labelers rank those answers from best to worst. From that collection of rankings, a separate scoring model is trained to predict which answer the labelers would prefer. This scoring model is the reward model: it turns the human taste recorded in the rankings into a number.
The third stage is reinforcement. The model is tuned further with a reinforcement learning algorithm called PPO, with the reward model supplying the score: answers the reward model rates highly make the model more likely to answer in that way. After this stage, the model no longer only imitates examples; it pursues the judgment learned from humans.
Real examples
The following examples are not invented for this article. All three are recorded in their own primary papers and are quoted from the pages opened in this package's building session.
The first example is the result that made RLHF famous. In human evaluations on prompts from the OpenAI API, outputs from the 1.3B parameter InstructGPT model were preferred to outputs from the 175B GPT-3, even though it is far smaller. The paper's abstract reads exactly: "outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters." The smaller model won not by being bigger, but by being tuned to follow user intent.
The second example compares models of equal size so the comparison is fair. Outputs from the 175B InstructGPT were preferred to outputs from the 175B GPT-3 in 85 percent of evaluations, plus or minus 3 percent, and on TruthfulQA, a benchmark that tests whether a model answers trick questions correctly, InstructGPT gave truthful and informative answers about twice as often as GPT-3.
The third example is older and shows where the idea came from. In 2017, Paul Christiano and colleagues showed that a reinforcement learning agent can be trained from human choices between two segments of behavior, with no reward formula at all, on Atari games and simulated robot locomotion. The human feedback was very small: less than one percent of the agent's interactions with its environment, and complex new behaviors could be trained with about an hour of human time.
Practitioner level
The stage details are measured in the anchor paper. Its labeling team was about 40 contractors hired through Upwork and ScaleAI, chosen through a screening test that tested their sensitivity to the preferences of different user groups and their ability to spot potentially harmful outputs. For each prompt in the ranking data, labelers ranked K outputs with K ranging from 4 to 9, and the reward model was trained on all the pairwise comparisons contained in those rankings. Agreement between labelers was itself measured: the training labelers agreed with each other in 72.6 percent of evaluations, plus or minus 1.5 percent, a figure that shows human taste is real but never unanimous.
Two practical points follow from this arrangement. First, the reward model is an estimate, not a copy of human taste: it is only as good as its ranking data, and a model pushed too hard to chase the reward score can find gaps in that estimate. Second, the supervised stage is still needed first, because rankings can only be made once the model can already produce answers worth ranking. RLHF is therefore not a replacement for base training, but a tuning layer on top of a model that has already been trained and already imitated examples.
Expert level
Formally, the anchor paper sets RLHF up as follows. The reward model is trained as a choice predictor: given one prompt and two answers, it learns to give the higher score to the answer the labelers preferred, trained on pairwise comparisons between answers with a loss that pushes the winning answer's score up and the losing answer's score down. Rankings of K answers are broken into all the pairs they contain, and all the comparisons from one prompt are trained as a single batch element: the paper states that this is much more computationally efficient because it requires only a single forward pass of the reward model for each completion, and that because it no longer overfits, it achieves much improved validation accuracy and log loss.
The reinforcement stage uses PPO, the proximal policy algorithm that limits how far the model's behavior may move in each update step, plus a deviation penalty that holds the model back from drifting too far from the supervised fine-tuned model. Without that restraint, chasing the reward score alone would damage the model's language ability; the paper records that the method causes only minimal performance regressions on public language benchmarks, a cost its authors call an alignment tax, which they press down by mixing the original training data into the reinforcement stage.
Its historical standing is clear. The idea of learning from human choices was proven first on game and robot agents by Christiano and colleagues in 2017, then carried into text summarization by Stiennon and colleagues, and the 2022 paper that anchors this article is the one that brought it to instruction following language models at wide scale, with the result that fine-tuning with human feedback beat simply making the model bigger. Its abstract closes with an admission that reads exactly: "Even though InstructGPT still makes simple mistakes, our results show that fine-tuning with human feedback is a promising direction for aligning language models with human intent."
Limits and risks
The first limit is admitted by the paper itself: the model is aligned to the preferences of a specific group, its labelers and researchers, not to human values in the broad sense. The labelers were mostly English-speaking people living in the United States or Southeast Asia, and they did not always agree with each other, so the behavior the model learns is the behavior that small group preferred. The prompts also came from one company's service, so the taste recorded there may not represent other users.
The second limit is the estimate inside the reward model. Because the reward score is learned from a limited set of rankings, a model can learn to please raters on the surface, for example by answering at length and with confidence, without actually being more correct; and if a model is optimized too hard toward that score, the quality of its outputs can actually fall. The anchor paper also records that InstructGPT still makes simple mistakes, can still follow harmful instructions when asked in certain ways, and that its truthfulness and toxicity evaluations rest on the tools and benchmarks available at the time.
The risk that follows for general readers: an RLHF tuned model feels more polite and more helpful, and that feeling can make its outputs trusted more than they deserve. This tuning changes the model's behavior and politeness, not the guaranteed truth of its content; the most convincing sounding answer still has to be checked, especially where the consequences are real.
