Information / Divergence
verifiedKL Divergence
How much do you lose by believing the wrong distribution? KL divergence answers in bits: the extra length of every message when you encode reality's symbols using your model's code. It is zero only when the two agree, and it is not symmetric — being wrong about a rare event costs differently depending on which way round you are wrong.
The asymmetry is a design decision, not a wart. Forward KL, averaging over the data, punishes a model that puts no mass where data is and so spreads out to cover everything; reverse KL, averaging over the model, punishes putting mass where data is not and so collapses onto one mode. Variational inference minimises the reverse, which is why a VAE's posterior is famously over-confident, and RLHF penalises the reverse to keep a policy near its reference.
D sub KL (p‖q) = Σ sub x p(x)·log(p(x)/q(x)) = H(p,q) − H(p) ≥ 0, with equality only when p = q. It is not a metric: it fails symmetry and the triangle inequality both, which is why the symmetrised Jensen–Shannon divergence exists and why calling it a distance causes trouble.
excess-bits holds 33% of the budget; rest holds the remaining 67%.
Bits wasted by coding with the wrong distribution against the bits the right one would have cost, in bits. Drag the divergence up to watch the waste overtake the message it is carrying.
Reviewed by opendroid · 2026-08-18
- arXiv:1312.6114 — Auto-Encoding Variational Bayes
Origin · not linkable
- Kullback & Leibler 1951 — On Information and Sufficiency · Annals of Mathematical Statistics 22(1) · doi:10.1214/aoms/1177729694