[Paper Review] Attention-based Vocabulary Selection for NMT Decoding
This paper proposes a novel method for learning target vocabulary candidate lists directly from attention weights during NMT training, eliminating reliance on external tools like phrase tables or word aligners. By accumulating attention weights into a sparse alignment matrix and selecting top candidates per source word, the approach achieves up to 7x decoding speedup with no drop in translation quality on two language pairs, using only 100 candidates per word.
Neural Machine Translation (NMT) models usually use large target vocabulary sizes to capture most of the words in the target language. The vocabulary size is a big factor when decoding new sentences as the final softmax layer normalizes over all possible target words. To address this problem, it is widely common to restrict the target vocabulary with candidate lists based on the source sentence. Usually, the candidate lists are a combination of external word-to-word aligner, phrase table entries or most frequent words. In this work, we propose a simple and yet novel approach to learn candidate lists directly from the attention layer during NMT training. The candidate lists are highly optimized for the current NMT model and do not need any external computation of the candidate pool. We show significant decoding speedup compared with using the entire vocabulary, without losing any translation quality for two language pairs.
Motivation & Objective
- To address the high computational cost of full-vocabulary softmax during NMT decoding.
- To eliminate dependency on external tools such as phrase tables or word aligners for candidate list generation.
- To improve decoding efficiency by learning model-specific, dynamic candidate lists from attention mechanisms.
- To explore whether attention-based candidate selection can match or exceed performance of traditional, externally computed candidate pools.
- To enable dynamic vocabulary selection during training using attention-derived alignments.
Proposed method
- The method accumulates normalized attention weights across training steps into a sparse alignment matrix, tracking source-to-target word alignments implicitly learned by the model.
- For each source word, the top-n target words with the highest accumulated attention weights are selected as candidates, forming a dynamic candidate list.
- The candidate list is updated periodically—either per epoch or per mini-batch—using normalized alignment counts to avoid stale probabilities.
- During decoding, the softmax is restricted to only these learned candidate words, significantly reducing computation time.
- The approach uses a threshold (α_thr = 0.1) to filter weak alignments and focuses on high-confidence attention patterns.
- The method is applied during both training and inference, with candidate lists adapted to the model’s current parameters.
Experimental results
Research questions
- RQ1Can attention weights alone be used to learn effective, model-specific candidate lists for NMT decoding?
- RQ2Does attention-based candidate selection outperform or match traditional methods relying on external tools like phrase tables or word alignments?
- RQ3What is the optimal number of candidates per source word to maintain translation quality while maximizing decoding speed?
- RQ4Can dynamic vocabulary selection during training improve efficiency without compromising model performance?
- RQ5How does the threshold for attention weight accumulation (α_thr) affect the trade-off between speed and accuracy?
Key findings
- The proposed method achieves up to a 7x speedup in decoding compared to using the full target vocabulary, with no loss in BLEU or TER scores.
- Using only 100 top candidates per source word yields near-identical translation quality to the full vocabulary, with BLEU scores of 29.6 on the English-to-Italian task.
- The method outperforms or matches traditional candidate selection techniques that rely on external resources like phrase tables or Viterbi alignments.
- Candidate lists trained from attention weights are more adaptive and less likely to miss high-scoring words than those derived from static alignments.
- The approach is robust across language pairs, showing consistent speedups without performance degradation on both English-to-German and English-to-Italian translation tasks.
- The use of dynamic vocabulary selection during training—based on accumulated attention weights—can be effective and avoids reliance on external tools.
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.