Abstract
The basic concept in Neural Machine Translation (NMT) is to train a large Neural Network that maximizes the translation performance on a given parallel corpus. NMT is then using a simple left-to-right beam-search decoder to generate new translations that approximately maximize the trained conditional probability. The current beam search strategy generates the target sentence word by word from left-to-right while keeping a fixed amount of active candidates at each time step. First, this simple search is less adaptive as it also expands candidates whose scores are much worse than the current best. Secondly, it does not expand hypotheses if they are not within the best scoring candidates, even if their scores are close to the best one. The latter one can be avoided by increasing the beam size until no performance improvement can be observed. While you can reach better performance, this has the drawback of a slower decoding speed. In this paper, we concentrate on speeding up the decoder by applying a more flexible beam search strategy whose candidate size may vary at each time step depending on the candidate scores. We speed up the original decoder by up to 43% for the two language pairs German-English and Chinese-English without losing any translation quality.
Introduction
Standard Neural Machine Translation (NMT) models typically employ a fixed-width beam search to generate translations. This heuristic explores the most likely word sequences from left to right, maintaining a constant number of active hypotheses at each step. However, this approach is inherently inefficient. It often wastes computational resources on "dead weight"—candidates with scores significantly lower than the current leader—while simultaneously failing to explore promising alternatives that fall just outside the fixed beam.
As shown in Figure 1, increasing the beam size initially improves translation quality (measured by BLEU), but the gains quickly plateau while the computational cost (average fan out) continues to rise linearly. This paper proposes "elastic" beam search strategies that adaptively prune the search space based on candidate scores, optimizing the trade-off between speed and quality.
Adaptive Pruning Strategies
The authors introduce four pruning schemes designed to make the decoding process more flexible:
- Relative Threshold Pruning ($rp$): Discards any candidate whose score is less than a specific percentage of the current best candidate's score.
- Absolute Threshold Pruning ($ap$): Eliminates candidates with scores more than a fixed value below the best score.
- Relative Local Threshold Pruning ($rpl$): Focuses on the probability of the last generated word rather than the cumulative sentence score, preventing low-quality local choices from being propagated.
- Maximum Candidates per Node ($mc$): Limits the number of children a single hypothesis can contribute to the next step. This encourages diversity by preventing a single strong prefix from dominating the beam with minor variations.
Experimental Evaluation
The strategies were evaluated on two major translation tasks:
- German → English: Trained on WMT 2016 (3.9M sentences) and tested on
newstest2014andnewstest2015. - Chinese → English: Trained on 11M sentences from the BOLT project and tested on NIST MT08.
The models utilized standard GRU-based architectures with attention. For the German-English task, Byte Pair Encoding (BPE) was used to manage large vocabularies.
Results and Discussion
The experimental results demonstrate that adaptive pruning can significantly reduce decoding time without compromising translation quality.
As detailed in the results for German-English translation (Figure 3), the combined pruning strategies achieved a 43% speedup for a beam size of 14, with no drop in BLEU score. For the Chinese-English task, a 24% speedup was observed at the same beam size. Even with smaller beams (size 5), a 13% speedup was achievable.
A key insight is that a significant portion of a standard beam is "dead weight." By applying pruning, the average number of candidates tracked per step (fan out) is reduced while maintaining performance. Interestingly, while the $mc$ strategy increased hypothesis diversity, it did not lead to higher BLEU scores, suggesting that standard automated metrics may not fully capture the benefits of diversity.
Conclusion
This work demonstrates that fixed-width beam search is a sub-optimal strategy for NMT decoding. By implementing flexible pruning thresholds, decoders can achieve substantial speedups—up to 43%—without losing translation quality. While these results were established on RNN-based architectures, the principle of adaptive search remains highly relevant for modern Transformer-based models. Future research could explore whether increased beam diversity benefits human-centric evaluations or downstream re-ranking tasks.
Summary updated