AI GLOSSARY · AI CONCEPTS
Hidden Markov model (HMM)
Definition
A hidden Markov model (HMM) is a Markov model in which the observations depend on a latent, hidden Markov process. The hidden states cannot be observed directly, so they are inferred from the observations.
Also called: HMM, HMM model, hidden Markov models, HMM machine learning.
In plain language
A hidden Markov model describes a system whose states you cannot see directly but whose effects you can. The hmmlearn tutorial calls it a generative probabilistic model in which a sequence of observed variables is generated by a sequence of internal hidden states. NLTK describes HMMs as largely used to assign the correct label sequence to sequential data.
Technical definition
In the hmmlearn description, transitions between hidden states form a first-order Markov chain, specified by a start probability vector and a transition probability matrix, and the emission probability of an observable is conditioned on the current hidden state. NLTK lists the parts of an HMM as the output observation alphabet, the set of states, the transition probabilities, the output probability matrix and the initial state distribution. Hmmlearn names three problems: estimating the optimal hidden state sequence (Viterbi algorithm), calculating the model likelihood (Forward-Backward algorithm) and estimating the parameters (Baum-Welch, an EM algorithm).
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Skill by Skill Almanac · Illustrative, not executed
split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- Checks train, validation and test files for duplicates, shared groups, time and label leakage; prints JSON.
- Why it exercises the concept
- Checks train, validation and test files for duplicates, shared groups, time and label leakage.
How it shows up when you use agents
HMMs appear in code through libraries such as NLTK, whose nltk.tag.hmm module provides an HMM tagger for labelling sequence data, and hmmlearn, which implements Hidden Markov Models with several emission types. Jurafsky and Martin describe an HMM as relating observed events, such as words, to hidden states, such as part-of-speech tags. NLTK also uses part-of-speech tagging as a worked natural language processing application.
NLTK states that training an HMM requires either MLE estimates of the parameters or unsupervised learning using the Baum-Welch algorithm, a variant of EM. NLTK's trainer offers both supervised (MLE) and unsupervised (Baum-Welch) learning. For the broader family, see machine learning.
Worked example: observations do not reveal the state
In this hypothetical two-state HMM, the initial probabilities of hidden states A and B are 0.6 and 0.4. The probabilities of observing a beep are 0.1 in A and 0.8 in B. The probability of the first observation being a beep is therefore 0.6 × 0.1 + 0.4 × 0.8 = 0.38. Seeing a beep does not identify a state with certainty: under these assumptions, the probability of B given that beep is 0.32 / 0.38, about 0.842.
Now let the transition probabilities be A→A 0.7, A→B 0.3, B→A 0.2 and B→B 0.8. The likelihood of observing two beeps is the sum over all four hidden paths, 0.2298. The most probable individual path is B→B, with joint probability 0.2048. Summing paths to evaluate observations and finding the best hidden path are different tasks. These are hand calculations for chosen parameters, not a trained model or a measured application result.
Common confusions
- Hidden Markov model versus Markov chain. NLTK describes the HMM as an extension of the Markov chain: in a Markov chain each state corresponds deterministically to a given event, while in an HMM the observation is a probabilistic function of the state.
- Viterbi versus Baum-Welch. Per hmmlearn, given the model parameters and observed data, the Viterbi algorithm addresses the problem of finding the optimal sequence of hidden states. Given just the observed data, Baum-Welch estimates the model parameters.
- Myth: HMMs are just for speech. NLTK and Jurafsky and Martin use part-of-speech tagging: observations are words and hidden states are grammatical tags.
Related terms
More in AI concepts
Sources
- nltk.tag.hmm module, NLTK (accessed 2026-11-24)
- Tutorial, hmmlearn documentation (accessed 2026-11-24)
- Speech and Language Processing, appendix A: Hidden Markov Models, Jurafsky and Martin (Stanford-hosted textbook draft) (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude and Codex (automated drafting); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .
Change log (5)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : First version.
- : Verifier pass: cut unsourced claims.
- : Stage-3 accuracy pass: replaced Stanford and unsourced claims with NLTK, hmmlearn and Wikipedia statements; dropped the RNN comparison, umbrella analogy and two off-topic examples.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.