Hint-Based Training for Non-Autoregressive Machine Translation

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

Introduction

Neural Machine Translation (NMT) has seen significant advances with the advent of Transformer architectures. However, these models are typically autoregressive (ART), meaning they generate tokens sequentially. Each new word depends on the entire previously generated sequence, creating a computational bottleneck that prevents parallelization during inference.

Non-Autoregressive Translation (NART) models aim to solve this by generating all output tokens simultaneously. While this offers massive speedups, it often comes at the cost of translation quality, specifically leading to issues like word repetition and poor alignment with the source text. This paper introduces a "hint-based" training method to bridge this performance gap by leveraging the internal knowledge of a pre-trained ART "teacher" model.

The Challenge of Non-Autoregressive Translation

The primary difficulty in NART is the removal of the word-to-word dependency. Without the context of what has already been written, different output positions often "guess" the same word, leading to incoherent repetitions (e.g., "the the the"). Furthermore, NART models frequently fail to correctly map source tokens to target positions, resulting in missing information.

Attention map of a NART model without hints, showing poor alignment and repetitive outputs.

As seen in Figure 5, a standard NART model without guidance often produces blurred attention maps and repetitive phrases, struggling to maintain the structural integrity of the translation. This incoherence is a direct result of the model's inability to coordinate across different output positions.

Proposed Method: Hint-Based Training

To address these issues without sacrificing inference speed, the authors introduce a teacher-student framework. A standard Transformer (ART) acts as a teacher, providing "hints" to a NART student during the training phase. To ensure a fair comparison, both the teacher and student models utilize the standard Transformer architecture as their base. These hints are incorporated into the loss function through two main components:

1. Hints from Hidden States ($L_{hid}$)

The authors observed that repetitive outputs in NART models are strongly correlated with high cosine similarity between hidden states at different positions. To counter this, they designed a penalty function that triggers when the student’s hidden states are excessively similar in contexts where the teacher’s states are distinct. This implicit guidance encourages the student to learn more discriminative representations for different output positions.

2. Hints from Word Alignments ($L_{align}$)

To resolve alignment issues, the student is trained to mimic the teacher's encoder-decoder attention distributions. By minimizing the KL-divergence between the teacher’s and student’s attention maps, the student learns the "gold standard" of which source parts to focus on for each target token.

Importantly, these hints are only utilized during training. At inference time, the NART model operates independently, preserving its inherent speed advantage.

Key Insights: The Similarity Trap

A central contribution of this work is the quantification of the "similarity trap." In a high-quality ART model, approximately 70% of the cosine similarities between hidden states are below 0.25. In contrast, standard NART models exhibit "hot spots" of high similarity that directly correspond to repetitive word generation.

Comparison of hidden state cosine similarities between the ART teacher, NART without hints, and NART with hints.

Figure 3 illustrates this phenomenon. While the NART model without hints (b) shows large blocks of high similarity (yellow/green regions), the model trained with hints (c) much more closely resembles the sparse similarity matrix of the ART teacher (a). This demonstrates that the $L_{hid}$ loss effectively forces the model to distinguish between different output positions, breaking the similarity trap.

Results and Performance

The proposed method was evaluated on several benchmarks, including WMT14 English-to-German (En-De) and IWSLT14 German-to-English (De-En).

  • Quality: The hint-based NART achieved a BLEU score of 25.20 on WMT14 En-De, significantly outperforming previous NART baselines (e.g., 19.17 for Fertility-based NART) and approaching the performance of strong LSTM-based autoregressive models (24.60).
  • Speed: The model achieved a 30.2x speedup over the Transformer ART baseline during raw inference. Even when using a rescoring method to improve quality further, it maintained a 17.8x speed advantage.
  • Redundancy Reduction: The hint-based training reduced the percentage of repetitive words in the output from 8.3% to 6.5%, a relative reduction of over 20%.

Conclusion

Hint-based training provides a powerful mechanism for improving NART models by transferring structural and relational knowledge from autoregressive teachers. By addressing the "similarity trap" and improving word alignment through training-time hints, the authors achieve a compelling balance between translation quality and inference efficiency. Future work may involve developing architectures specifically optimized for non-autoregressive generation rather than adapting existing Transformer blocks.

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