Pretraining gives a language model broad capability. Post-training turns that capability into useful behavior.
The central question is always the same: how do we tell the model what “better” looks like? The answer determines the data we collect and the optimization method we use. Supervised fine-tuning (SFT) learns from demonstrations. Direct preference optimization (DPO) learns from comparisons. Group relative policy optimization (GRPO) learns from rewards assigned to model-generated attempts.
These methods are complementary. A practical training program often uses each one where its feedback signal is clearest.
The common feedback loop
Every post-training method can be viewed as a loop:
- Give the model a prompt.
- Obtain one or more responses.
- Evaluate those responses using a demonstration, preference, or reward.
- Update the model so that better behavior becomes more likely.
The algorithms differ mainly in step three. That difference changes the data requirements, the training objective, and the kinds of behavior the method can express.
SFT: learn from demonstrations
Supervised fine-tuning provides a prompt and a high-quality target answer. The model learns to make each demonstrated token more likely.
For a prompt and target response , let denote the target tokens before position . The high-level objective is:
Here, is the model policy and denotes its trainable parameters. During training, teacher forcing reveals the correct previous tokens. Every target token contributes a gradient, which makes SFT efficient and stable.
What SFT does well
SFT works best when experts can demonstrate the desired behavior directly. It is a strong choice for teaching:
- response format and tone;
- domain-specific conventions;
- tool-call schemas;
- standard task patterns;
- a reliable starting policy for later preference or reinforcement learning.
Its main limitation comes from the same structure that makes it simple. Each example usually presents one “right” answer. The training signal does not naturally say that two answers are acceptable but one is clearer, safer, or more useful.
DPO: learn from comparisons
Sometimes judging two responses is easier than writing the perfect one. DPO uses a prompt, a chosen response, and a rejected response. It updates the policy so the chosen answer becomes more likely relative to the rejected answer.
A useful intuition is:
The full DPO objective also compares the policy against a fixed reference model. The reference acts as an anchor, discouraging the model from moving too far from its starting behavior while it learns the preference.
When DPO fits
DPO is useful when reviewers can make consistent pairwise judgments about qualities such as helpfulness, style, concision, or safety. It avoids fitting a separate reward model and does not require on-policy sampling during the preference-training update.
The quality of the method still depends on the preference data. Ambiguous guidelines, inconsistent raters, and systematic annotator bias become part of the training signal. Before scaling a DPO run, I would inspect agreement rates and the failure cases where preferences are unstable.
GRPO: learn from sampled outcomes
GRPO starts from a different kind of supervision. For each prompt, the current policy generates a group of candidate responses. A reward function scores them, and the group provides a local baseline for deciding which attempts performed better.
For a prompt , the old policy samples a group of responses . Write the -th response as and its prefix before token as . The rewards form the vector . Under outcome supervision, every token in response receives the group-normalized advantage:
The subscript identifies the sampled response, while identifies a token inside that response. With one outcome reward per response, has the same value for every token in . Implementations must safely handle groups whose reward standard deviation is zero.
Define the per-token probability ratio as:
Leaving the expectation over prompts and sampled groups implicit, the core clipped GRPO objective is:
The clipped term is:
This clipping limits how far the updated policy can move from the old policy in one step. The KL term, weighted by , discourages the policy from drifting too far from the reference model . Together, these terms increase the probability of relatively better attempts while keeping the update controlled.
Why the group baseline matters
Actor-critic methods typically train a separate value model to estimate a baseline. GRPO instead compares samples generated for the same prompt. This removes the learned critic from the optimization structure, which can reduce memory pressure and simplify the training system.
The trade-off is rollout cost. A group requires several fresh generations per prompt. Training performance therefore depends on rollout throughput, reward latency, sampling efficiency, and the balance between generation and policy updates.
Verifiable tasks are a natural fit
GRPO is especially attractive when outcomes can be checked consistently:
- a math answer matches the reference;
- generated code passes tests;
- structured output satisfies a schema;
- a tool-using agent completes the requested task.
The reward does not need to explain which token caused success. It needs to distinguish better outcomes often enough to steer exploration. Poorly specified rewards can still produce reward hacking, shortcuts, or behavior that scores well without satisfying the real objective.
SFT, DPO, and GRPO at a glance
| Method | Feedback collected | What the model learns | Good first use |
|---|---|---|---|
| SFT | A demonstrated answer | Imitate the example | Instruction following and response format |
| DPO | A chosen and rejected pair | Prefer one answer over another | Style, helpfulness, safety, and subjective quality |
| GRPO | Rewards for sampled answers | Repeat attempts that outperform their peers | Math, code, tool use, and other scored outcomes |
The optimizer should follow the feedback signal, not the other way around. If strong demonstrations are available, start with SFT. If comparisons are reliable but ideal answers are expensive, use DPO. If the outcome can be scored and exploration matters, consider GRPO.
A practical post-training stack
A common progression is:
- SFT teaches the expected response shape. The model learns the task interface and produces outputs that are good enough to evaluate.
- DPO resolves quality trade-offs. Pairwise data sharpens behavior where demonstrations leave several plausible answers.
- GRPO optimizes scored outcomes. The model explores its current behavior space and learns from success or failure.
This order is not mandatory. Each stage only makes sense when its feedback is trustworthy. A small, carefully audited reward set can be more useful than a large training run built around an unreliable metric.
Engineering matters as much as the equation
For reinforcement learning, the algorithm is only one part of the system. A usable pipeline also needs:
- prompt and rollout data management;
- scalable generation;
- deterministic or well-calibrated reward functions;
- filtering and failure handling;
- reference-policy and KL controls;
- evaluation that catches reward hacking and regressions.
Frameworks such as verl provide an execution layer for rollouts, rewards, and distributed policy updates. They do not decide whether the feedback accurately represents the behavior you want. That remains the core design problem.
Closing perspective
Post-training is feedback engineering. SFT says “show it.” DPO says “compare it.” GRPO says “score it.”
The best method is the one whose supervision most faithfully captures the desired behavior at a cost you can sustain. In mature systems, the answer is often a combination: demonstrations establish competence, preferences refine judgment, and rewards improve outcomes that can be measured reliably.






















