KL divergence measures how one probability distribution diverges from a reference distribution :
Key properties:
- (Gibbs' inequality), with equality iff
- Not symmetric: — so it's not a true distance
- Forward KL : must cover all of 's support → mean-seeking
- Reverse KL : avoids regions where is small → mode-seeking
Where it appears:
- Cross-entropy: . Minimizing cross-entropy = minimizing KL from true distribution
- RLHF Pipeline — KL penalty prevents the policy from drifting too far from the reference model → KL Penalty
- VAEs — KL term regularizes the latent distribution toward the prior
- Information theory — KL is the extra bits needed when using code optimized for but the true distribution is
See also: Maximum Likelihood Estimation, Loss Functions