The RL Path and KL Constraints in LLM Post-Training
This article breaks down how task shape determines the ceiling for post-training algorithm choices, and why the field's shift toward lightweight, value-network-free methods only holds for short, verifiable tasks. It explains where credit assignment becomes the bottleneck in long-horizon tool use, why distribution alignment dominates open-ended generation, and how forward versus reverse KL divergence act as directional constraints rather than mere distances. It closes with a practical engineering checklist covering reference models, reward de-biasing, sampling and filtering, monitoring, and compute-storage decoupling.
1. Background: Why the Post-Training Narrative Gets Distorted
For a while, the popular story in post-training went roughly like this: early work relied on proximal policy optimization with a value network, which meant a long engineering pipeline, heavy memory overhead, and high sensitivity to hyperparameters. Then came methods that dropped the value network and replaced it with group-relative advantages, which were lighter to train and easier to scale on reasoning tasks. Many people concluded from this that post-training would converge on lightweight methods across the board.
That judgment largely holds for verifiable tasks, but it skips a decisive precondition: task shape. Once you add task shape back into the picture, many seemingly contradictory observations immediately become consistent.
2. Task Shape Sets the Algorithmic Ceiling
Post-training tasks can be roughly grouped into three categories:
- Short-horizon verifiable tasks: math problems, coding problems, single-turn Q&A. Answers can be checked automatically; trajectories are short and feedback is dense.
- Long-horizon tool-use tasks: multi-turn calls, retrieval, execution, revision. Trajectories are long, there are many intermediate steps, and success signals are sparse and delayed.
- Open-ended generation tasks: writing, summarization, conversational style. There is no single correct answer, and quality judgments depend on preference models or human annotation.
For the first category, dropping the value network and estimating advantages from the relative performance of samples within a group works very well: sampling cost stays controllable, variance is suppressed through group size and filtering strategies, and the training loop is short.
For the second category, the problem becomes credit assignment: a failure may originate from a wrong parameter at step 3, while the reward only shows up at step 12. If you rely entirely on Monte Carlo-style return estimation here, gradient variance grows quickly with trajectory length and training stability degrades. The common industry practice is not an either/or choice, but the introduction of biased yet low-variance value estimates, hierarchical rewards, process rewards, or step-level discounting, trading controllable bias for lower variance.
For the third category, the core tension is not advantage estimation but distribution alignment: the model needs to shift toward the preference direction without drifting so far from the base model that language quality degrades.
Conclusion: the starting point for algorithm selection is not “which update is more fashionable,” but three metrics: trajectory length, feedback density, and verifiability.
3. What KL Actually Does: A Directional Constraint, Not a Distance
KL divergence is often treated as “the distance between two distributions,” but it is asymmetric, and swapping the direction changes training behavior entirely. In post-training, it behaves more like a directional leash.
3.1 Forward KL and Its Natural Affinity with SFT
Supervised fine-tuning minimizes the forward KL from the data distribution to the model distribution, which is mode-covering: wherever real data appears, the model should not assign too low a probability. This explains two common SFT behaviors: outputs trend toward smoothness with reasonable diversity, but the model also “hard-covers” uncertain branches, which can produce hallucinatory confidence aligned with the data distribution.
Written schematically as an objective:
L_sft = - E_{x,y ~ D} [ log π_θ(y | x) ]
3.2 Reverse KL and Its Natural Affinity with RL
The KL penalty common in policy optimization is the reverse form, pointing from the model distribution to the reference distribution, and it is mode-seeking: the model tends to contract into high-probability regions of the reference model, avoiding placing mass where the reference model considers impossible.
L_kl = KL( π_θ(·|x) || π_ref(·|x) )J = E_{x, y ~ π_θ} [ r(x,y) ] - β * L_kl
Two direct consequences follow. First, training becomes more “conservative,” and diversity may drop. Second, β becomes the most critical safety valve: too large and the model barely learns; too small and it runs off the rails, with degraded or even repetitive output.
3.3 The Essential Difference Between SFT and RL on Positive-Reward Data
Given the same batch of positive samples, the difference between SFT and RL lies not in the data but in the source of the gradient:
- SFT’s gradient comes from “raising the likelihood of this sample,” is independent of the sampling distribution, and weights samples uniformly.
- RL’s gradient comes from “raising the probability of high-return trajectories,” is weighted and baselined, and is estimated on the model’s own sampling distribution.
So RL can correct the “negative space” that SFT fails to learn (what should not be said), at the cost of sampling overhead and variance; SFT is cheap and stable but struggles to express preference structure. A common practical combination is to first use positive samples for SFT to establish a behavioral baseline, then apply RL shifts with preference or reward signals while keeping a KL anchor in place.
4. Engineering Practice Checklist
- Fix the task shape first, then the algorithm: prefer lightweight methods for short verifiable tasks; prioritize solving credit assignment for long-horizon tasks.
- The reference model and KL anchor are not optional: the reference model should share the same lineage as the base model, so the anchor points in the right direction.
- Make rewards resistant to gaming: de-bias for length, format, and keywords, and add process checks to avoid reward hacking.
- Sampling and filtering strategies: dynamic sampling, difficulty stratification, and filtering out all-correct or all-wrong samples within a group can significantly improve signal-to-noise ratio.
- Put monitoring metrics up front: watch entropy, the KL curve, average reward, truncation rate, and repetition rate at the same time; if any one goes abnormal, stop first and investigate.
- Decouple compute and storage: place training, inference sampling, logs, and metrics on general-purpose capabilities such as container platforms, object storage, logging services, and monitoring and alerting, so scaling stays elastic and problems can be traced back.
5. Conclusion
Post-training is not about finding a “better algorithm,” but about systematically matching the algorithm to the task shape: verifiable short tasks live on sampling efficiency, long-horizon tasks live on credit assignment, and open-ended tasks live on distribution alignment. Understanding the directional difference between forward and reverse KL, and getting the three things solid, β, the reference model, and reward de-biasing, matters more for the final result than chasing any single algorithm.
