Forward KL vs. Reverse KL Divergence: Mode Covering, Mode Seeking, and the Alignment Dynamics of Large Language Models
Every phase of modern large language model development, from multi-trillion token pre-training to reinforcement learning from human feedback (RLHF) and student model distillation, fundamentally revolves around minimizing statistical distance between probability distributions. The primary mathematical tool utilized for this purpose is the Kullback-Leibler (KL) divergence, introduced by Solomon Kullback and Richard Leibler in 1951.
Despite its foundational role in objective functions across deep learning, KL divergence possesses a mathematical asymmetry: the divergence from distribution to distribution is not equal to the divergence from to . Choosing which distribution serves as the reference and which serves as the target fundamentally changes the optimization dynamics. This mathematical distinction splits machine learning objectives into two regimes: "mode-covering" (mean-seeking) behavior via Forward KL, and "mode-seeking" (zero-forcing) behavior via Reverse KL.
Understanding this asymmetry explains why base models exhibit high output diversity but occasionally hallucinate, why RLHF alignment causes output entropy collapse, and why modern on-policy distillation enables small reasoning models to replicate the mathematical precision of frontier systems.
Mathematical Foundations: Zero-Avoiding vs. Zero-Forcing Penalties
For two continuous or discrete probability distributions (the target or data distribution) and (the parameterized model distribution) defined over a common support , the Kullback-Leibler divergence is defined as the expected logarithmic ratio of their densities:
Because (by Jensen's inequality) and equals zero if and only if almost everywhere, it acts as a directed distance metric, though it violates the triangle inequality and symmetry requirements of a formal metric space.

Forward KL: The Zero-Avoiding Property
In Forward KL divergence, denoted , the expectation is evaluated with respect to the target distribution :
Consider the behavior of the term :
- If and the model assigns near-zero probability , the ratio , and the loss term explodes to infinity.
- If and , the term evaluates to .
Because the model receives an infinite penalty if it assigns zero probability to any point where data exists, Forward KL is strictly zero-avoiding. The model distribution is forced to expand its support across all regions where . When is a complex multimodal distribution and possesses limited expressive capacity (such as a unimodal Gaussian or a compact neural network with bounded parameters), must stretch across all modes. This is known as mode-covering or mean-seeking optimization. To cover multiple separated peaks, must place substantial probability mass in the low-density valleys between modes.
Reverse KL: The Zero-Forcing Property
In Reverse KL divergence, denoted , the expectation is evaluated with respect to the parameterized model :
Analyzing the boundary conditions of Reverse KL reveals inverted optimization incentives:
- If and , the ratio , and the loss diverges to infinity.
- If but the model sets , the term evaluates to , incurring exactly zero penalty.
Under Reverse KL, the model is severely punished for generating tokens where the target distribution has no density, but receives no penalty for completely ignoring modes of . Consequently, Reverse KL is strictly zero-forcing. The parameterized model minimizes loss by contracting onto a single dominant mode (or a narrow subset of modes) of where it can ensure is high, entirely shedding the remaining modes. This is known as mode-seeking optimization.
Pre-Training and SFT: Maximum Likelihood as Forward KL
Autoregressive language model pre-training and supervised fine-tuning (SFT) rely on Maximum Likelihood Estimation (MLE), parameterized via cross-entropy loss over a training corpus:
Mathematically, minimizing the empirical cross-entropy loss over a dataset is exactly equivalent to minimizing the Forward KL divergence between the true data-generating distribution and the model :
Since the entropy of the data distribution is constant with respect to model parameters , optimizing standard cross-entropy forces the language model into the zero-avoiding, mode-covering regime.
Practical Implications for Base Models
- Broad Expressive Coverage: Base models trained with Forward KL learn to assign probability mass to a vast spectrum of linguistic styles, domain vocabularies, reasoning strategies, and human perspectives. They capture the long-tail distribution of natural language.
- Probability Blending and Hallucinations: When an autoregressive transformer encounters a prompt with multiple valid continuations (e.g., competing historical interpretations or multiple syntactically valid coding paths), Forward KL prevents the model from choosing just one and dropping the rest. If model capacity is insufficient to cleanly partition these modes conditionally, the model spreads probability across the boundary, generating blended, grammatically fluent nonsense (hallucinations).
Post-Training Alignment: Reverse KL in RLHF and Preference Optimization
While pre-training uses Forward KL to absorb broad language distributions, reinforcement learning alignment shifts the primary objective toward Reverse KL.
In standard Reinforcement Learning from Human Feedback (RLHF) pipelines, such as Proximal Policy Optimization (PPO) and Group Relative Policy Optimization (GRPO), the optimization objective balances reward maximization against a regularization penalty that prevents policy drift away from an initial reference model :
The regularization term $\mathbb{E}_{y \sim \pi_\theta}\left[\log \frac{\pi_\theta(y \mid x)}{\pi_{\mathrm{ref}}(y \mid x)}\right]$ is the Reverse KL divergence .
Forward KL (MLE / SFT) Reverse KL (RLHF / On-Policy Distill)
Target P is broad/multimodal Target P has multiple peaks
P(x) (Data) P(x) (Target)
/\ /\ /\ /\
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \_______/ \ / \_______/ \
------------------------- -------------------------
Q(x) (Model) Q(x) (Model)
_________________ /\
/ \ / \
/ \ / \
/ \ / \
------------------------- -------------------------
Zero-avoiding: covers all Zero-forcing: collapses to single
modes; places mass in valleys. peak; ignores secondary modes.The Mechanism of the "Alignment Tax"
Because the expectation in RLHF is taken over samples drawn from the active policy , the optimization process enforces zero-forcing behavior:
- The policy is rewarded for finding high-density, high-reward modes in the reward landscape (e.g., structured markdown, polite disclaimers, concise bulleted answers).
- The Reverse KL penalty permits to assign zero probability to valid, creative, or stylistically diverse completions that could generate, provided does not produce completions that deems impossible.
This mathematical pressure causes the well-documented "alignment tax" and output entropy collapse: aligned models exhibit sharp, reliable compliance on common benchmarks, but sacrifice vocabulary diversity, idiosyncratic phrasing, and creative non-conformity.
Knowledge Distillation: Offline Forward KL vs. On-Policy Reverse KL
The choice between Forward and Reverse KL divergence has transformed knowledge distillation for large language models.
Offline Distillation (Forward KL)
In classical sequence-level distillation (Kim & Rush, 2016), a large teacher model generates a static synthetic dataset , and a smaller student model is trained using standard cross-entropy loss on those outputs:
Because this objective minimizes Forward KL, the compact student model is penalized whenever it fails to cover the full diversity of the teacher's vocabulary and reasoning paths. Lacking the parameter capacity to represent the teacher's high-dimensional multimodal distribution, the student stretches its probability mass across the support, assigning high probability to invalid inter-modal tokens. This causes severe hallucination rates when compact models are trained on raw teacher rollouts.
On-Policy Distillation (Reverse KL)
To resolve this bottleneck, modern frameworks such as MiniLLM (Gu et al., 2023) and Generalized Knowledge Distillation (Agarwal et al., 2024) formulate distillation through Reverse KL divergence:
In this setup:
- The student model generates its own candidate response sequences on-policy ().
- The teacher model evaluates the log-likelihood of the student-generated tokens.
- Gradients are computed using policy gradient estimators (or analytical token-level approximations) to penalize the student whenever it generates sequences that the teacher considers improbable.
Because Reverse KL is zero-forcing, the student is not penalized for failing to replicate the entire broad vocabulary of the teacher. Instead, it is rewarded for mastering a compact, high-precision subset of valid reasoning trajectories. This shift explains why modern distilled reasoning models (such as DeepSeek-R1-Distill variants) retain high mathematical and algorithmic problem-solving accuracy on consumer hardware despite having up to 90% fewer parameters than their base teachers.
Beyond Binary Divergences: JSD, -Divergences, and Hybrid Objectives
Neither Forward nor Reverse KL represents a universally optimal objective for every stage of model development. Recent research focuses on generalized divergence families and hybrid objectives that balance coverage against precision.
+----------------------------------------------------------------------------------------------------+
| DIVERGENCE COMPARISON MATRIX |
+-------------------+----------------+-----------------+-----------------------+---------------------+
| Divergence Metric | Direction | Zero Property | Primary LLM Role | Main Trade-Off |
+-------------------+----------------+-----------------+-----------------------+---------------------+
| Forward KL | KL(P || Q) | Zero-avoiding | Pre-training, SFT | High diversity; |
| | | (Mode-covering) | Offline Distillation | hallucination risk |
+-------------------+----------------+-----------------+-----------------------+---------------------+
| Reverse KL | KL(Q || P) | Zero-forcing | RLHF (PPO/GRPO), | High precision; |
| | | (Mode-seeking) | On-Policy Distillation| entropy collapse |
+-------------------+----------------+-----------------+-----------------------+---------------------+
| Jensen-Shannon | 0.5 KL(P || M) | Symmetric, | GANs, Distributional | Bounded gradients; |
| (JSD) | + 0.5 KL(Q || M)| smoothed bound | Preference Matching | complex estimation |
+-------------------+----------------+-----------------+-----------------------+---------------------+
| Alpha-Divergence | Variational | Interpolates | Adaptive Distillation | Requires hyperparam |
| (D_alpha) | interpolation | between regimes | and Alignment | tuning per domain |
+-------------------+----------------+-----------------+-----------------------+---------------------+Jensen-Shannon Divergence (JSD)
The Jensen-Shannon Divergence creates a symmetric distance metric by measuring KL divergence against an average mixture distribution :
Because always has support wherever either or has support, JSD is bounded between 0 and (or 1 in base-2), preventing gradient explosions and offering balanced mode retention without extreme zero-forcing collapse.
Entropy-Aware Hybrid Distillation
Recent post-training pipelines combine both objectives dynamically based on local predictive uncertainty:
- High-Entropy Token Spaces: In open-ended creative contexts where the teacher distribution exhibits high conditional entropy (such as creative writing or conversational chit-chat), the training objective applies Forward KL to preserve natural phrasing diversity.
- Low-Entropy Token Spaces: In deterministic reasoning chains (such as mathematical derivations, formal logic proofs, and API syntax), the training objective switches to Reverse KL to enforce strict mode-seeking precision and eliminate hallucinated syntax.
Summary and Engineering Rules of Thumb
When architecting training loops, distillation pipelines, and alignment objectives:
- Use Forward KL (MLE / Standard Cross-Entropy) when the goal is foundational knowledge acquisition, multi-domain fluency, and broad contextual coverage. Expect high vocabulary richness but monitor for probability spreading in capacity-constrained models.
- Use Reverse KL (On-Policy Policy Gradients / RLHF Regularization) when the goal is task specialization, formal reasoning, code execution accuracy, and adherence to system constraints. Expect reduced output entropy and prepare mitigation strategies if generation diversity is required.
- Avoid Pure Offline Distillation for Sub-8B Models: Forcing a compact student to cover a frontier teacher's full distribution via Forward KL induces hallucinations. Utilize on-policy generation with teacher verification to mode-seek valid reasoning chains.
Sources
- Kullback, S., & Leibler, R. A. (1951). On Information and Sufficiency. The Annals of Mathematical Statistics, 22(1), 79-86.
- Minka, T. (2005). Divergence measures and message passing. Microsoft Research Technical Report MSR-TR-2005-173.
- Kim, Y., & Rush, A. M. (2016). Sequence-Level Knowledge Distillation. arXiv:1606.07947.
- Gu, Y., Dong, L., Wei, F., & Huang, M. (2023). Knowledge Distillation of Large Language Models (MiniLLM). arXiv:2306.08543.
- Agarwal, R., Vieillard, N., Stanczyk, P., Ramos, S., Geist, M., & Bachem, O. (2024). On-Policy Distillation of Language Models: Learning from Self-Generated Data. arXiv:2402.14811.
- Schulman, J. (2020). Approximating KL Divergence. John Schulman's Blog.
- Casper, S., et al. (2023). Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedback. arXiv:2307.15217.



