Enriching Non-Autoregressive Transformer with Syntactic and Semantic Structures 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 Transformer (NAT) model for machine translation that significantly improves translation quality by incorporating explicit syntactic (POS tags) and semantic (NER tags) structures from the source sentence. SNAT achieves comparable or better translation quality than autoregressive models while drastically reducing inference time, addressing the speed-accuracy trade-off inherent in NAT models.

What Problem Does This Paper Address?

Neural Machine Translation (NMT) models have seen tremendous progress, but a key challenge lies in the trade-off between translation speed and quality. Autoregressive (AR) models, which generate translations token by token, achieve high quality but are slow due to their sequential nature. Non-Autoregressive (NAT) models, on the other hand, generate all target tokens in parallel, leading to significant speedups. However, this parallel generation often comes at the cost of translation quality, particularly in handling syntactic and semantic coherence, leading to issues like repetitive words or missing important information. Existing NAT models have attempted to mitigate this through various techniques like iterative refinement or different loss functions, but they often struggle with the inherent "multimodality issue" – the difficulty of modeling the diverse ways a target sentence can be formed from a source. This paper argues that explicit syntactic and semantic structures are crucial for NAT models to overcome these limitations and improve translation quality without sacrificing speed.

Methods

The core innovation of SNAT is the integration of syntactic and semantic structure information into the NAT framework.

  • Syntactic and Semantic Labeling: The model utilizes 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. For example, POS tags help capture sentence structure to avoid repetitive words, while NER tags help identify important named entities.
  • Structure-Aware Input: SNAT takes both the original word embeddings and the embeddings of these extracted POS and NER labels as input to the encoder. This allows the model to "see" the structural properties of the source sentence.
  • Structure-Aware Mapping for Decoder Input: Instead of simply copying source tokens, SNAT employs a more sophisticated method to construct the decoder input. It selectively copies informative words (based on POS and NER tags) from the source and pairs them with their corresponding structural labels. This ensures that the decoder receives richer, structure-informed input.
  • Intermediate Alignment Regularization: To further improve the learning of dependencies within the target sentence, SNAT introduces an intermediate alignment regularization. This technique aligns the outputs of intermediate decoder layers with the target sequence, encouraging the model to learn coarse target-side information earlier in the decoding process. This is a novel approach compared to previous methods that might align encoder inputs or rely solely on the final decoder output.

The overall architecture is based on the Transformer, with modifications to incorporate these structural elements and the alignment mechanism.

Datasets

The paper evaluates SNAT on two standard, real-world machine translation datasets:

  • WMT14 En→De: A large dataset for English-to-German translation.
  • WMT16 En→Ro: A dataset for English-to-Romanian translation.

The authors also mention using processed data consistent with previous publications, indicating adherence to established benchmarks in the field.

Key Insights and Ideas

  • Syntactic and Semantic Structures are Key for NAT: The paper strongly demonstrates that explicit structural information (POS and NER tags) is not just helpful but critical for NAT models to achieve high translation quality. This directly addresses the "multimodality issue" by providing a more constrained and informative context for parallel generation.
  • Structure-Aware Input is More Than Just Copying: The method of constructing decoder inputs by selectively copying informative words and their labels, rather than just a direct copy of source tokens, proves to be a significant improvement. This suggests that NAT models benefit from a more curated and semantically/syntactically guided input.
  • Intermediate Alignment is Crucial for Dependency Learning: The proposed intermediate alignment regularization is shown to be effective in helping the decoder learn dependencies, which is a known weakness of NAT models. Aligning at intermediate layers, rather than just at the input, seems to provide a more robust signal.
  • Speed-Accuracy Trade-off is Solvable: SNAT effectively bridges the gap between the speed of NAT models and the quality of AR models, suggesting that the inherent limitations of NAT are not insurmountable.

Key Results

  • Translation Quality: SNAT achieves results comparable to state-of-the-art autoregressive Transformer models on WMT14 En→De and WMT16 En→Ro. For instance, on WMT14 En→De, SNAT achieved a BLEU score of 27.50, very close to the Transformer's 27.48. On WMT16 En→Ro, SNAT achieved 35.19, outperforming the Transformer.
  • NAT Performance Boost: SNAT significantly outperforms existing NAT models. On WMT14 En→De, SNAT achieved a substantial BLEU score boost of +8.33 over the baseline NAT model and competitive gains over other advanced NAT variants.
  • Decoding Speed: SNAT offers a significant speedup. The paper reports a 9.3x decoding speedup compared to the Transformer model, while maintaining or improving translation quality. This is a key advantage for real-time applications.
  • Ablation Studies:
    • Incorporating POS information alone boosted performance by +1.37 BLEU, and NER alone by +1.25 BLEU on WMT14 En→De.
  • Intermediate alignment at the third decoder layer (Z³) provided the largest improvement (+1.46 BLEU).
  • SNAT shows more stable performance across different sentence lengths compared to vanilla NAT, which degrades significantly with longer sentences.

Limitations and Future Work

  • Rescoring: While SNAT achieves good performance, the paper notes that rescoring candidates (generating multiple translations and selecting the best one) further improves performance, albeit at a computational cost. The best SNAT model with rescoring 19 candidates achieved a BLEU score of 35.19 on WMT14 En→De.
  • Sentence Length Handling: While SNAT is more robust than vanilla NAT for longer sentences, the paper doesn't explicitly state if it fully matches AR models in this regard. Future work could focus on further improving long-sentence translation.
  • Generalizability of Structure: The paper focuses on POS and NER. Future work could explore other linguistic structures (e.g., dependency parsing, semantic role labeling) to further enrich the model.
  • Intermediate Alignment Layer Choice: The paper found that aligning at the third decoder layer yielded the best results. Further investigation into the optimal layer or method for intermediate alignment could be beneficial.

Summary updated

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 Semantic Structures for Neural Machine Translation}},
  booktitle = {EACL},
  year = {2021},
  doi = {10.18653/v1/2021.eacl-main.105},
}
Figure