Better Estimation of the Kullback-Leibler Divergence Between Language Models
Afra Amini, Tim Vieira, Ryan Cotterell
Abstract
Estimating the Kullback--Leibler (KL) divergence between language models has many applications, e.g., reinforcement learning from human feedback (RLHF), interpretability, and knowledge distillation. However, computing the exact KL divergence between two arbitrary language models is intractable. Thus, practitioners often resort to sampling-based estimators. While it is easy to fashion a simple Monte Carlo (MC) estimator that provides an unbiased estimate of the KL divergence between language models, this estimator notoriously suffers from high variance and can even result in a negative estimate of the KL divergence, a non-negative quantity. In this paper, we introduce a Rao--Blackwellized estimator that is unbiased and provably has variance less than or equal to that of the standard Monte Carlo estimator. In an empirical study on sentiment-controlled fine-tuning, we show that our estimator provides more stable KL estimates and reduces variance substantially. Additionally, we derive an analogous Rao--Blackwellized estimator of the gradient of the KL divergence, which leads to more stable training and produces models that more frequently appear on the Pareto frontier of reward vs. KL compared to the ones trained with the MC estimator of the gradient.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 3d9c8989-be37-4ec3-9a0f-d5c8006eeac4Cited by top-tier papers5
- Self-Distillation Enables Continual LearningIdan Shenfeld, Mehul Damani, Jonas Hübotter, Pulkit AgrawalICML 2026 · 159 citations
- Privileged Information Distillation for Language ModelsEmiliano Penaloza, Dheeraj Vattikonda, Nicolas Gontier, Alexandre Lacoste et al.ICML 2026 · 61 citations
- Hybrid Policy Distillation for LLMsWenhong Zhu, Ruobing Xie, Rui Wang, Pengfei LiuICML 2026 · 2 citations
- Efficient KL Divergence Estimation via Truncated Top-K Integration for Large Language ModelsXinyuan Wang, Luozhijie Jin, Bo Wang, Yuan Li et al.ACL 2026
- Reinforcement Learning via Self-DistillationJonas Hübotter, Frederike Lübeck, Lejs Behric, Anton Baumann et al.ICML 2026
Builds on10
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- On-Policy Distillation of Language Models: Learning from Self-Generated MistakesRishabh Agarwal, Nino Vieillard, Yongchao Zhou, Piotr Stanczyk et al.ICLR 2024 · 311 citations
- ULTRAFEEDBACK: Boosting Language Models with Scaled AI FeedbackGanqu Cui, Lifan Yuan, Ning Ding, Guanming Yao et al.ICML 2024 · 286 citations
- Learning to summarize with human feedbackNisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel M. Ziegler et al.NeurIPS 2020 · 124 citations
Related papers
- Variational Best-of-N AlignmentAfra Amini, Tim Vieira, Elliott Ash, Ryan CotterellICLR 2025 · 1 citation
- Reliable Estimation of KL Divergence using a Discriminator in Reproducing Kernel Hilbert SpaceSandesh Ghimire, Aria Masoomi, Jennifer G. DyNeurIPS 2021 · 17 citations
- Don't Ignore the Tail: Decoupled Distillation Produces Top Maths Students on an Academic BudgetSayantan Dasgupta, Trevor Cohn, Tim BaldwinICML 2026
- Language Model Alignment with Elastic ResetMichael Noukhovitch, Samuel Lavoie, Florian Strub, Aaron C. CourvilleNeurIPS 2023 · 42 citations
- -Divergence Regularized RLHF: Two Tales of Sampling and Unified AnalysesDi Wu, Chengshuai Shi, Jing Yang, Cong ShenICML 2026
