Hint-Based Training for Non-Autoregressive Machine Translation

Zhuohan Li, Zi Lin, Di He, Fei Tian, Tao Qin, Liwei Wang, Tie-Yan Liu

Abstract: Due to the unparallelizable nature of the autoregressive factorization, AutoRegressive Translation (ART) models have to generate tokens sequentially during decoding and thus suffer from high inference latency. Non-AutoRegressive Translation (NART) models were proposed to reduce the inference time, but could only achieve inferior translation accuracy. In this paper, we proposed a novel approach to leveraging the hints from hidden states and word alignments to help the training of NART models. The results achieve significant improvement over previous NART models for the WMT14 En-De and De-En datasets and are even comparable to a strong LSTM-based ART baseline but one order of magnitude faster in inference.

Introduction

Modern neural machine translation systems, such as the standard Transformer, are primarily autoregressive (ART). They generate text sequentially, where each token's probability depends on all previously generated tokens. While this approach ensures high translation quality, it creates a significant computational bottleneck during inference because the process cannot be parallelized.

Non-Autoregressive Translation (NART) models aim to overcome this by generating the entire target sequence in parallel. However, NART models often struggle with two primary issues: incoherence/repetition (e.g., "thank thank you") and missing information. These failures occur because NART models lack the explicit dependency on previously generated tokens, leading to "blurry" attention and redundant hidden states. This paper introduces a "hint-based" training method to bridge the performance gap between ART and NART models without sacrificing inference speed.

Methodology: Leveraging Teacher Hints

The proposed framework uses a pre-trained ART model as a "teacher" to guide a NART "student" during training. Crucially, these hints are only used to calculate the loss function; the final NART model remains lightweight and fast for inference.

1. Hints from Hidden States ($\mathcal{L}_{hid}$)

A key observation in failing NART models is the "Similarity Trap": hidden states at different positions often have excessively high cosine similarity, leading to repetitive token generation. In contrast, ART models maintain distinct hidden states. The authors designed a penalty function that triggers when the student's hidden states are highly similar while the teacher's corresponding states are distinct.

Cosine similarity matrices of hidden states for ART Teacher, NART without hints, and NART with hints. Hints help the NART model avoid the 'similarity trap' that leads to token repetition.

2. Hints from Word Alignments ($\mathcal{L}_{align}$)

NART models often exhibit ambiguous encoder-decoder attention distributions, causing them to skip or misalign source words. To solve this, the authors use KL-divergence to force the student's attention maps to match the teacher's well-defined word alignments. This encourages the student to focus on the correct source words at each generation step.

Encoder-decoder attention maps (word alignments) for ART Teacher, NART without hints, and NART with hints. Hint-based training encourages sharper, more accurate alignments.

Experimental Results

The models were evaluated on the WMT14 English-German (En-De), WMT14 German-English (De-En), and IWSLT14 German-English (De-En) benchmarks.

  • Translation Quality: On WMT14 En-De, the hint-based NART achieved a BLEU score of 25.20 (with rescoring). This is a substantial improvement over previous NART baselines (which ranged from ~17.69 to 19.17) and is comparable to a strong LSTM-based ART baseline (24.60).
  • Inference Speed: The model achieved a 30.2x speedup over the Transformer teacher for single-sentence generation. Even when using a "rescoring" method to evaluate multiple length candidates, it maintained a 17.8x speedup.
  • Qualitative Improvement: Empirical analysis showed that the percentage of repetitive words dropped by over 20% compared to a baseline NART model without hints.

Discussion and Conclusion

The "aha moment" of this research was quantifying the relationship between repetitive tokens and hidden state cosine similarity. While ART models typically have 70% of hidden state similarities below 0.25, baseline NART models exhibit much higher values. By using implicit guidance rather than hard L2 regression (which can hurt performance due to architectural differences), the hint-based approach effectively penalizes the student only when it deviates into incoherent territory.

Despite these gains, a ~2 BLEU point gap remains between this NART model and state-of-the-art Transformer ART models. Future work may involve more sophisticated length prediction heuristics and the development of architectures specifically optimized for non-autoregressive generation rather than adapting existing ART structures.

Summary updated

BibTeX
@inproceedings{li2019hint,
  author = {Zhuohan Li and Zi Lin and Di He and Fei Tian and Tao Qin and Liwei Wang and Tie-Yan Liu},
  title = {{Hint-Based Training for Non-Autoregressive Machine Translation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  doi = {10.18653/v1/d19-1573},
}
Figure