Post-Training from First Principles: SFT, RLHF, DPO and GRPO
Post-training
RLHF
DPO
GRPO
A derivation-first, implementation-driven map of modern post-training.
Note
This is a living essay under active development. Its central artifact is a controlled comparison using the same base model, data split, and evaluation harness.
Thesis. Post-training is a sequence of distribution-shaping problems: supervised imitation, preference estimation, constrained policy optimization, and evaluation under imperfect rewards.
1 What the reader will build
- A QLoRA supervised fine-tuning baseline
- A pairwise preference dataset and reward model
- A miniature PPO/RLHF loop with explicit KL control
- DPO implemented directly from its loss equation
- A small GRPO experiment on verifiable tasks
- A unified evaluation report and model card