KL Divergence: Two Orders, Two Different Fits
An interactive live film: every Gaussian q is a point on a floor, and forward and reverse KL to a two-peaked p are two 3D surfaces; forward KL bottoms out at a wide q covering both peaks, reverse KL has a valley under each peak.
Narration
The true distribution p, in blue, has two peaks. We want to approximate it by a single Gaussian q, with a mean mu and a width sigma. Every choice of q is a point on this floor.
Forward KL, p against q, is an average under p. It is drawn as a height above every point of the floor. Its lowest point puts q in the middle, wide enough to cover both peaks.
Wherever p has mass and q has almost none, the log ratio blows up. So forward KL forces q to cover everything.
Reverse KL, q against p, averages under q instead. Its surface has two valleys, one under each peak, with a ridge between them.
Reverse KL only charges q where q itself has mass. A narrow q sitting on one peak pays only log two for ignoring the other one, far less than forward KL would charge. It is mode seeking.
Your turn. Drag the point on the floor, and switch between the two surfaces with the slider. Find a valley of reverse KL.
The same two distributions, in a different order, give a different answer. Maximum likelihood uses forward KL, and variational inference uses reverse KL.
More from Chapter 14
Preview1:57Entropy, Cross-Entropy and KL: the Wasted BitsChapter 14
Preview1:38Entropic Optimal Transport and SinkhornChapter 14
Preview1:58The ELBO: a Hill under the EvidenceChapter 14
Preview1:45Wasserstein Distance: the Cheapest Way to Move the EarthChapter 14
Preview2:04Fisher Information: the Curvature of KLChapter 14
Preview1:53The InfoNCE BoundChapter 14