Towards Making the Most of Context in Neural Machine Translation

Zaixiang Zheng, Xiang Yue, Shujian Huang, Jiajun Chen, Alexandra Birch

Introduction

Standard Neural Machine Translation (NMT) systems typically operate on a sentence-by-sentence basis, ignoring the surrounding document context. This limitation often results in "discourse errors," such as inconsistent terminology, incorrect verb tenses, or ambiguous pronoun references (e.g., mistranslating "it" because the antecedent appeared in a previous sentence).

Previous attempts to incorporate document-level context faced two primary hurdles: the "Deep Hybrid Problem," where mixing local and global information too early made models hypersensitive to noise, and "Incompatibility," where models required a fixed context window and failed when translating isolated sentences. This research introduces a unified NMT framework designed to balance local sentence precision with global document coherence.

Proposed Architecture

The authors propose a general-purpose architecture that treats local and global context as distinct but complementary forces.

The Context-Aware Encoder

The encoder follows a hierarchical approach to ensure the core meaning of the current sentence remains "pure" before integrating broader context:

  1. Local Encoding: The current sentence is first encoded independently using standard Transformer layers.
  2. Global Encoding: A specialized layer sits atop the local encoder, utilizing segment-level relative attention to observe other sentences in the document, weighted by their distance.
  3. Gated Context Fusion: A dynamic gating mechanism decides how much global information to integrate into the final representation, preventing distant noise from overwhelming the local meaning.

The Context-Aware Decoder

To maintain consistency in the translated text, the model adopts a Transformer-XL inspired architecture. It caches the hidden states of previously translated sentences, allowing the decoder to "remember" its own prior outputs while generating the next segment.

The proposed unified NMT framework featuring local and global encoding stages alongside an extended history context in the decoder.

Key Insights: "The More, The Better"

A significant finding of this work is that translation quality—measured by BLEU scores—continues to improve as the context window expands up to 20 sentences. This contradicts previous research suggesting that wider context windows inevitably deteriorate quality due to increased noise. By prioritizing local encoding and using gated fusion, the model successfully filters out irrelevant information while capturing long-range dependencies.

BLEU score improvements as the number of context sentences increases, demonstrating the model's ability to leverage long-range dependencies up to 20 sentences.

Results and Performance

The model was evaluated on several document-level datasets, including TED Talks (ZH-EN, EN-DE), News Commentary, and Europarl. Key results include:

  • Significant BLEU Gains: The model achieved improvements of up to 2.1 BLEU on TED ZH-EN and 2.5 BLEU on News datasets over standard Transformer baselines.
  • State-of-the-Art Benchmarks: It set new performance records for the TED ZH-EN and Europarl datasets, outperforming specialized architectures like Hierarchical Attention Networks (HAN).
  • Discourse Accuracy: Targeted tests showed marked improvements in resolving pronoun references (deixis) and maintaining lexical consistency.
  • Robustness: Unlike prior document-level models, this framework remains effective for single-sentence translation, as the global encoding can be dynamically disabled.

Limitations and Future Work

While effective, the model's complexity results in a slower training speed (approximately 0.22x the speed of a standard Transformer). Additionally, the scarcity of document-level parallel data remains a bottleneck. Future research may explore applying this local-global balance to other document-level tasks, such as automated summarization or multi-document reasoning.

Summary updated

BibTeX
@inproceedings{zheng2020towards,
  author = {Zaixiang Zheng and Xiang Yue and Shujian Huang and Jiajun Chen and Alexandra Birch},
  title = {{Towards Making the Most of Context in Neural Machine Translation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.24963/ijcai.2020/551},
}
Figure