How is k-means a limiting case of EM for a Gaussian mixture model, and what assumptions about the clusters does this reveal?

Unsupervised learning, Mixture models
Level L4 Advanced. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can take the small-variance limit of the responsibilities, and spot the hidden assumptions of k-means.

Key idea

Give every component the same fixed covariance σ2I (a round Gaussian of width σ) and equal weights. Then the responsibility of component k for point xi is γik=exp⁡(−∥xi−μk∥2/2σ2)∑jexp⁡(−∥xi−μj∥2/2σ2). As σ→0 this becomes 1 for the nearest centre and 0 for the rest. So the E-step becomes the k-means assignment step, and the M-step mean becomes the cluster mean.

Steps

  1. Fix Σk=σ2I for every component and πk=1/K. Then πkN(x∣μk,σ2I)∝exp⁡(−∥x−μk∥2/2σ2), and the shared constants cancel in γik.
  2. Divide the top and bottom by the numerator: γik=[∑jexp⁡(−(∥xi−μj∥2−∥xi−μk∥2)/2σ2)]−1. If μk is strictly the nearest centre, every term with j≠k has a negative exponent and goes to 0 as σ→0, so γik→1. If some μj is nearer, its term goes to ∞, so γik→0.
  3. M-step: μk=∑iγikxi/∑iγik becomes the plain mean of the points assigned to k, which is exactly the k-means update.
  4. Objective: −σ2 times the expected complete-data log-likelihood equals 12∑i,kγik∥xi−μk∥2 plus terms of size about σ2log⁡σ, which vanish as σ→0. So it tends to 12∑i∥xi−μci∥2, the k-means objective, where ci is the cluster of point i.
  5. Read off the assumptions: clusters are round (the same spread in every direction), have equal spread, have roughly equal weight, and each point belongs to exactly one cluster. That is why k-means struggles with stretched, unequal or overlapping clusters, which a full GMM can handle.

Common mistakes

How long your answer should be

Half a page; about 4 minutes.

Last checked on 4 December 2026.

Read this

Previous in Unsupervised learning: t-SNE maps points xi∈R50 to yi∈R2 by minimising ∑iKL(Pi∥Qi), where pj∣i∝exp⁡(−∥xi−xj∥2/2σ2) in the original space and qj∣i∝(1+∥yi−yj∥2)−1 in the embedding. (a) What happens to the embedding if σ is very large, or very small? (b) How is σ chosen in practice?
Next in Unsupervised learning: How can the principal components in a feature space ϕ(x) be found by solving an eigenvalue problem for the n×n kernel matrix K, with Kij=k(xi,xj)=ϕ(xi)⊤ϕ(xj)? How are the coefficients normalised, how is K centred, and how is a new point projected?