Why RLHF After SFT? Moving from Imitation to Human Preference Alignment

    Supervised fine-tuning teaches language models to imitate demonstrations, but it does not directly optimize how people rank competing responses. This article explains why preference alignment follows SFT, outlines the RLHF workflow, and compares on-policy optimization with PPO against offline preference optimization with DPO. It also examines their costs, limitations, and practical trade-offs when building an alignment pipeline.

    1. What Is Missing from SFT?

    Supervised fine-tuning (SFT) is fundamentally a form of imitation learning. Given a dataset of high-quality human-written examples, the model learns to predict demonstrated answers using a token-level cross-entropy loss.

    This approach has clear advantages:

    • Stable training: The supervised objective provides a straightforward optimization process.
    • Manageable costs: Training does not require repeated sampling or autoregressive generation of candidate responses, keeping compute and memory requirements relatively predictable.
    • Simple implementation: Data formats are straightforward, and the engineering workflow is well established.

    However, SFT learns the distribution of demonstrations rather than directly learning human preferences among possible answers. This creates three important limitations.

    1. The single-demonstration problem: A question may have several reasonable answers, but a training example typically supplies only one. Matching that demonstration does not explicitly teach the model to distinguish a good answer from a better one.
    2. Limited generalization: When real user inputs differ from the training distribution, the model may expose biases in the dataset or reproduce mistakes and unintended habits introduced by demonstrators.
    3. No explicit preference ranking: Standard token-level cross-entropy does not directly express response-level judgments such as “this answer is safer, more helpful, or more concise.”

    SFT can teach desirable behavior through examples. What it lacks is an explicit objective for comparing alternative responses according to human preferences. That gap motivates reinforcement learning from human feedback (RLHF).

    2. Why RLHF Follows SFT: From Imitation to Alignment

    A commonly documented approach to training conversational models follows three stages:

    Pretraining → SFT → RLHF

    The reason for adding RLHF after SFT lies in the difference between their objectives:

    • SFT optimizes the likelihood of demonstrated answers at the token level.
    • RLHF optimizes a response-level preference signal, typically using a reward model to score outputs and reinforcement learning to update the policy.

    A conventional RLHF workflow has three steps.

    Step 1: Collect preference data

    For the same prompt, generate multiple candidate responses. Human annotators compare pairs of responses or rank them according to quality.

    Step 2: Train a reward model

    Use those preferences to train a model that assigns a quality score to a response. The reward model serves as a learned evaluator of human preferences.

    Step 3: Optimize the policy with reinforcement learning

    Use reward-model scores as the reward signal to encourage the policy model to produce higher-scoring responses. A Kullback–Leibler (KL) divergence constraint or penalty is commonly included to discourage excessive deviation from the SFT reference policy.

    This workflow introduces the preference-ranking signal that standard SFT lacks. Instead of only learning to reproduce demonstrated answers, the model is optimized to favor responses that people prefer among the available alternatives.

    Goals such as safer behavior, refusal of harmful requests, and greater helpfulness can therefore become explicit optimization targets.

    3. On-Policy and Offline Preference Optimization

    Two widely used approaches to preference alignment are:

    • On-policy reinforcement learning, represented by Proximal Policy Optimization (PPO).
    • Offline preference optimization, represented by Direct Preference Optimization (DPO).

    PPO and DPO are established method names, not specific products. DPO is often discussed alongside off-policy approaches because it can learn from previously collected responses, although it is not an off-policy reinforcement learning algorithm in the same sense as conventional RL methods.

    For this comparison, the main practical distinction is whether training requires fresh responses from the current policy.

    • On-policy optimization: The model generates responses, those responses are evaluated, and the resulting feedback is used to update the model.
    • Offline preference optimization: The model learns directly from an existing dataset of responses and preference labels, without requiring fresh generation during each training update.

    Consider training an agent to play a team-based competitive game.

    In the first approach, a coach evaluates the agent’s own gameplay: successful actions receive positive feedback, while reckless mistakes receive negative feedback. This resembles on-policy training because feedback concerns actions taken by the current agent.

    In the second approach, the agent studies recordings and learns which actions are preferred. This resembles offline learning: the examples are available in advance, but they were not necessarily produced by the current agent.

    The distinction matters because a preferred response in an offline dataset may not be one the current policy would naturally generate. On-policy feedback instead evaluates responses drawn from the model’s own current output distribution.

    That closer match can support further improvement, but it does not establish a universal performance advantage over offline methods.

    4. Why On-Policy Training Costs More—and Can Be More Effective

    The main additional expense of on-policy training is response generation.

    SFT can compute its supervised loss over provided sequences using teacher forcing. Response generation, by contrast, requires autoregressive sampling: the model produces one token after another, often over hundreds or thousands of tokens.

    Training may also generate multiple responses for each prompt to obtain richer feedback. These rollouts add substantial compute, memory, and time costs. Practical implementations often rely on distributed inference and batched sampling to manage them.

    The additional expense can provide three benefits.

    1. Better distribution matching

    Feedback applies to responses the current policy actually produces. This reduces the mismatch between learning from answers generated by another policy and improving the model’s own behavior.

    2. Targeted learning from mistakes

    The model’s own low-quality responses provide useful negative examples. Feedback on these outputs can help suppress undesirable behavior that the policy currently exhibits.

    3. A continuous improvement loop

    After each update, the model generates responses from its changed output distribution and receives new feedback. Training can therefore keep addressing the behavior of the evolving policy rather than relying entirely on a fixed dataset.

    These benefits make on-policy optimization attractive when the goal is to push performance further. Actual gains, however, depend on reward-model quality, the strength of the KL constraint, sampling settings, and other implementation details.

    A particularly important risk is reward hacking. If the reward model has exploitable weaknesses, policy optimization may learn to obtain higher scores without producing genuinely better answers. Fresh generation and repeated optimization can accelerate that process.

    On-policy training therefore needs rigorous evaluation and appropriate constraints, not just a reward signal.

    5. Choosing an Approach in Practice

    On-policy and offline approaches are not mutually exclusive. A practical alignment pipeline can use them at different stages.

    • Start with SFT: Establish basic instruction-following behavior before preference optimization. This provides a useful starting policy for subsequent training.
    • Use offline methods when preference data is available and budgets are limited: DPO-style methods optimize directly on preference pairs. Their relatively simple implementation and stable training make them useful baselines.
    • Consider on-policy optimization when pursuing further improvements: PPO-style training can build on an SFT model, using a high-quality reward model and KL regularization to guide iterative updates.
    • Combine both approaches: Use offline preference optimization to learn efficiently from existing data, then apply on-policy training for further refinement.

    Regardless of the approach, several factors deserve sustained attention.

    First, evaluation criteria must remain appropriate as the policy improves. A reward model that no longer distinguishes the policy’s stronger responses reliably can become a bottleneck.

    Second, preference annotations need consistency. Conflicting labels weaken the signal that defines which responses should be favored.

    Third, safety evaluation needs adequate coverage. Improvements in a preference objective do not eliminate the need to check how the model behaves across relevant requests and failure cases.

    For methods that use an explicit reward model, the reward model and policy may need to evolve together. For all preference-based methods, the quality of the underlying preference signal remains central: defining what counts as “good” places a practical limit on what optimization can achieve.

    6. Conclusion

    SFT teaches a language model to imitate useful demonstrations. RLHF adds an explicit mechanism for optimizing responses according to human preferences.

    The distinction is not that SFT cannot teach helpful or safe behavior. Rather, its standard objective does not directly rank competing answers. Reward-based reinforcement learning introduces that response-level comparison, while methods such as DPO offer an offline route to preference optimization.

    On-policy training costs more because it requires fresh generation, but it provides feedback closely matched to the current policy and supports iterative refinement. Offline preference optimization is generally more economical and operationally simpler, especially when a substantial preference dataset is already available.

    Choosing between them—or combining them—requires balancing data quality, compute budgets, reward reliability, and evaluation coverage. Alignment is not a one-time training step. It is an ongoing process driven by better data, better feedback, and repeated evaluation.