Hidden Markov Models (HMMs) are probabilistic models designed for sequential data, especially when the information we want to understand cannot be observed directly. Instead, we observe some outputs and use them to infer the hidden states behind those outputs.
The Stanford Speech and Language Processing chapter by Daniel Jurafsky and James H. Martin presents HMMs as an extension of Markov chains and explains their importance in areas such as Natural Language Processing and sequence labeling. The current Stanford draft also covers the Forward-Backward algorithm for learning HMM parameters.
Download the PDF for free:
https://web.stanford.edu/~jurafsky/slp3/A.pdf
What Is a Markov Chain?
A Markov chain models a sequence of states where the next state depends mainly on the current state.
For example:
Today's Weather → Tomorrow's Weather
The Markov assumption says that the past influences the future through the current state.
What Makes an HMM Different?
In a normal Markov chain, we can observe the states directly.
In an HMM, the states are hidden.
For example:
Hidden State: Weather
Observation: Number of ice creams eaten
We cannot directly observe the weather, but we can use ice-cream consumption as evidence about the weather.
This is the classic example used in the Stanford chapter.
Basic HMM Structure
An HMM contains three major components:
1. Hidden States
These represent the conditions we want to infer.
Example:
Hot → Cold → Hot
2. Transition Probabilities
These describe the probability of moving from one state to another.
Hot → Hot = 0.6
Hot → Cold = 0.4
3. Emission Probabilities
These describe how likely an observation is given a particular hidden state.
For example:
P(3 ice creams | Hot) = 0.4
The Stanford chapter formally defines an HMM using the state set, transition matrix, observation/emission probabilities, and initial-state distribution.
The Ice-Cream Example
Imagine that we only have Jason's diary showing how many ice creams he ate each day:
3 → 1 → 3
We want to determine the hidden weather states.
The model might contain:
Hidden States
- Hot
- Cold
Observations
- 1 ice cream
- 2 ice creams
- 3 ice creams
The goal becomes:
Ice-Cream Observations → HMM → Most Likely Weather
This example is used in the Stanford material to explain HMM inference.
Three Fundamental HMM Problems
The Stanford chapter describes three major problems for HMMs.
1. Likelihood
Given an HMM and observations, determine:
How probable is this observation sequence?
For example:
3 → 1 → 3
How likely is this sequence under our model?
The Forward Algorithm is used for efficient likelihood computation.
2. Decoding
Given observations, determine the most likely hidden-state sequence.
For example:
Observations
3 → 1 → 3
↓
Most Likely States
Hot → Cold → Hot
The Viterbi Algorithm is commonly used for this task.
3. Learning
Sometimes the transition and emission probabilities are unknown.
The model must learn them from observed data.
The Forward-Backward algorithm, closely related to Expectation-Maximization, can be used for HMM parameter learning.
HMMs in Natural Language Processing
One important application is Part-of-Speech (POS) tagging.
Consider:
The cat runs
The words are visible, but their grammatical categories can be treated as hidden states:
The → Determiner
cat → Noun
runs → Verb
The HMM uses relationships between tags and words to infer the most likely sequence of grammatical tags. The Stanford text specifically introduces HMMs in the context of POS tagging.
HMMs and Sequence Data
HMMs are useful whenever observations occur in a sequence and hidden conditions influence those observations.
Applications include:
- Part-of-speech tagging
- Speech recognition
- Biological sequence analysis
- Activity recognition
- Time-series modeling
- Pattern recognition
HMM vs Modern Deep Learning
HMMs are traditional probabilistic models, while models such as RNNs, LSTMs, and Transformers use neural networks.
However, HMMs remain valuable because they clearly demonstrate fundamental ideas such as:
States → Probabilities → Observations → Inference
They are also useful for understanding the foundations of probabilistic sequence modeling.
Download the PDF for free:
https://web.stanford.edu/~jurafsky/slp3/A.pdf
Final Verdict
Hidden Markov Models provide a powerful way to reason about situations where the state of a system is hidden but its effects can be observed.
The complete idea can be summarized as:
Hidden States
↓
Transition Probabilities
↓
Observable Events
↓
Inference

0 Comments:
Post a Comment