[Paper Review] Improving Viterbi is Hard: Better Runtimes Imply Faster Clique Algorithms
This paper establishes conditional lower bounds for the Viterbi algorithm, proving that improving its runtime below O(Tn²) is as hard as breaking fundamental conjectures in graph algorithms—specifically, the All-Pairs Shortest Paths (APSP) and Min-Weight k-Clique conjectures. It further presents a novel algorithm achieving a 2^Ω(√log n) speedup when transition probabilities are few, demonstrating that progress is possible only under structural constraints on the HMM.
The classic algorithm of Viterbi computes the most likely path in a Hidden Markov Model (HMM) that results in a given sequence of observations. It runs in time $O(Tn^2)$ given a sequence of $T$ observations from a HMM with $n$ states. Despite significant interest in the problem and prolonged effort by different communities, no known algorithm achieves more than a polylogarithmic speedup. In this paper, we explain this difficulty by providing matching conditional lower bounds. We show that the Viterbi algorithm runtime is optimal up to subpolynomial factors even when the number of distinct observations is small. Our lower bounds are based on assumptions that the best known algorithms for the All-Pairs Shortest Paths problem (APSP) and for the Max-Weight $k$-Clique problem in edge-weighted graphs are essentially tight. Finally, using a recent algorithm by Green Larsen and Williams for online Boolean matrix-vector multiplication, we get a $2^{Ω(\sqrt {\log n})}$ speedup for the Viterbi algorithm when there are few distinct transition probabilities in the HMM.
Motivation & Objective
- To explain the longstanding difficulty in improving the Viterbi algorithm’s runtime beyond polylogarithmic factors.
- To establish that any polynomial speedup in Viterbi Path would imply breakthroughs in fundamental graph problems like APSP and Min-Weight k-Clique.
- To explore whether speedups are possible under structural constraints, particularly when the number of distinct transition probabilities is small.
- To provide a conditional lower bound for Viterbi Path even in the case of small alphabet size, using the k-Clique conjecture.
- To design a new algorithm that achieves a non-trivial speedup when transition probabilities are sparse, leveraging recent advances in matrix-vector multiplication.
Proposed method
- Reduces the All-Pairs Shortest Paths (APSP) problem to the Viterbi Path problem via encoding graph edge weights as HMM transition probabilities.
- Uses the k-Clique conjecture to derive lower bounds for Viterbi Path when the number of distinct observations is small, specifically for T = Θ(n^C) and alphabet size Θ(n^ε).
- Employs a reduction from the Min-Weight k-Clique problem to construct an HMM where the Viterbi path corresponds to a minimum-weight k-clique.
- Applies the recent algorithm by Green Larsen and Williams for online Boolean matrix-vector multiplication to achieve a 2^Ω(√log n) speedup in the sparse transition probability case.
- Uses the (min, +) matrix product framework to model repeated Viterbi steps, enabling exponentiation via repeated squaring for efficient computation.
- Leverages the fact that Viterbi Path can be expressed as a sequence of (min, +) matrix-vector products, and uses the best-known algorithms for (min, +) matrix multiplication to optimize the runtime.
Experimental results
Research questions
- RQ1Is it possible to achieve a polynomial speedup in the Viterbi algorithm’s runtime beyond polylogarithmic improvements?
- RQ2What are the conditional hardness assumptions that would rule out faster Viterbi algorithms?
- RQ3Can the Viterbi Path problem be solved faster when the number of distinct transition probabilities is small?
- RQ4How does the hardness of Viterbi Path relate to fundamental problems like APSP and k-Clique?
- RQ5What is the best possible runtime improvement for Viterbi Path under structural constraints on the HMM?
Key findings
- The Viterbi Path problem cannot be solved in time O(Tn²)^{1−ε} for any ε > 0 unless the APSP conjecture is false, establishing a conditional lower bound.
- For HMMs with T = Θ(n^C) observations and alphabet size Θ(n^ε), the Viterbi Path problem requires Ω(Tn²)^{1−o(1)} time assuming the k-Clique conjecture for k = ⌈C/ε⌉ + 2.
- A 2^Ω(√log n) speedup is achievable for the Viterbi algorithm when the number of distinct transition probabilities is small, using advanced matrix-vector multiplication techniques.
- The Viterbi Path problem is APSP-hard even in the unary alphabet case (σ = 1), provided T ≤ n, under the APSP conjecture.
- The Shortest Walk problem is also APSP-hard under the same conditions, and this is used to prove the hardness of Viterbi Path in the unary alphabet regime.
- The Viterbi Path problem lies in NTIME((Tn²)^{1−α}) ∩ coNTIME((Tn²)^{1−α}) for some α > 0, suggesting that any faster algorithm would require non-trivial derandomization or complexity-theoretic breakthroughs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.