Hard but Robust, Easy but Sensitive: How Encoder and Decoder Perform in Neural Machine Translation

Tianyu He, Xu Tan, Tao QinarXiv 2019

Introduction

Neural Machine Translation (NMT) typically employs symmetric encoder-decoder architectures, such as the Transformer, assuming both components share equal responsibility. However, this paper reveals a fundamental asymmetry: the encoder performs a difficult but robust task of representation extraction, while the decoder performs an easier but highly sensitive task of sequence generation. This sensitivity stems from the decoder's heavy reliance on the strong conditional information provided by preceding tokens.

Methodology

The researchers conducted an extensive empirical study using the Transformer model across standard benchmarks, including IWSLT14 (De ↔ En, Ro ↔ En) and WMT17 (Zh ↔ En). They isolated component behavior through:

  1. Layer Variation: Comparing performance gains from increasing encoder vs. decoder depth.
  2. Convergence Analysis: Measuring training time for one component while the other is frozen.
  3. Noise Injection: Introducing random dropping, noising, and swapping to inputs during inference.
  4. Context Ablation: Systematically removing preceding tokens to measure the locality of decoder dependence.

Key Insights: The Asymmetry of NMT

The Encoder as the "Heavy Lifter"

The encoder's task—extracting abstract meaning from raw source sentences—is inherently harder. It requires more layers to achieve significant performance gains and takes longer to converge during training. Despite this difficulty, the encoder is remarkably robust; it maintains relatively stable performance even when the source input is degraded.

The Decoder as a "Sensitive Localist"

Conversely, the decoder's task is "easier" because it leverages preceding tokens as a "cheat sheet." This reliance allows for faster convergence but creates extreme sensitivity. The decoder is a "localist": its accuracy depends heavily on the immediate preceding tokens. Dropping a token just one position back causes a massive performance drop, whereas tokens further back have minimal impact.

Experimental Results

Depth Gains and Architectural Efficiency

Experimental results demonstrate that the encoder benefits significantly more from increased depth than the decoder. For instance, increasing the encoder depth from 2 to 6 layers (while keeping the decoder at 2) yields substantially higher BLEU gains than increasing the decoder depth from 2 to 6 layers.

Performance gains (ΔBLEU) relative to a 2-2 layer baseline, showing that increasing encoder depth (left side) yields higher gains than increasing decoder depth (right side).

The Robustness Gap

The disparity in robustness is most evident under noise. When 20% of tokens are dropped, the encoder’s performance decreases by approximately 5-10 BLEU points. In contrast, the decoder’s performance can plummet by 15-25 BLEU points under similar conditions. This trend holds across various noise types, including random noising and swapping.

Comparison of model sensitivity to noise (dropping, noising, swapping) applied to the encoder (dashed) vs. the decoder (solid).

Conclusion

This research challenges the standard practice of symmetric NMT design. By recognizing that the encoder performs a "hard-robust" task and the decoder an "easy-sensitive" one, researchers can design more efficient models—specifically, deep-encoder/shallow-decoder architectures. Future work should explore if these dynamics persist in other sequence-to-sequence tasks like summarization or image captioning.

Summary updated

Abstract

Neural machine translation (NMT) typically adopts the encoder-decoder framework. A good understanding of the characteristics and functionalities of the encoder and decoder can help to explain the pros and cons of the framework, and design better models for NMT. In this work, we conduct an empirical study on the encoder and the decoder in NMT, taking Transformer as an example. We find that 1) the decoder handles an easier task than the encoder in NMT, 2) the decoder is more sensitive to the input noise than the encoder, and 3) the preceding words/tokens in the decoder provide strong conditional information, which accounts for the two observations above. We hope those observations can shed light on the characteristics of the encoder and decoder and inspire future research on NMT.
BibTeX
@misc{he2019hard,
  author = {Tianyu He and Xu Tan and Tao Qin},
  title = {{Hard but Robust, Easy but Sensitive: How Encoder and Decoder Perform in Neural Machine Translation}},
  year = {2019},
  eprint = {1908.06259},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.06259},
}
Figure