Back to Classic ML Mind Map
中文·English
📊 Classic MLID: hmm-evaluation

HMM Forward Algorithm (Evaluation)

HMM 前向算法 (评估)
🎯Core Definition
The evaluation problem asks for the observation probability P(Oλ)P(O \mid \lambda) given HMM parameters λ=(A,B,π)\lambda = (A, B, \pi) and an observation sequence O=o1o2oTO = o_1 o_2 \dots o_T. Summing over state sequences requires NTN^T paths, which is intractable; the forward algorithm defines forward variables αt(j)=P(o1ot,qt=jλ)\alpha_t(j) = P(o_1 \dots o_t, q_t = j \mid \lambda) — the joint probability of being in state jj at time tt after emitting o1oto_1 \dots o_t — and recurses
📌Overview
αt(j)=[iαt1(i)aij]bj(ot),\alpha_t(j) = \Bigl[\sum_{i} \alpha_{t-1}(i)\, a_{ij}\Bigr] b_j(o_t),
📌Overview
initialized with α1(j)=πjbj(o1)\alpha_1(j) = \pi_j b_j(o_1) and terminating at P(Oλ)=jαT(j)P(O \mid \lambda) = \sum_j \alpha_T(j). Each step sums NN transitions for each of NN states, reducing the cost from O(NT)O(N^T) path enumeration to O(N2T)O(N^2 T).
💡Use Cases
scoring sequences in speech recognition and bio-sequence analysis, and as the E-step machinery of Baum-Welch; interviews often ask for the forward-variable definition and how forward differs from Viterbi (sum vs max).
Key Problems Solved
direct summation over hidden states is exponential, and the forward algorithm caches subproblems to make likelihood computation polynomial; the cost is an O(N2)O(N^2) transition sum per step and O(NT)O(NT) storage (rollable to O(N)O(N)).
🎯5 High-Frequency Exam Points
1
Write the forward recursion αt(j)=[iαt1(i)aij]bj(ot)\alpha_t(j) = [\sum_i \alpha_{t-1}(i)a_{ij}]b_j(o_t) with its initialization α1(j)\alpha_1(j) and termination P(Oλ)P(O \mid \lambda)?
2
Why is naive computation of P(Oλ)P(O \mid \lambda) exponential in O(NT)O(N^T), and how does the forward algorithm reduce it to O(N2T)O(N^2T)?
3
How do the forward algorithm and Viterbi differ (sum vs max, and what each outputs)?
4
What is the probabilistic meaning of αt(j)\alpha_t(j), and how does it combine with the backward variable βt(j)\beta_t(j) to give P(qt=jO,λ)P(q_t = j \mid O, \lambda)?
5
Compute P(Oλ)P(O \mid \lambda) by hand for a concrete HMM (e.g. N=2N=2, T=3T=3), showing each forward step?
📖 In-depth Guide:📄 probabilistic-models
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "HMM Forward Algorithm (Evaluation)"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardNaive BayesNext CardViterbi Decoding

🔗 More Classic ML Knowledge Cards

AdaBoost DerivationBagging & Random ForestBaum-Welch (HMM EM)GBDT Negative Gradient