Tutorials › Statistical Learning (Graduate) › Exact Mixture Guarantees Under Log Loss

Exponential Weights and Convex Aggregation · Tutorial 333 of 989

Exact Mixture Guarantees Under Log Loss

Learn how mixture log loss decomposes into responsibility-weighted component losses and a KL term, and how this yields a precise oracle comparison.

Advanced 11 min read

What You'll Learn

  • Define mixture densities and their observation-dependent responsibilities.
  • Derive the exact pointwise log-loss identity, including when some component densities vanish.
  • State conditions under which the identity can be integrated under a true distribution.
  • Prove the risk guarantee relative to each positively weighted component.
  • Compare the mixture risk with the best dictionary member using its prior weight.
  • Identify why an unpenalized guarantee against the best member is not automatic.

Why Log Loss Is Special for Mixtures

A mixture density combines candidate distributions by averaging their densities at each possible observation. Under log loss, this construction has a precise identity: the loss of the mixture equals a responsibility-weighted average of component losses plus a nonnegative Kullback–Leibler divergence. The responsibilities depend on the observation, so this is not generally the same as averaging component risks using the original mixture weights.

That identity gives a useful population guarantee. A mixture cannot have greater log risk than a positively weighted component by more than the negative logarithm of that component's weight. In particular, it gives a comparison with the best dictionary member, with a penalty determined by how much weight the mixture assigns to that member.

Densities, Mixture Weights, and Responsibilities

Let \(f_1,\ldots,f_M\) be probability densities or mass functions with respect to one common reference measure \(\mu\). Let \(w_1,\ldots,w_M\) be nonnegative weights summing to one. The mixture density is \(f_w=\sum_{j=1}^M w_j f_j\). For an observation \(y\) at which \(f_w(y)>0\), define the responsibility of component \(j\) by its share of the mixture density at \(y\).

$$ f_w(y)=\sum_{j=1}^M w_j f_j(y), \qquad r_j(y)=\frac{w_j f_j(y)}{f_w(y)}. $$

The responsibilities are nonnegative and sum to one. If \(w_j=0\) or \(f_j(y)=0\), then \(r_j(y)=0\). In particular, a component with zero responsibility must not be treated as if its log loss were an ordinary finite number: if \(f_j(y)=0\), then \(-\log f_j(y)=+\infty\). We will therefore sum component losses only over indices with positive responsibility.

Definition: For probability vectors \(r=(r_1,\ldots,r_M)\) and \(w=(w_1,\ldots,w_M)\), with \(r_j=0\) whenever \(w_j=0\), define \( \operatorname{KL}(r\,\|\,w)=\sum_{j:r_j>0}r_j\log(r_j/w_j) \). Terms with \(r_j=0\) are omitted. This divergence is finite here because the sum is finite and every included \(w_j\) is positive.

The Exact Pointwise Identity

The central identity holds at every \(y\) where the mixture density is positive. Its careful statement matters: the component-loss sum includes only components that actually have positive responsibility at that observation.

Theorem: Suppose \(f_w(y)>0\). With the responsibilities defined above,
$$ -\log f_w(y) = \sum_{j:r_j(y)>0} r_j(y)\bigl[-\log f_j(y)\bigr] + \operatorname{KL}\bigl(r(y)\,\|\,w\bigr). $$
Every logarithm of a component density in the sum is finite, since \(r_j(y)>0\) implies \(f_j(y)>0\).

To prove the identity, fix any index with \(r_j(y)>0\). The definition of responsibility gives \(r_j(y)/w_j=f_j(y)/f_w(y)\). Consequently, \( \log(r_j(y)/w_j)=\log f_j(y)-\log f_w(y) \). Substitute this into the KL term and combine it with the weighted component losses:

$$ \begin{aligned} &\sum_{j:r_j(y)>0}r_j(y)\bigl[-\log f_j(y)\bigr] +\sum_{j:r_j(y)>0}r_j(y)\log\frac{r_j(y)}{w_j}\\ &\quad= -\sum_{j:r_j(y)>0}r_j(y)\log f_j(y) +\sum_{j:r_j(y)>0}r_j(y)\bigl[\log f_j(y)-\log f_w(y)\bigr]\\ &\quad=-\log f_w(y)\sum_{j:r_j(y)>0}r_j(y) =-\log f_w(y). \end{aligned} $$

The final equality uses \(\sum_j r_j(y)=1\). All terms used in the calculation are well-defined: the sums omit zero responsibilities, and every included component has positive density at \(y\). This proves the identity. \(\square\)

Worked Example: Computing Responsibilities and the Identity

On a two-point sample space \(\{a,b\}\), take \(f_1(a)=0.8,\ f_1(b)=0.2\) and \(f_2(a)=0.1,\ f_2(b)=0.9\). Use weights \(w_1=0.25,\ w_2=0.75\), and evaluate the identity at \(a\).

The mixture mass at \(a\) is \(f_w(a)=0.25(0.8)+0.75(0.1)=0.275\). Thus \(r_1(a)=0.2/0.275=8/11\), and \(r_2(a)=0.075/0.275=3/11\). Both responsibilities are positive, so both component losses are included.

The responsibility-weighted component loss is \( (8/11)(-\log 0.8)+(3/11)(-\log 0.1)\approx 0.7903 \). The divergence is \( (8/11)\log((8/11)/0.25)+(3/11)\log((3/11)/0.75)\approx 0.5007 \). Their sum is approximately \(1.2910\), which agrees with \(-\log(0.275)\approx 1.2910\). The identity accounts exactly for the mixture's log loss.

Worked Example: A Zero-Density Component

On \(\{a,b\}\), let \(f_1=(1,0)\), \(f_2=(0,1)\), and \(w_1=w_2=1/2\). At \(a\), the mixture mass is \(1/2\), and the responsibilities are \(r(a)=(1,0)\).

Only index 1 belongs in the component-loss sum: its contribution is \(1(-\log 1)=0\). The divergence is \( \operatorname{KL}((1,0)\,\|\,(1/2,1/2))=\log 2 \). Thus the right-hand side is \(0+\log 2=-\log(1/2)\), the mixture log loss at \(a\).

The second component has zero responsibility and infinite component loss at \(a\). Including \(0[-\log 0]\) would produce the undefined expression \(0\cdot\infty\). Omitting that term is essential, not merely a notational preference. If the true distribution puts all its mass at \(a\), the pointwise identity still holds, even though the second component's population log risk is infinite.

From the Pointwise Identity to Population Risk

Let \(Y\) have the true distribution \(P\), and define the population log risk of a density \(f\) by \(R(f)=E[-\log f(Y)]\), when this expectation is well-defined. The pointwise identity can be averaged, but exchanging it for an identity of finite expectations requires integrability. A simple sufficient condition is that \(E[|\log f_w(Y)|]<\infty\) and \(E[|\log f_j(Y)|]<\infty\) for each \(j\) with \(w_j>0\). Under this condition, the responsibility-weighted losses are integrable, and the pointwise identity gives

Population identity: Under the stated integrability condition,
$$ R(f_w) = E\!\left[\sum_{j:r_j(Y)>0}r_j(Y)\bigl[-\log f_j(Y)\bigr]\right] + E\!\left[\operatorname{KL}\bigl(r(Y)\,\|\,w\bigr)\right]. $$
The KL term is nonnegative, but the first term uses observation-dependent responsibilities rather than the fixed weights \(w_j\).

This identity is exact but does not, by itself, say that the mixture risk is at most the weighted average \(\sum_j w_jR(f_j)\). The weights inside the first expectation are \(r_j(Y)\), which generally vary with \(Y\). A direct comparison with each positively weighted component instead follows from a pointwise density inequality.

A Risk Guarantee for Every Positively Weighted Component

For any \(j\) with \(w_j>0\), nonnegativity of the other mixture terms gives \(f_w(y)\geq w_jf_j(y)\). When \(f_j(y)>0\), taking negative logarithms yields \(-\log f_w(y)\leq-\log f_j(y)-\log w_j\). If \(f_j(y)=0\), the right-hand side is \(+\infty\), so the extended-real inequality remains valid. Averaging gives the following result whenever the risks are well-defined; for example, it is enough that both log densities are absolutely integrable under \(P\).

Theorem: For every \(j\) with \(w_j>0\), if \(R(f_w)\) and \(R(f_j)\) are well-defined and finite, then
$$ R(f_w)\leq R(f_j)+\log\frac{1}{w_j}. $$
If every dictionary member has positive weight and finite risk, then
$$ R(f_w)\leq \min_{1\leq j\leq M} \left\{R(f_j)+\log\frac{1}{w_j}\right\}. $$

The proof is precisely the pointwise inequality just established, integrated under \(P\). The additive term is the cost of assigning only weight \(w_j\) to the comparator. With uniform weights, \(w_j=1/M\), the guarantee becomes \(R(f_w)\leq\min_j R(f_j)+\log M\). For nonuniform weights, a member with a small prior weight has a larger comparison penalty.

Worked Example: A Numerical Population-Risk Comparison

Let \(Y\) be Bernoulli with success probability \(0.7\). Consider two Bernoulli candidate densities with success probabilities \(0.8\) and \(0.4\), and give each weight \(1/2\). The mixture is Bernoulli with success probability \(0.6\), since its success mass is \((0.8+0.4)/2=0.6\), and its failure mass is \((0.2+0.6)/2=0.4\).

The mixture risk is \(R(f_w)=-0.7\log(0.6)-0.3\log(0.4)\approx 0.6325\). The component risks are \(R(f_1)=-0.7\log(0.8)-0.3\log(0.2)\approx 0.6390\) and \(R(f_2)=-0.7\log(0.4)-0.3\log(0.6)\approx 0.7947\). Here the mixture risk is below both component risks. The theorem's bound for the first component is \(R(f_w)\leq 0.6390+\log 2\approx 1.3322\), which holds but is not tight. The guarantee is an upper bound, not an equality.

Why the Best-Member Comparison Needs a Penalty

The mixture guarantee is penalized by the weight of the comparator; it does not generally imply \(R(f_w)\leq\min_j R(f_j)\). A mixture can assign little weight to the best member, allowing other components to dominate the mixture density even where that best member predicts well.

Worked Example: The Mixture Can Lose to the Best Member

Let the true distribution be Bernoulli with success probability \(0.8\). Use \(f_1\) with success probability \(0.8\), \(f_2\) with success probability \(0.01\), and weights \(w_1=0.01,\ w_2=0.99\). The first candidate matches the truth, but it receives little mixture weight.

The mixture's success probability is \(0.01(0.8)+0.99(0.01)=0.0179\), and its failure probability is \(0.9821\). Therefore \(R(f_w)=-0.8\log(0.0179)-0.2\log(0.9821)\approx 3.22\). In contrast, \(R(f_1)=-0.8\log(0.8)-0.2\log(0.2)\approx 0.5004\). Thus the mixture risk is much larger than the best component risk. The valid componentwise bound allows this: for \(f_1\), it is \(R(f_w)\leq R(f_1)+\log 100\approx 5.1056\), which is consistent with the computed risk.

Interpretation and a Common Pitfall

The identity separates two features of log-score aggregation. The responsibility-weighted loss reflects which components explain the realized observation; the KL term measures the discrepancy between those observation-specific responsibilities and the original mixture weights. Meanwhile, the comparator guarantee follows from the simpler fact that the mixture density contains \(w_j f_j\) as one nonnegative summand.

  • Pitfall: averaging with the wrong weights. The exact identity does not use \(w_j\) to average component losses. It uses \(r_j(Y)\), which depends on the observed outcome. Replacing responsibilities by the fixed mixture weights changes the expression and is generally incorrect.
  • Pitfall: claiming an unpenalized best-member bound. The componentwise guarantee includes \(\log(1/w_j)\). It cannot be dropped without additional assumptions, such as a suitable lower bound on the weight assigned to the best member.
  • Pitfall: retaining zero-responsibility infinite losses. If \(r_j(y)=0\) and \(f_j(y)=0\), the product \(r_j(y)[-\log f_j(y)]\) is not defined by ordinary arithmetic. Omit that index from the sum; do not silently manipulate \(0\cdot\infty\).
Key takeaway: For a density mixture, the pointwise log-loss identity is exact when its component-loss sum is restricted to positive responsibilities. At the population level, the mixture is within \(\log(1/w_j)\) of every positively weighted component, and hence within the corresponding weight penalty of the best dictionary member.

Check Your Understanding

Answer each question using the definitions and guarantees in this tutorial.

  1. Why must the component-loss sum in the pointwise identity omit indices with zero responsibility?
  2. For two components with weights \(1/3\) and \(2/3\), what population-risk penalty does the guarantee give relative to the first component?
  3. Are the responsibilities generally equal to the original mixture weights? Explain what determines them.
  4. With \(M\) equally weighted candidates, state the resulting guarantee relative to the best dictionary member.
  5. Why does the componentwise guarantee not imply that the mixture risk is always below the risk of the best component?
Clinical Biostats