Responsibilities
Page 1102 ended with the same factor appearing in every derivative: over the whole mixture density. §11.2.1 gives it a name and a meaning, and the book flags how much work it will do:
But before we do this, we introduce a quantity that will play a central role in the remainder of this chapter: responsibilities.
What you’ll learn
Section titled “What you’ll learn”- Equation 11.17’s definition, and Equation 11.19 checked entry by entry — including one place the book’s printed matrix disagrees with the arithmetic, by .
- Equation 11.24: , and to .
- The margin note ” follows a Boltzmann/Gibbs distribution”, verified: with , matching to .
- What “soft assignment” buys on this data: at the initialisation the least-decided point is at ; at convergence it is at .
- The entropy of as a measure of how much softness is actually in play — mean at the start against a maximum of .
- Shrink every variance and the responsibilities become indicator vectors — which is K-means, exactly as §11.5 says.
- And a practical trap: Equation 11.17 typed out as written produces NaNs of entries once the variances are small; in log-space it produces the exact one-hot answer.
Intuition: a soft assignment is the only thing that can be differentiated
Section titled “Intuition: a soft assignment is the only thing that can be differentiated”Suppose you knew which component made each point. Then fitting is trivial — split the data and fit each Gaussian to its own share, with the closed forms of Chapter 8. That is the whole difficulty: you do not know.
The obvious repair is to guess — assign each point to its most likely component and fit. That is K-means, and it works, but it throws away the fact that some points are genuinely ambiguous. Worse, it is not differentiable: nudge a parameter and a point’s label jumps discontinuously.
The responsibility is the repair that keeps the calculus. Each point contributes to every component, weighted by how plausible that component makes it. Nothing jumps, everything differentiates, and the hard assignment reappears as a limit.
flowchart TD A["1 / p(x_n | theta) in every derivative
Equation 11.16"] A --> B["r_nk = pi_k N(x_n | k) / sum_j pi_j N(x_n | j)
Equation 11.17"] B --> C["a probability vector: sums to 1"] B --> D["N_k = sum_n r_nk
Equation 11.24"] D --> E["mu_k, Sigma_k, pi_k updates
Sections 11.2.2 to 11.2.4"] B --> F["posterior p(z_nk = 1 | x_n)
Section 11.4.3"] B --> G["variances to 0: one-hot
= K-means, Section 11.5"]
§11.2.1 The definition
Section titled “§11.2.1 The definition”The responsibility of the th mixture component for data point is proportional to the likelihood […] Therefore, mixture components have a high responsibility for a data point when the data point could be a plausible sample from that mixture component.
is a normalised probability vector, with — a “soft assignment” of to the components.
Summing down the columns gives Equation 11.24:
| total | ||||
|---|---|---|---|---|
| at the initialisation |
is a count that need not be a whole number — the effective number of points each component owns. That it sums to exactly is the column-sum counterpart of the rows summing to , and it is what makes Equation 11.42’s a valid set of weights.
The margin note, checked
Section titled “The margin note, checked”follows a Boltzmann/Gibbs distribution.
Write . Then Equation 11.17 is exactly
Measured, .
Soft, and how soft
Section titled “Soft, and how soft”On the book’s seven points, soft assignment is barely being used:
| least-decided point | its | points below | mean entropy | |
|---|---|---|---|---|
| at the initialisation | of | |||
| at convergence | of |
against a maximum possible entropy of . Seven well-separated points in one dimension do not need much softness — but the algorithm does, because a hard assignment is not differentiable, and because the book’s own Figure 11.10(b) shows the opposite case: “the responsibilities of these two clusters for those points are around .”
Turn the temperature down and you get K-means
Section titled “Turn the temperature down and you get K-means”Scaling every variance by and letting :
| mean | mean entropy | points above | |
|---|---|---|---|
§11.5 states the relationship: “If we treat the means in the GMM as cluster centers and ignore the covariances (or set them to ), we arrive at K-means. […] K-means makes a ‘hard’ assignment of data points to cluster centers, whereas a GMM makes a ‘soft’ assignment via the responsibilities.”
On this data, run from the book’s own starting means, the two do not land in the same place:
| centres | cluster sizes | within-cluster SS | |
|---|---|---|---|
| GMM at convergence | — | ||
| K-means from | |||
| K-means handed the GMM’s answer |
Two things worth separating. From the same start the two algorithms disagree by — they split the seven points differently, against effectively . And the GMM’s partition is not even the better K-means answer: its within-cluster sum of squares is against .
The reason is in the last row of the GMM’s parameters: its variances are , and — a factor of apart. K-means has no variances, so it cannot prefer a tight cluster of two over a loose cluster of three. Only if you hand K-means the GMM’s own answer does it stay there, and then the centres agree to and the counts differ only by being integers.
-
What is r_nk, in one sentence?
Equation 11.17. Each row sums to one, so it is a probability vector over components — a soft assignment. Section 11.4.3 later identifies it as a genuine posterior, the probability that the k-th component generated the n-th point.
pch.quizShowAnswer
B — The share of x_n that component k is credited with — its weighted density over the whole mixture's density at that point — Equation 11.17. Each row sums to one, so it is a probability vector over components — a soft assignment. Section 11.4.3 later identifies it as a genuine posterior, the probability that the k-th component generated the n-th point.
-
The book's margin note calls r_n a Boltzmann distribution. Is that exact?
And the framing pays: the ratio of two responsibilities is the exponential of their energy gap, the mixture weight enters as a uniform offset, and scaling all the variances by t is exactly a temperature. The last of those is the K-means limit.
pch.quizShowAnswer
B — It is exact: r_n is the softmax of minus the energies -log pi_k - log N(x_n | k), matching to 1.1e-16 — And the framing pays: the ratio of two responsibilities is the exponential of their energy gap, the mixture weight enters as a uniform offset, and scaling all the variances by t is exactly a temperature. The last of those is the K-means limit.
-
What is N_k, and why need it not be a whole number?
Measured at the book's initialisation: 2.057228, 2.009008 and 2.933763, summing to 7.000000000000. K-means from the same start gives integer sizes 3, 2 and 2 — a different split entirely, because it has no variances with which to prefer a tight cluster over a loose one.
pch.quizShowAnswer
B — The column sum of the responsibilities — an effective count, fractional because the assignment is soft, summing to N exactly — Measured at the book's initialisation: 2.057228, 2.009008 and 2.933763, summing to 7.000000000000. K-means from the same start gives integer sizes 3, 2 and 2 — a different split entirely, because it has no variances with which to prefer a tight cluster over a loose one.
-
What goes wrong if you code Equation 11.17 exactly as printed?
The fix is to work in log-space: add the log weight to the log density, subtract the row's logsumexp, exponentiate. Where both forms work they agree to 2.2e-16. This is not exotic — in D dimensions the log-density scales with D, so 784-pixel images hit it at ordinary parameter values.
pch.quizShowAnswer
B — Numerator and denominator both underflow to zero, giving NaN — all 21 entries of a 7-by-3 matrix once the variances are small — The fix is to work in log-space: add the log weight to the log density, subtract the row's logsumexp, exponentiate. Where both forms work they agree to 2.2e-16. This is not exotic — in D dimensions the log-density scales with D, so 784-pixel images hit it at ordinary parameter values.
Exercises
Section titled “Exercises”Exercise 1 – Check Equation 11.19 against the arithmetic
Section titled “Exercise 1 – Check Equation 11.19 against the arithmetic”Exercise 2 – The margin note, as arithmetic
Section titled “Exercise 2 – The margin note, as arithmetic”Exercise 3 – How much softness is actually used
Section titled “Exercise 3 – How much softness is actually used”Exercise 4 – Turn the temperature down
Section titled “Exercise 4 – Turn the temperature down”Exercise 5 – Soft counts against hard counts
Section titled “Exercise 5 – Soft counts against hard counts”Recall card
Section titled “Recall card”- The responsibility is the factor that appeared in every derivative on the previous page, given a name: component k’s weighted density at a point, over the whole mixture’s density there.
- Each row is a probability vector, so responsibilities are a soft assignment of a point to the components.
- Summing down a column gives N_k, the effective number of points a component owns — fractional, and summing to N exactly.
- The book’s printed responsibility matrix disagrees with the arithmetic at one entry, by 0.001; the computed value at x equal to zero is 0.000150, not 0.001.
- The margin note is exact, not a metaphor: the responsibility vector is the softmax of minus the energies, matching to 1.1e-16.
- So the ratio of two responsibilities is the exponential of their energy gap, the mixture weights enter as a uniform offset, and the variances act as a temperature.
- On the book’s seven points the softness is barely used — mean entropy 0.014 at convergence against a possible 1.099 — because the clusters are well separated.
- Shrinking every variance drives the responsibilities to indicator vectors, which is K-means. Section 11.5 says exactly this.
- But from the same starting means they do not agree: centres 1.504119 apart, splitting the points 3-2-2 against effectively 2-2-3, because K-means has no variances to weigh a tight cluster against a loose one.
- Equation 11.17 typed out as written divides a vanishing number by a vanishing number, returning NaN for all 21 entries once the variances are small.
- In log-space it returns the exact answer, and where both work they agree to 2.2e-16.
- A hard assignment is not a rounding of a soft one — it is a different algorithm, and the soft version is the one that can be differentiated.
Next: Updating the Means — §11.2.2, the first of three updates, and the one the book draws a picture for.
pch.coffeeTagline
pch.coffeeCtapch.feedbackHeading
pch.feedbackSubheading