A good deal of machine learning is inference about things you cannot observe. A clustering model must guess which group generated each data point. A speech model must guess which sound each audio frame came from. A survey analyst must fill in the answers respondents skipped. The data you can see is the shadow; the explanation you want is the object casting it.
For almost fifty years the standard way to work this problem has been the expectation-maximization algorithm, usually just EM. It is one of the oldest load-bearing ideas in statistical machine learning, and its two-step loop still sits inside pipelines that most practitioners never think about.
The loop
EM alternates between two steps until nothing improves.
The E-step (expectation) takes the model's current parameters as fixed and computes, for each observation, a probability-weighted guess at the hidden explanation behind it. Not a decision: a distribution. Under a two-cluster fit, a point near the boundary gets a 60/40 responsibility split between the clusters rather than a hard assignment.
The M-step (maximization) takes those guesses as if they were the truth and re-estimates the parameters to best explain them. Each cluster center moves toward the points that currently believe in it, weighted by how strongly they do.
Then the loop repeats with the new parameters. The guesses change, the fit changes, and in 1977 Arthur Dempster, Nan Laird and Donald Rubin proved that this never goes backwards: every full iteration increases (or holds) the likelihood of the observed data (Dempster, Laird and Rubin, 1977). That monotone guarantee, cheap per iteration and easy to implement, is why the algorithm survived decades of competitors.

Older than its name
The 1977 paper, presented to the Royal Statistical Society in December 1976, generalized and named a method that had "been proposed many times in special circumstances," as the authors themselves put it. The most consequential special case predates it: in the late 1960s and early 1970s Leonard Baum and colleagues at the Institute for Defense Analyses center for communications research in Princeton derived the EM updates for hidden Markov models, the procedure still called Baum-Welch (Wikipedia: Baum-Welch algorithm). Rolf Sundberg developed the theory for exponential families in parallel; the Dempster-Laird-Rubin paper unified it all, and at the discussion meeting Sundberg called the generalization brilliant (Wikipedia: Expectation-maximization algorithm).
Two coins
The cleanest way to feel what EM does is Jeff Bilmes's textbook example of two coins (Bilmes, 1998). Two coins of unknown bias are tossed repeatedly; each round, one coin is picked and flipped several times. You see every heads and tails. You never see which coin was used in which round.
Direct maximum likelihood is awkward here because the hidden coin choices are discrete and unknown: you would have to sum over every possible assignment history. EM sidesteps this. Start by guessing both coins are fair (or any other initial values). In the E-step, for each round, compute how likely each coin was to have produced that round's heads-tails mix. A round with eight heads out of ten now mostly "belongs" to whichever coin looks more head-heavy. In the M-step, estimate each coin's bias using only its weighted share of the tosses. Repeat.
The surprises come early. After one round of estimates the two biases often separate sharply: the coin that happens to look better gets all the good-looking rounds attributed to it, which makes it look even better. This self-reinforcing step is the engine of the whole method, and also its danger.
What it guarantees, and what it does not
The guarantee is weak but precious: observed-data likelihood cannot decrease across iterations. The algorithm climbs a hill.
The limits follow directly. EM converges to a local optimum, and different starting points can climb to different peaks, which is why Bilmes recommends running the algorithm many times from random initializations and keeping the best fit (Bilmes, 1998). Each iteration improves the fit only to the current guesses, so progress slows near the top, and the number of iterations needed depends on where you started. EM is also not a general optimizer for models with latent variables: later work, notably variational EM, had to relax the exact E-step to handle cases where the expectation is itself intractable (Jordan, Ghahramani, Jaakkola and Saul, 1999).
Where EM actually ran things
Three application families did the heavy lifting.
Clustering. Fitting a Gaussian mixture model with EM is the soft, probabilistic version of k-means; k-means itself is the special case that assigns each point to its nearest center with a hard 0-or-1 responsibility (Wikipedia: Expectation-maximization algorithm). Every "how many customers are there really" analysis that ends in a blob plot probably ran this loop.
Speech. Baum-Welch trained hidden Markov models on labeled audio, and HMM-based recognizers dominated speech technology from the 1980s into the deep-learning era (Wikipedia: Baum-Welch algorithm). The hidden phoneme sequence was the latent variable; the E-step computed forward-backward probabilities over it; the M-step refit the acoustic models.
Neural networks. Long before deep learning backpropagation swept the field, Geoffrey Hinton and Terrence Sejnowski showed in 1986 that learning in Boltzmann machines is itself a generalized EM procedure: estimate correlations under the current weights (E-step), then update the weights to match them (M-step) (Jordan and Jacobs, 1994).
EM in the LLM era

EM left the frontier of model training in the 2010s but never left the plumbing.
Self-training is EM wearing a different hat. The standard large-model recipe of generating pseudo-labels with the current model, then retraining on the labeled-plus-pseudo-label mix, is exactly the expectation-maximization alternation, and a 2023 paper formalized pseudo-labelling as the EM algorithm for semi-supervised learning (Xu et al., 2023). Bootstrapped reasoners that sample many solutions, keep the ones that pass a check, and fine-tune on survivors run the same guess-and-refit loop with a verifier standing in for the likelihood. Surveys of self-training describe the identical pseudo-label-and-refit structure (Amini et al., 2022).
Data curation keeps the classical version alive. SemDeDup, Meta's web-scale deduplication method, runs k-means, EM's hard cousin, over embeddings of the LAION-440M image-text corpus (up to 50,000 clusters) and then removes semantic duplicates only within clusters. Analyzing a subset of LAION, the authors showed the loop can drop half the data with minimal performance loss, effectively halving training time, and that it also improves deduplication of C4 text data (Abbas et al., 2023).
And one instructive non-use: today's mixture-of-experts layers, whose routers decide which expert processes each token, are not trained by EM. The sparsely gated MoE design that started the current wave trains the router end-to-end by gradient descent (Shazeer et al., 2017). The hidden label that EM would have had to guess, modern frameworks backpropagate through. When gradients reach everywhere, expectation-maximization retreats to the problems where it is still the right tool: discrete, intractable or missing explanations.
Takeaways
- EM is an alternating loop: guess the hidden labels as probabilities (E-step), refit the model on the guesses (M-step), repeat.
- Proven and named in 1977 by Dempster, Laird and Rubin; anticipated by Baum-Welch for hidden Markov models around 1970.
- It guarantees monotone likelihood improvement, but only to local optima, so initialization matters.
- It trained Gaussian mixtures, the speech-recognition HMMs of the 1980s-2000s, and Boltzmann machines.
- Its skeleton persists in current practice: pseudo-label self-training is EM by name in the 2023 literature, k-means loops curate foundation-model training data, while gradient-trained MoE routers show where EM was displaced.
Sources
- A. P. Dempster, N. M. Laird, D. B. Rubin, "Maximum Likelihood from Incomplete Data via the EM Algorithm," Journal of the Royal Statistical Society, Series B, 1977. https://academic.oup.com/jrsssb/article/39/1/1/7027539
- J. A. Bilmes, "A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models," ICSI TR-97-021, 1998. https://cs.brown.edu/courses/csci1820/spring-2022/resources/Bilmes_1998.pdf
- Wikipedia, "Expectation-maximization algorithm." https://en.wikipedia.org/wiki/Expectation%E2%80%93maximization_algorithm
- Wikipedia, "Baum-Welch algorithm." https://en.wikipedia.org/wiki/Baum%E2%80%93Welch_algorithm
- M. I. Jordan, R. A. Jacobs, "Learning from Incomplete Data," MIT AI Lab / DTIC ADA295618. https://apps.dtic.mil/sti/tr/pdf/ADA295618.pdf
- M. I. Jordan, Z. Ghahramani, T. Jaakkola, M. Saul, "An Introduction to Variational Methods for Probabilistic Inference," Machine Learning, 1999. https://www.cis.upenn.edu/~mkearns/papers/barbados/jgjs-var.pdf
- M. Xu et al., "Expectation Maximization Pseudo Labels," 2023. https://arxiv.org/abs/2305.01747
- M.-R. Amini et al., "Self-Training: A Survey," 2022. https://arxiv.org/abs/2202.12040
- A. Abbas et al., "SemDeDup: Data-efficient learning at web-scale through semantic deduplication," 2023. https://arxiv.org/abs/2303.09540
- N. Shazeer et al., "Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer," 2017. https://arxiv.org/abs/1701.06538
