A binary chain has unary factors , , , and both pairwise factors are if and otherwise. Use max-product to find the MAP assignment and its unnormalised value. How does this relate to the Viterbi algorithm?
Probabilistic models, Belief propagation
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can replace sums by maxima in message passing and recover the argmax by backtracking.
Key idea
Max-product uses . The MAP value is the maximum of the final product, and the argmaxes are recorded to trace back.
Steps
- Message from to : for , (at ). For , (at ).
- Message from to : for , (at ). For , (at ).
- Max-marginal at : . So the best is 0 and the MAP value is 36.
- Backtrack: with the stored argmaxes give and . MAP assignment .
- Check by direct product: .
- Relation to Viterbi: Viterbi is max-product on the chain of an HMM, with and back-pointers. In practice we use logs, so max-product becomes max-sum.
Common mistakes
- Taking each variable's marginal argmax instead of the MAP. These can differ, because marginals add over the other variables.
- Forgetting to store the argmax, so you cannot recover the assignment.
- Normalising the max-marginals and reading them as probabilities. They are only scores.
How long your answer should be
Half a page.
Last checked on 4 December 2026.
Read this
Previous in Probabilistic models: Three binary variables form a chain with unary factors , , (for values 0 and 1), and the same pairwise factor on both edges, if and otherwise. Using sum-product messages, what are and ?
Next in Probabilistic models: How does the Baum–Welch algorithm (EM for an HMM) derive its updates for the transition probabilities and emission probabilities ?