Interactive Lab · RLHF & Alignment
You can't tell a model "be more helpful"helpfulness isn't a number. But people can reliably say which of two answers is better. RLHF's key trick is to learn a reward model from exactly those comparisons: a function that scores any response, trained so that whenever a human preferred A over B, it gives A a higher score. Do that over many pairs and it quietly recovers what "good" means, a signal the language model can then be optimized against.
▶ The playground, learn quality from comparisons
RLHF is how a raw language model becomes a helpful assistant: train a reward model from human preference comparisons, then optimize the model against it. It's the alignment step behind ChatGPT and Claude, how “predict the next token” becomes “be helpful, honest, and safe.”
The code that's actually running
Reset and press Train with just 10 preference pairs, the reward model is shaky and gets a few rankings wrong. Now crank the pairs up and retrain: agreement climbs toward 100% and the responses sort into the true-quality order. Add label noise (humans disagree and make mistakes) and watch it still learn the trend, because the signal in "A beats B, most of the time" survives the noise. This is the whole bet of RLHF: individual human judgments are noisy and cheap, but averaged over enough of them they define a target worth optimizing toward.
The takeaway
P(A beats B) = σ(r(A) − r(B)); train the reward function r so preferred responses score higher. It's just logistic regression on differences.