[Paper Review] Viterbi Algorithm Generalized for n-Tape Best-Path Search
This paper generalizes the Viterbi algorithm to efficiently compute the minimum- or maximum-weight path in an n-tape weighted finite-state machine (n-WFSM) that accepts a given n-tuple of input strings. By extending the dynamic programming approach of the Viterbi algorithm to handle multiple input strings simultaneously, the method achieves a worst-case time complexity of O(|s|ⁿ|E|log|s|ⁿ|Q|), which is more efficient than the standard intersection-and-shortest-path alternative, offering a significant performance improvement for n-ary transduction tasks.
We present a generalization of the Viterbi algorithm for identifying the path with minimal (resp. maximal) weight in a n-tape weighted finite-state machine (n-WFSM), that accepts a given n-tuple of input strings (s_1,... s_n). It also allows us to compile the best transduction of a given input n-tuple by a weighted (n+m)-WFSM (transducer) with n input and m output tapes. Our algorithm has a worst-case time complexity of O(|s|^n |E| log (|s|^n |Q|)), where n and |s| are the number and average length of the strings in the n-tuple, and |Q| and |E| the number of states and transitions in the n-WFSM, respectively. A straight forward alternative, consisting in intersection followed by classical shortest-distance search, operates in O(|s|^n (|E|+|Q|) log (|s|^n |Q|)) time.
Motivation & Objective
- To address the problem of finding the optimal (minimal or maximal weight) path in an n-tape weighted finite-state machine (n-WFSM) that accepts a given n-tuple of input strings.
- To enable efficient compilation of the best transduction for a given input n-tuple by a (n+m)-tape weighted transducer, where n inputs and m outputs are processed simultaneously.
- To overcome the high computational cost of the standard approach involving intersection with a single-path n-WFSM followed by classical shortest-path algorithms.
- To generalize the classical Viterbi algorithm—originally designed for single-input sequences in HMMs—to handle n-tuples of input strings in n-WFSMs.
Proposed method
- Extends the Viterbi algorithm’s dynamic programming framework to maintain a state set representing all possible combinations of positions across the n input strings.
- At each step, computes the best (minimal or maximal weight) path to each state by considering all incoming transitions from previous states, using a priority queue (Fibonacci heap) to efficiently select the best predecessor.
- Maintains a data structure analogous to a trellis, where each node corresponds to a state and a position tuple (i₁, ..., iₙ) across the n input strings, with the path weight accumulated via semiring operations.
- Uses a priority queue to manage active states and transitions, ensuring that only the best path to each state-position combination is retained at each stage, reducing redundant computation.
- Applies the algorithm to the n-WFSM directly, avoiding the need to first construct an intersection automaton with a single-path input machine.
- Employs a logarithmic factor in the complexity due to priority queue operations, which is optimized via Fibonacci heaps to achieve the stated time bound.
Experimental results
Research questions
- RQ1Can the Viterbi algorithm be generalized to efficiently find the best path in an n-WFSM that accepts a given n-tuple of input strings, rather than a single input string?
- RQ2What is the time complexity of such a generalized algorithm compared to the standard intersection-and-shortest-path approach?
- RQ3Does the proposed method outperform the classical alternative in practice, especially for multi-tape transduction tasks?
- RQ4How does the algorithm’s performance scale with the number of input tapes and the length of input strings?
Key findings
- The proposed generalized Viterbi algorithm achieves a worst-case time complexity of O(|s|ⁿ|E|log|s|ⁿ|Q|), which is asymptotically better than the standard intersection-and-Dijkstra approach, which runs in O(|s|ⁿ(|E|+|Q|)log|s|ⁿ|Q|).
- The algorithm avoids the expensive construction of an intersection automaton by directly propagating best paths across the n-tape structure, reducing both time and space overhead.
- Empirical results on word pair alignment (n=2) show a time complexity slightly higher than O(|s|²), confirming the theoretical scaling behavior and validating the practical efficiency of the approach.
- The method enables efficient best-path transduction in (n+m)-tape weighted transducers by identifying the optimal path on the n input tapes and extracting the corresponding m-tape output.
- The use of a Fibonacci heap in the priority queue management ensures logarithmic time operations, contributing to the optimal asymptotic complexity.
- The algorithm is applicable to any rational n-ary relation encoded as an n-WFSM, making it broadly useful in natural language processing, morphological analysis, and database-like string relation processing.
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.