Part IV · Ch. 20 — HMM (Hidden Markov Model)

draft

Probabilistic · Sequences · Markov chain + emissions. Models sequences with latent states that emit observations. Card: ../02-types-of-ai/03-probabilistic.kmd.

🎨 Figure F-IV.20.0States that hide. Brief: chain of hidden states (circles) linked over time, each emitting an observation (squares); Viterbi path highlighted.

HMM — hidden states

1. Definition and short history

Models a Markov process whose states are not observed directly. Dominated speech recognition and bioinformatics before deep learning (see Part III, era 4).

2. Foundations

  • Stochastic processes — Markov chains.
  • Probability — likelihood, marginalization.
  • Statistics — maximum likelihood estimation (EM).

3. Algorithms and architectures

  • Forward-backward — probability of the observations.
  • Viterbi — most likely state sequence.
  • Baum-Welch (EM) — learns parameters without state labels.

4. Inputs

  • Hardware: CPU; lightweight.
  • Data: sequences (audio, DNA, text).
  • Data structures: transition/emission matrices, trellis.
  • Systems: hmmlearn, HTK (speech legacy).

5. Specialized lifecycle

Stage Specialization
0 Problem Sequence with latent structure (phonemes, genes)
1 Data Sequences; (partially) labeled
2 EDA Transition statistics, state durations
3 Modeling Number of states, topology, emission distributions
4 Training Baum-Welch (EM)
5 Evaluation Likelihood, decoding accuracy
5.5 Acceptance Robustness, generalization
6 Production Decoding (Viterbi) in real time
7 Monitoring Sequence drift
8 Retraining Re-estimate
9 Governance As per domain

6. Capabilities, modes and modalities

Sequential/temporal: speech (legacy), PoS-tagging, bioinformatics (gene alignment), gesture recognition; interpretable and cheap.

7. Limits, risks and ethics

Markov assumption (short memory); simple emissions; surpassed by neural networks on complex tasks, but still useful in bioinformatics and low-data scenarios.

8. State of the art and examples

Bioinformatics (profile HMMs, alignment), low-resource niches; the concept of a sequential latent state echoes in the modern SSMs (ch. 13).