Multi-Task Learning with Shared Encoder for Non-Autoregressive Machine Translation

Yongchang Hao, Shilin He, Wenxiang Jiao, Zhaopeng Tu, Michael R. Lyu, Xing Wang

Abstract

Non-Autoregressive Translation (NAT) models significantly improve inference speed in Neural Machine Translation (NMT) but often at the cost of translation quality compared to Autoregressive (AT) models. This paper investigates the linguistic properties captured by NAT and AT encoders, finding they possess complementary strengths. We propose MULTI-TASK NAT, a framework that utilizes a shared encoder with an auxiliary AT decoder during training. By employing an "importance annealing" schedule that shifts focus from the AT task to the NAT task, the model learns superior representations. Experimental results on WMT benchmarks show significant BLEU score improvements without increasing inference latency.

Introduction

Neural Machine Translation typically relies on Autoregressive (AT) models, which generate tokens sequentially. While accurate, this process is slow. Non-Autoregressive Translation (NAT) models generate tokens in parallel, offering massive speedups but suffering from lower quality due to the "multimodality problem"—the lack of dependencies between target tokens.

The common approach to bridge this gap is Knowledge Distillation (KD), where an NAT model mimics an AT teacher. However, a performance gap remains. This research explores whether the encoders of NAT and AT models learn different linguistic features and if a multi-task learning approach can leverage these differences to improve NAT performance.

Methodology: Multi-Task NAT

The authors introduce a multi-task learning framework designed to enhance the NAT encoder's representational power without adding inference overhead.

Architecture

The framework consists of three main components:

  1. Shared Encoder: A single encoder processes the source sentence for both tasks.
  2. NAT Decoder: The primary decoder used for non-autoregressive generation.
  3. Auxiliary AT Decoder: A secondary decoder used only during training to provide a stronger training signal.
Figure 1: The Multi-Task NAT architecture featuring a shared encoder and dual decoders.

Importance Annealing

A critical innovation is the Importance Annealing (IA) schedule. The total training loss is a weighted sum: $\mathcal{L} = \lambda \mathcal{L}_{nat} + (1 - \lambda) \mathcal{L}_{at}$. Rather than using a fixed weight, $\lambda$ starts low (favoring the easier-to-learn AT task) and linearly increases to 1.0 by the end of training. This "curriculum learning" approach ensures the encoder first masters deep semantic representations before specializing for the NAT objective. At inference time, the AT decoder is discarded, resulting in zero additional computational cost.

Experimental Setup

The proposed method was evaluated on standard benchmarks:

  • WMT14: English-German (En-De)
  • WMT16: English-Romanian (En-Ro)
  • WMT19 & WMT20: Large-scale En-De datasets to test scalability.

Probing tasks were also conducted to analyze the linguistic properties captured by the encoders, focusing on surface (e.g., sentence length), syntactic (e.g., tree depth), and semantic (e.g., tense) features.

Results and Analysis

The Multi-Task NAT approach consistently outperformed baseline NAT models across all tested datasets.

Translation Quality

On the WMT14 En-De task, the Multi-Task NAT (with IA) improved the Mask-Predict baseline by 0.80 BLEU points. Similar gains were observed in the En-Ro pair and on larger datasets, demonstrating the robustness of the approach.

Figure 5: Performance comparison of Multi-Task NAT against various baseline models on WMT14 and WMT16 benchmarks.

Encoder Probing

Probing experiments revealed that standalone NAT encoders are proficient at "surface" features like predicting sentence length—a necessity for NAT models. Conversely, AT encoders excel at "semantic" features. The shared encoder in the Multi-Task setup successfully combined these strengths, outperforming both standalone versions on nearly every metric.

Conclusion

This work demonstrates that NAT and AT encoders learn complementary linguistic information. By sharing an encoder and using an auxiliary AT task with importance annealing, NAT models can achieve significantly higher translation quality. While training time increases due to the dual-decoder setup, the inference speed remains unchanged, making it a practical solution for high-performance, low-latency machine translation. Future work may explore dynamic decoding strategies and deeper interactions between the two decoders during training.

Summary updated

BibTeX
@inproceedings{hao2021multi,
  author = {Yongchang Hao and Shilin He and Wenxiang Jiao and Zhaopeng Tu and Michael R. Lyu and Xing Wang},
  title = {{Multi-Task Learning with Shared Encoder for Non-Autoregressive Machine Translation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.313},
}
Figure