Is KL divergence a distance, and why is minimising cross-entropy the same as maximum likelihood?
Probability and statistics, Information theory
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you precisely understand the information-theoretic losses used throughout classification.
Key idea
The KL divergence satisfies , where is the cross-entropy and is the entropy of . But it is not symmetric and fails the triangle inequality, so it is not a metric. With fixed (the data), minimising over the model is the same as minimising KL, which is the same as maximising the average log-likelihood.
Steps
- Define . Show it is non-negative with Jensen’s inequality; this result is called Gibbs’ inequality.
- Give a two-point example showing : for and , nats, whereas nats.
- Decompose . Since does not depend on the model, minimising one is the same as minimising the other.
- Take to be the empirical distribution , which puts mass on each of the training points . Then , the negative average log-likelihood.
- Mention how forward and reverse KL typically behave when is too simple to match , for example one Gaussian fitted to a two-peaked . Minimising forward KL tends to be mass-covering: must put mass wherever does, or the divergence blows up. Minimising reverse KL tends to be mode-seeking: is penalised for mass where is small, so it often locks onto one peak. These are tendencies, not theorems.
Common mistakes
- Calling KL a metric because it is non-negative and zero only when .
- Mixing up which argument is the data and which is the model.
- Forgetting that KL is infinite when where .
How long your answer should be
About 3 minutes; one equation per claim.
Read this
Previous in Probability and statistics: What is the difference between MLE and MAP estimation, and how can you show that L2-regularised linear regression is MAP with a Gaussian prior?
Next in Probability and statistics: What are the maximum likelihood estimates of and from independent samples of , and how do you derive them?