Study Vault Search notes, aliases and full text
Graph
ConceptDBISAI-written · not yet proofread

Hidden Markov Model

Also HMM

A probabilistic model of a sequence in which hidden states form a Markov chain (each state depends only on its predecessor) and each hidden state emits one observable, given by initial, transition and emission probabilities.

Formula#

The factorization follows from two independence assumptions (Conditional Probability, Statistical Independence):

  1. Markov property: hih_i depends only on hi−1h_{i-1}, not on earlier states or observations. The hidden states form a bigram model (N-Gram Model with n=2n = 2) over HH.
  2. Output independence: oio_i depends only on hih_i.

With an END state. For POS-Tagging a special hidden state END is appended after the last position, with learned transition probabilities Pr⁡(END∣h)\Pr(\text{END} \mid h). The likelihood gets the extra factor Pr⁡(END∣hn)\Pr(\text{END} \mid h_n), which encodes which states are likely at the end of a sequence (exam WS 19/20, Task 5.4).

Decoding. Given o1,…,ono_1, \dots, o_n, the most likely hidden sequence is

arg⁡max⁡h1,…,hnPr⁡(h1,…,hn,o1,…,on),\arg\max_{h_1, \dots, h_n} \Pr(h_1, \dots, h_n, o_1, \dots, o_n),

which the Viterbi Algorithm computes in O(n⋅∣H∣2)O(n \cdot |H|^2) instead of trying all ∣H∣n|H|^n sequences. Maximizing the joint probability is the same as maximizing Pr⁡(h1,…,hn∣o1,…,on)\Pr(h_1, \dots, h_n \mid o_1, \dots, o_n), because Pr⁡(o1,…,on)\Pr(o_1, \dots, o_n) does not depend on the hih_i.

Training for POS tagging on a tagged corpus by relative frequencies: Pr⁡(t′∣t)=#(t t′)/#(t)\Pr(t' \mid t) = \#(t\,t') / \#(t) (tag t′t' follows tag tt), Pr⁡(w∣t)=#(w tagged t)/#(t)\Pr(w \mid t) = \#(w \text{ tagged } t) / \#(t), Pr⁡(t)=\Pr(t) = fraction of sentences that start with tt.

Properties#

  • Posterior of a single state. Pr⁡(hi=h∣o1,…,on)=∑sequences with hi=hPr⁡(h,o) / ∑all sequencesPr⁡(h,o)\Pr(h_i = h \mid o_1, \dots, o_n) = \sum_{\text{sequences with } h_i = h} \Pr(h, o) \,/\, \sum_{\text{all sequences}} \Pr(h, o). For short sequences this is a direct sum over all ∣H∣n|H|^n hidden sequences (exam WS 17/18, Task 6.1).
  • Zero probabilities are decisive. If an observable can only be emitted by one state (emission probability 00 for all others), every positive-probability sequence must use that state at that position. This can determine the most likely sequence without any computation (exam WS 17/18, Task 6.2).
  • Brute force over all ∣H∣n|H|^n sequences with the likelihood formula is correct but exponential in nn (exam WS 17/18, Task 6.4).

Example#

Sources#

  • Not covered by a WS 25/26 lecture. Source: the former Information Retrieval exams.
  • Exam WS 17/18, Task 6 (not published) (posterior, decoding by argument, likelihood, brute force)
  • Exam WS 18/19, Task 6.3 (not published) (weather/mood HMM, greedy vs. Viterbi)
  • Exam WS 19/20, Task 5.4 (not published) (END tag)

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only