Ground Truth.
AI, checked against the source.

Learn · Intermediate

Hidden Markov models: inferring a changing state from noisy observations

A hidden Markov model is a probabilistic model of a sequence whose underlying states are unobserved but produce visible, noisy signals. It combines rules for how the state changes with rules for what each state is likely to emit. That separation lets a system infer a hidden process from observations instead of pretending that each observation is a complete description of reality.

Imagine a machine that can be healthy, worn, or failing. You cannot inspect its internal condition continuously, but you hear sounds and read temperature measurements. A hot reading does not prove failure: a healthy machine under load can also get hot. The model uses both the current evidence and the plausibility of moving between conditions to estimate what is happening.

Three ingredients define a basic hidden Markov model. The initial-state distribution says where a sequence is likely to begin. Transition probabilities say how likely each next state is given the current state. Emission probabilities say how likely an observation is in a particular state. Those probabilities describe the model’s assumptions, not directly measured certainty about the real machine.

The Markov assumption says that the next state depends on the current state rather than the entire earlier state history. A second assumption says the current observation depends on the current hidden state rather than the full sequence. These restrictions make inference manageable. They are also limits: if a machine’s failure risk depends on accumulated wear, a state description that omits wear may be inadequate.

A useful analogy is tracking a person behind a frosted window. Their location is hidden; blurred shapes are observations. You combine how a person could move between moments with how each location would appear through the glass. A single ambiguous shape becomes more informative when combined with earlier and later evidence. The model is maintaining plausible explanations, not simply classifying each image independently.

Lawrence Rabiner’s 1989 tutorial organizes the subject around three questions: how likely an observation sequence is, which hidden-state sequence best explains it, and how to estimate the model’s parameters. Those questions recur in speech recognition, biological sequence analysis, and monitoring even when later systems use different architectures.

For likelihood and filtering, the forward algorithm carries a distribution over possible current states. At each step it predicts the next-state distribution using transitions, then weights the possibilities using the new observation’s emission likelihood. Normalization turns those weights into a posterior distribution. This is Bayesian updating repeated through time, with a dynamics model supplying the prior for each step.

Filtering uses evidence available so far. Smoothing additionally uses later observations to revise beliefs about earlier states. A noise followed by a clear failure can change the interpretation of what the earlier noise meant. That distinction matters operationally: a retrospective analysis can use tomorrow’s evidence, but a live controller cannot. Evaluations should not quietly compare the two as though they had the same information.

Viterbi decoding answers a different question: which complete state path has the highest probability? It uses dynamic programming to retain the best predecessor for each candidate state, then reconstructs a path. Selecting the most likely state independently at every time is not generally equivalent. Those individual choices may fail to form the most probable path, or may even violate transition constraints.

The algorithms avoid explicitly enumerating every possible path. With a dense transition table and K states, a standard pass over T observations takes work proportional to T times K squared. Sparse allowed transitions can reduce that work. Probability products can become numerically tiny, so implementations use rescaling or log-domain calculations.

When states are unlabeled, Baum–Welch learning uses the forward-backward procedure to estimate expected state occupancies and transition counts, then updates the parameters. It is a specific application of expectation-maximization. The method can reach a local optimum, and a learned state need not match a human’s intended category without additional constraints or evidence.

The model should also be distinguished from modern neural state-space models. Both use hidden state over a sequence, but a classical hidden Markov model usually maintains a probability distribution over discrete states with explicit transition and emission probabilities. A neural running-state architecture does not automatically provide that interpretation or the same inference algorithms.

Today’s Rollback paper makes hidden-state reasoning relevant without being a classical hidden Markov model. Its cached world-model state supports imagined action branches; the underlying machinery and objective are different. The enduring lesson is to separate observed signals, inferred state, and assumptions about dynamics. A realistic observation does not by itself prove that the hidden process has been recovered correctly.

Key papers
Lawrence Rabiner, A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition (1989)

Key questions

What is hidden in a hidden Markov model?

The underlying state sequence is hidden; the model observes signals generated by those states and infers which states plausibly produced them.

How is the forward algorithm different from Viterbi decoding?

The forward algorithm sums over possible state paths, while Viterbi decoding finds the single highest-probability complete path.

Does a hidden Markov model learn without state labels?

It can estimate parameters from observation sequences with Baum–Welch, an expectation-maximization method, but initialization and model assumptions affect the result.
Cite this

APA

Ground Truth. (2026, October 28). Hidden Markov models: inferring a changing state from noisy observations. Ground Truth. https://groundtruth.day/learn/hidden-markov-models-latent-sequence-inference.html

BibTeX

@misc{groundtruth:hidden-markov-models-latent-sequence-inference,
  title  = {Hidden Markov models: inferring a changing state from noisy observations},
  author = {{Ground Truth}},
  year   = {2026},
  month  = {oct},
  url    = {https://groundtruth.day/learn/hidden-markov-models-latent-sequence-inference.html}
}

Topics: fundamentals · sequence-models · probability · hidden-markov-models · inference