Pretrained Language Models for Document-Level Neural Machine Translation

Liangyou Li, Xin Jiang, Qun LiuarXiv 2019

Abstract

Document-level Neural Machine Translation (NMT) aims to improve translation coherence by incorporating surrounding context. However, standard models often struggle with large contexts, leading to performance degradation. This paper introduces a method to successfully integrate up to 512 words of context by initializing a Transformer encoder with pretrained BERT, applying novel context manipulation techniques (segment embeddings, reversed position embeddings, and context masks), and employing multi-task learning. Experimental results on IWSLT datasets show significant BLEU score improvements over previous state-of-the-art methods.

Introduction

Standard NMT systems typically translate documents sentence-by-sentence, ignoring the broader context. While document-level models attempt to incorporate surrounding sentences to resolve ambiguities like pronoun reference, they often face a "context wall": adding more than a few sentences of context typically degrades translation quality. Large contexts introduce irrelevant information that can overwhelm the decoder and destabilize training. This research addresses how to effectively utilize large contexts (up to 512 words) without compromising model performance.

Methodology

The authors utilize a standard Transformer architecture with three critical modifications designed for long-context handling:

  1. BERT Initialization: The encoder is initialized with pretrained BERT models. This leverages abundant monolingual data to provide a strong foundation for understanding long-range dependencies, bypassing the need for scarce document-level parallel corpora.
  2. Context Manipulation: To ensure the source sentence remains the focus, three architectural adjustments are made:
  3. Segment Embeddings: These distinguish context tokens from source tokens.
  4. Reversed Position Embeddings: By assigning position 0 to the source sentence and counting backwards for context, the source sentence's positional representation remains stable regardless of context length.
  5. Context Masks: The decoder is masked from attending directly to the context, forcing it to rely on the context-aware representations generated by the encoder.
  6. Multi-task Training: A Masked Language Modeling (MLM) objective is added during training to prevent overfitting on smaller document-level datasets.
Architecture of the proposed document-level NMT model featuring context manipulation techniques.

Experimental Setup

Experiments were conducted on IWSLT datasets (TED talks) for Chinese–English (Zh-En), French–English (Fr-En), and Spanish–English (Es-En). Each dataset contains approximately 0.2 million sentence pairs. The models were evaluated using BLEU scores on standard test sets (tst2010-2013 for Zh-En).

Results and Analysis

The proposed system significantly outperformed previous state-of-the-art document-level NMT systems across all tested language pairs.

Comparison of the proposed method against previous state-of-the-art document-level NMT systems.

Ablation studies highlighted several key findings:

  • Pretraining is Essential: Without BERT initialization, simply adding large context caused the baseline model to diverge or perform poorly.
  • Position Stability: Reversed Position Embeddings were crucial for stabilizing learning by anchoring the main sentence's position.
  • Incremental Gains: While BERT provided an initial boost (~1.04 BLEU in Zh-En), the combination of context manipulation and increased encoder depth (12 layers) with MLM provided the final performance edge.

Conclusion

This work demonstrates that monolingual pretraining via BERT, combined with targeted architectural manipulations, allows NMT models to effectively harness large-scale document context. By stabilizing positional embeddings and masking the decoder's direct access to context, the model successfully integrates up to 512 tokens of information, setting new benchmarks for document-level translation.

Summary updated

BibTeX
@misc{li2019pretrained,
  author = {Liangyou Li and Xin Jiang and Qun Liu},
  title = {{Pretrained Language Models for Document-Level Neural Machine Translation}},
  year = {2019},
  eprint = {1911.03110},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.03110},
}
Figure