Hidden Markov Model
- Definition
- A Hidden Markov Model (HMM) is like a Markov chain but with a twist: you can't see the true underlying states directly. Instead, you see noisy observations that depend on those hidden states. HMMs combine a state-transition model (how states evolve) with an observation model (how states produce outputs) and use algorithms to infer the most likely hidden states. HMMs are useful for sequence problems where the true cause is latent, e.g., speech recognition. They differ from plain Markov chains by requiring inference over unobserved variables.

How does it work?
Hidden Markov Model algorithms typically represent uncertainty explicitly and use probability calculations to combine data and model assumptions. Implementations focus on numerical stability, how to represent distributions (parametric vs sampled), and efficient updates when new data arrive.
Examples
- Speech recognition — Model phoneme sequences and noisy acoustic observations to decode spoken words in ASR systems.
- Part-of-speech tagging — Infer POS tags for words in sentences by modelling tag transitions and word emissions.
- User activity modelling — Infer latent user states from clickstreams to personalise recommendations or detect churn.
Problems
- Choosing the right number of hidden states without overfitting
- Local optima during Baum-Welch/EM training
- Slow inference (Viterbi/forward-backward) on long sequences
- Poor performance when observations don't fit the emission distribution assumed
- Label/state interpretability once the model is trained