Introduction
Sequential decoding is a cornerstone of Natural Language Processing (NLP), powering tasks such as Named Entity Recognition (NER), Part-of-Speech (POS) tagging, and supertagging. The classic Viterbi algorithm, while effective, faces a significant computational bottleneck as the label space ($L$) grows, with a time complexity of $O(TL^2)$. In modern joint tagging tasks where $L$ can exceed several thousand, this quadratic dependency makes real-time decoding nearly impossible.
Furthermore, many downstream systems require the $k$-best sequences to maintain high recall. While optimizations exist for 1-best decoding, finding the top $k$ sequences has remained prohibitively slow. This paper introduces the $k$-best Iterative Viterbi A* algorithm, an exact decoding method that combines coarse-to-fine lattice expansion with A* search and aggressive pruning to achieve order-of-magnitude speedups.
Methodology: Iterative Lattice Expansion
The core innovation lies in treating decoding as a pathfinding problem on a dynamic lattice. Instead of searching the full label space immediately, the algorithm employs a coarse-to-fine strategy. Unlikely labels are grouped into a single "degenerate" label, creating a much smaller coarse lattice for the initial search.
If the optimal path in the coarse lattice passes through a degenerate label, that label is "expanded" into its constituent active labels, and the search is repeated. This iterative refinement ensures that the algorithm only explores the high-probability regions of the full state space.
A* Search and Aggressive Pruning
To further accelerate the search, the authors integrate A* search using heuristics derived from backward Viterbi passes on the coarse lattices. A critical component for $k$-best decoding is the use of a fast beam search to establish a tight initial lower bound ($lb$).
As shown in the pruning algorithm, any node $y_i$ where the combined forward and backward scores ($\alpha(y_i) + \beta(y_i)$) fall below the lower bound is discarded. This drastically reduces the number of edges the algorithm must evaluate in subsequent iterations.
Experimental Results
The algorithm was evaluated across five diverse datasets, including Penn TreeBank (POS), CoNLL (Joint tagging), and HPSG supertagging ($L=2602$).
Key performance highlights for 5-best decoding include:
- HPSG Supertagging: Achieved a 360x speedup over standard Viterbi A* (36 sentences/sec vs. 0.1).
- CoNLL 2003 ($L=443$): Achieved a 7x speedup (295 sentences/sec vs. 40).
- Search Query NER: Achieved a 3x speedup (1,025 sentences/sec vs. 357).
Discussion and Insights
Unlike approximate methods like beam search, the Iterative Viterbi A* is exact, guaranteeing the true optimal $k$-best sequences. The authors demonstrate that accounting for edge (transition) scores in A* heuristics is vital; ignoring them leads to poor pruning and slower performance.
However, the algorithm does face diminishing returns as $k$ increases. For very large $k$ (e.g., $k > 90$), the top paths eventually cover most of the lattice, causing the overhead of iterative expansion to outweigh the benefits of pruning. Despite this, for the small $k$ values typically used in production, this approach effectively removes the decoding bottleneck for large-scale sequence models.
Summary updated