Enriching Non-Autoregressive Transformer with Syntactic and SemanticStructures for Neural Machine Translation

Ye Liu, Yao Wan, Jian-Guo Zhang, Wenting Zhao, Philip S. Yu

TL;DR

This paper introduces SNAT, a non-autoregressive neural machine translation model that significantly speeds up translation by generating all target tokens in parallel. SNAT achieves this by incorporating explicit syntactic (POS tags) and semantic (NER tags) information into the translation process, addressing a key limitation of previous non-autoregressive models.

What Problem Does This Paper Address?

Neural Machine Translation (NMT) models have revolutionized translation, but autoregressive models, which generate tokens sequentially, are slow during inference. Non-autoregressive (NAR) models aim to speed this up by generating all target tokens in parallel. However, this parallel generation comes at the cost of translation quality, often resulting in repetitive or incoherent phrases and missing important semantic information. This is because NAR models struggle to capture the inherent dependencies and structures within a sentence, a problem that existing NAR models haven't fully solved.

Methods

The core innovation of SNAT is the integration of syntactic and semantic information into the NAR Transformer architecture.

  • Syntactic and Semantic Labeling: The model uses Part-Of-Speech (POS) tags and Named Entity Recognition (NER) labels as explicit structural information. These labels are extracted from the source sentence during pre-processing.
  • Structure-Aware Input: The SNAT model takes both the word embeddings and these structural label embeddings as input to its encoder. This allows the model to "see" the grammatical and semantic roles of words.
  • Structure-Aware Mapping: During decoding, instead of simply copying source tokens, SNAT uses a more sophisticated mapping that considers informative words (identified by POS and NER tags) from the source sentence. This mapping is adapted based on the relative lengths of source and target sentences.
  • Intermediate Alignment Regularization: To further improve the learning of long-term dependencies, SNAT incorporates an alignment mechanism. This aligns intermediate decoder layers with the target sentence, forcing the model to consider coarse target information earlier in the generation process, thus mitigating the issue of independent token generation.

Datasets

The paper evaluates SNAT on two standard benchmark datasets for machine translation:

  • WMT14 En-De: A large dataset for English-to-German translation (approximately 4.5 million sentence pairs).
  • WMT16 En-Ro: A dataset for English-to-Romanian translation (approximately 610,000 sentence pairs).

The data was processed using the Moses script and subword units via byte-pair encoding, consistent with previous publications.

Key Insights and Ideas

  • Structure is Key for NAR: The paper strongly argues that syntactic and semantic structures are not just helpful but critical for improving the performance of non-autoregressive NMT models. Ignoring them leads to the inherent limitations of NAR models.
  • POS and NER as Powerful Signals: POS tags help capture syntactic structure, preventing repetitive words, while NER tags highlight important entities, ensuring semantic coherence. Combining them provides a richer understanding of the sentence.
  • Intermediate Alignment Bridges the Gap: The intermediate alignment regularization is a clever way to inject target-side information into the decoder without relying on complex external models or significantly increasing parameters. This helps the model learn dependencies that are lost in purely parallel generation.
  • Speed-Accuracy Trade-off is Manageable: SNAT demonstrates that it's possible to achieve significant speedups in NMT without a substantial drop in translation quality, challenging the notion that NAR models are inherently inferior in accuracy.

Key Results

  • Improved Translation Quality: SNAT achieves BLEU scores comparable to, and in some cases better than, state-of-the-art autoregressive Transformer models on the WMT14 En-De and WMT16 En-Ro tasks. For example, on WMT14 En-De, SNAT achieved a BLEU score of 27.50, comparable to the Transformer's 27.48.
  • Significant Speedup: SNAT offers a substantial decoding speedup, achieving up to a 9.3x speedup compared to the standard Transformer model while maintaining high translation quality. This is a major advantage for real-time applications.
  • Outperforms Other NAR Models: SNAT significantly outperforms existing state-of-the-art non-autoregressive models, showing notable gains in BLEU scores (e.g., +8.33 over NAT on WMT14 En-De).
  • Robustness to Sentence Length: SNAT shows more stable performance across different sentence lengths compared to vanilla NAT models, indicating better handling of long-term dependencies.

Limitations and Future Work

  • Rescoring Benefits: The paper notes that rescoring with multiple candidates (e.g., 9 or 19 candidates) further improves SNAT's performance, suggesting that while SNAT is efficient, there's still room for improvement through more sophisticated decoding strategies.
  • Label Mismatch Penalty: The model uses a "label mismatch penalty" (epsilon, denoted by €) which is tuned empirically. Finding optimal values for this penalty across different language pairs could be a direction for future work.
  • Intermediate Alignment Layer Choice: The paper explores using different intermediate decoder layers (Z2 and Z3) for alignment, finding that Z3 provides a slightly better improvement. Further investigation into the optimal layer or combination of layers for alignment could be beneficial.
  • Generalizability: While tested on En-De and En-Ro, future work could explore the effectiveness of SNAT on a wider range of language pairs, especially those with significantly different syntactic structures.

Summary updated

Abstract

The non-autoregressive models have boosted the efficiency of neural machine translation through parallelized decoding at the cost of effectiveness when comparing with the autoregressive counterparts. In this paper, we claim that the syntactic and semantic structures among natural language are critical for non-autoregressive machine translation and can further improve the performance. However, these structures are rarely considered in the existing non-autoregressive models. Inspired by this intuition, we propose to incorporate the explicit syntactic and semantic structures of languages into a non-autoregressive Transformer, for the task of neural machine translation. Moreover, we also consider the intermediate latent alignment within target sentences to better learn the long-term token dependencies. Experimental results on two real-world datasets (i.e., WMT14 En-De and WMT16 En-Ro) show that our model achieves a significantly faster speed, as well as keeps the translation quality when compared with several state-of-the-art non-autoregressive models.
BibTeX
@inproceedings{liu2021enriching,
  author = {Ye Liu and Yao Wan and Jian-Guo Zhang and Wenting Zhao and Philip S. Yu},
  title = {{Enriching Non-Autoregressive Transformer with Syntactic and SemanticStructures for Neural Machine Translation}},
  booktitle = {EACL},
  year = {2021},
  doi = {10.18653/v1/2021.eacl-main.105},
}
Figure