AI Model Wiki

    Skip to main content
    Back to Glossary

    RLHF (Reinforcement Learning from Human Feedback)

    Reinforcement Learning from Human Feedback (RLHF) is a training methodology that uses human preference judgments to steer a language model toward outputs that are more helpful, accurate, and aligned with human values. The process works in two stages: first, human raters compare pairs of model responses and record which they prefer; second, those ratings train a separate "reward model" that scores any given output. The original language model is then fine-tuned with reinforcement learning — typically Proximal Policy Optimization — to maximize that reward signal.

    Think of it like training a new hire with a manager who gives feedback rather than a textbook. The employee (the model) tries different approaches, the manager (human raters) says which were better, and over time the employee internalises what "good work" looks like without needing an explicit rulebook for every situation.

    # Simplified RLHF pipeline sketch
    1. Collect prompt set P
    2. Sample two completions (a, b) from the base LLM for each p in P
    3. Human labels: preferred(a, b) → dataset D_pref
    4. Train reward model R on D_pref
    5. Fine-tune LLM with PPO to maximise E[R(completion)]
    

    RLHF sits at the intersection of Fine-tuning and Foundation Model work; understanding Loss Function and Pretraining gives essential background. Techniques like LoRA are often combined with RLHF to reduce the compute cost of the fine-tuning step.

    You will encounter RLHF whenever you read about how GPT-4, Claude, or Gemini were aligned — it is the dominant technique behind the jump from raw pretrained models to the conversational assistants most people interact with today.

    AI Terminology
    Glossary