Skip to main content
Home › Categories › Artificial Intelligence & Computing › LLM Post-Training and Alignment: SFT, RLHF, DPO, and Verifiable RL (GRPO)

LLM Post-Training and Alignment: SFT, RLHF, DPO, and Verifiable RL (GRPO)

Author: ZUVDEX Team 4 min read
rlhf vs dpo llm alignment supervised fine tuning sft proximal policy optimization ppo reward model direct preference optimization dpo grpo verifiable rewards rlvr constitutional ai rlaif

A freshly pretrained base language model is purely an internet document simulator: prompted with "How do I fix a SQL deadlock?", it is equally likely to append three more unanswered forum questions as to provide a clear solution. Post-training transforms that raw base distribution into a reliable assistant through three progressive stages: Supervised Fine-Tuning (SFT) on curated demonstrations, human/AI preference optimization via RLHF or Direct Preference Optimization (DPO), and Reinforcement Learning with Verifiable Rewards (RLVR / GRPO) for math, code, and logic.

Key Highlights

  • Supervised Fine-Tuning (SFT) teaches conversational turn structure, tool-call schemas, and tone, where dataset quality beats sheer volume ("LIMA principle").
  • Classical RLHF trains a separate Bradley–Terry Reward Model on pairwise chosen-versus-rejected responses and optimizes the policy via Proximal Policy Optimization (PPO) with a KL-divergence leash.
  • Direct Preference Optimization (DPO) mathematically reparameterizes the RLHF objective in closed form, aligning models directly on preference pairs without instantiating a separate reward model or value critic.
  • Group Relative Policy Optimization (GRPO) eliminates the heavy critic network in online RL by scoring multiple sampled rollouts per prompt against deterministic unit tests or math verifiers.

Comparing SFT, Online PPO-RLHF, DPO, and Critic-Free GRPO

Classical PPO-based RLHF (pioneered at scale in InstructGPT) requires holding four large models in GPU memory simultaneously—the active policy, frozen reference policy, reward model, and value critic—while carefully preventing "reward hacking," where the policy learns to flatter the user (sycophancy) or output needlessly long bulleted lists to exploit quirks in the learned reward model.

Rafael Rafailov and colleagues showed in 2023 that the optimal KL-constrained policy induces an exact analytical mapping from log-probability ratios to implicit rewards. DPO optimizes binary cross-entropy directly over `(prompt, chosen, rejected)` triples using just two models (or a single model with LoRA adapter toggled off for reference log-probs), making preference tuning accessible to any engineering team. For reasoning domains where correctness can be checked deterministically, online GRPO samples a group of 8–64 completions per problem, executes Python tests or symbolic answer checkers, normalizes rewards within the group, and updates policy weights without needing a separate critic.

Post-Training Method Models in Memory Data Required Best Engineering Use Case
SFT (Instruction Tuning) 1 Policy (or Base + LoRA) Curated (prompt, ideal_response) pairs Teaching domain format, JSON schemas & baseline instruction skill
DPO / SimPO / ORPO Policy + Reference (or 1 w/ LoRA) Offline (prompt, chosen, rejected) pairs Fixing tone, safety refusals, hallucination abstention & style
PPO-RLHF 4 Models (Policy, Ref, RM, Critic) Prompts + trained Reward Model Large-lab open-ended subjective alignment with active exploration
GRPO (Verifiable RL) Policy + Ref + Deterministic Sandbox Math, code, SQL or tool tasks with verifiers Teaching multi-step reasoning, self-correction & coding mastery

Defending Against Sycophancy, Length Bias, and Alignment Tax

Naive preference datasets often reward assertive, polished markdown even when the user’s premise contains a factual misconception—breeding sycophantic assistants that agree with wrong assumptions. High-integrity post-training mixes explicit pushback examples ("Actually, that statute was repealed in 2024…"), calibrated "I don’t have enough context to verify" abstentions, and length-controlled preference penalties.

  • Always run SFT (or ensure preference pairs lie in-distribution for the base policy) before offline DPO; off-policy preference pairs far from the model’s distribution cause probability degradation.
  • Keep KL-penalty β tuned (typically 0.05–0.2 in DPO) so alignment does not erode factual diversity or coding accuracy ("alignment tax").
  • Audit reward models and LLM judges specifically for verbosity bias and markdown-header gaming.

FAQs

Does post-training (SFT/DPO/RLHF) add new factual world knowledge to an LLM?

Mostly no: vast factual knowledge is acquired during multi-trillion-token pretraining, whereas post-training elicits, formats, prioritizes, and verifies capabilities already latent in the base model—attempting to force unfamiliar facts via SFT alone often increases confident hallucination.

When does online RL (PPO/GRPO) beat offline DPO?

Offline DPO only sees static pre-collected responses, whereas online RL samples from the model’s own evolving distribution at every iteration—proving decisively stronger on multi-step mathematical, coding, and agentic reasoning.

References & Sources

  • Ouyang, Long et al. (2022) — Training Language Models to Follow Instructions with Human Feedback (InstructGPT), NeurIPS.
  • Rafailov, Rafael et al. (2023) — Direct Preference Optimization: Your Language Model is Secretly a Reward Model (DPO), NeurIPS.
  • Shao, Zhihong et al. (2024) — DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models (GRPO), arXiv:2402.03300.