Post · 2 min read· p. 93
The KL divergence is an important tool for studying the distance between two probability distributions. Formally, given two distributions p and q, the KL divergence is defined as
KL(p∣∣q):=∫p(x)log(p(x)/q(x))dx
Note that KL(p∣∣q)=KL(q∣∣p). Intuitively, a small KL(p∣∣q) means that there are few points that p assigns high probability to but that q does not. We can also think of KL(p∣∣q) as the number of bits of information needed to update from the distribution q to the distribution p.
Suppose that p and q are both mixtures of other distributions: p(x)=∑iαiFi(x) and q(x)=∑iβiGi(x). Can we bound KL(p∣∣q) in terms of the KL(Fi∣∣Gi)? In some sense this is asking to upper bound the KL divergence in terms of some more local KL divergence. It turns out this can be done:
Theorem: If ∑iαi=∑iβi=1 and Fi and Gi are all probability distributions, then
KL(∑iαiFi∣∣∑iβiGi)≤∑iαi(log(αi/βi)+KL(Fi∣∣Gi)).
Proof: If we expand the definition, then we are trying to prove that
∫(∑αiFi(x))log(∑βiGi(x)∑αiFi(x))dx≤∫(∑iαiFi(x)log(βiGi(x)αiFi(x)))dx
We will in fact show that this is true for every value of x, so that it is certainly true for the integral. Using log(x/y)=−log(y/x), re-write the condition for a given value of x as
(∑αiFi(x))log(∑αiFi(x)∑βiGi(x))≥∑iαiFi(x)log(αiFi(x)βiGi(x))
(Note that the sign of the inequality flipped because we replaced the two expressions with their negatives.) Now, this follows by using Jensen's inequality on the log function:
∑iαiFi(x)log(αiFi(x)βiGi(x))≤(∑iαiFi(x))log(∑αiFi(x)∑iαiFi(x)βiGi(x)αiFi(x))=(∑iαiFi(x))log(∑iαiFi(x)∑iβiGi(x))
This proves the inequality and therefore the theorem. □
Remark: Intuitively, if we want to describe ∑αiFi in terms of ∑βiGi, it is enough to first locate the ith term in the sum and then to describe Fi in terms of Gi. The theorem is a formalization of this intuition. In the case that Fi=Gi, it also says that the KL divergence between two different mixtures of the same set of distributions is at most the KL divergence between the mixture weights.