How does the Baum–Welch algorithm (EM for an HMM) derive its updates for the transition probabilities and emission probabilities ?
Probabilistic models, Hidden Markov models
Level L3 Intermediate. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can write the expected complete-data log-likelihood, define and , and maximise under the sum-to-one constraints.
Key idea
E-step: compute and . M-step: and .
Steps
- The complete-data log-likelihood is .
- Taking the expectation over given and the old parameters gives .
- The E-step quantities come from the forward and backward variables: and .
- For row of , maximise subject to . The Lagrangian derivative gives , so .
- Normalise: . It is the expected number of transitions divided by the expected number of visits to .
- In the same way, and .
- Iterate E and M steps. The likelihood never decreases, but the algorithm can reach a local maximum, so use several initialisations.
Common mistakes
- Summing to . There is no transition out of the last step.
- Using hard (Viterbi) counts. Baum–Welch uses expected counts.
- Initialising all rows of and identically, which keeps the states symmetric and the EM stuck.
How long your answer should be
A page. About 6–8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Probabilistic models: A binary chain has unary factors , , , and both pairwise factors are if and otherwise. Use max-product to find the MAP assignment and its unnormalised value. How does this relate to the Viterbi algorithm?
Next in Probabilistic models: For the linear-Gaussian model with , and with , how do you derive the Kalman filter predict and update equations from the conditioning rule for Gaussians?