Exploiting Cross-Sentence Context for Neural Machine Translation

Longyue Wang, Zhaopeng Tu, Andy Way, Qun Liu

Abstract

Standard Neural Machine Translation (NMT) models often suffer from "tunnel vision," translating sentences in isolation and losing document-level coherence. This paper introduces a hierarchical RNN framework that captures context from previous sentences and integrates it into the NMT process. By employing a novel gating mechanism to selectively weight global history, the proposed model achieves significantly more consistent and accurate translations, yielding improvements of up to +2.1 BLEU points over state-of-the-art baselines.

The Problem of Sentence-Level NMT

Most NMT systems operate on a sentence-by-sentence basis. While effective for short, independent snippets, this approach fails at the document level for two main reasons:

  1. Ambiguity: A word might have multiple meanings that can only be clarified by looking at previous sentences.
  2. Inconsistency: A specific term might be translated differently across a document, leading to a disjointed and confusing output.

The authors argue that "intra-sentence" context (the words within the current sentence) is insufficient for high-quality translation. To translate like a human, models require "cross-sentence" or global context.

Methodology

The authors propose a two-step approach: Summarization and Integration.

1. Summarizing Global Context

To capture document history, the researchers utilize a Hierarchical Recurrent Neural Network (HRED). This architecture consists of two levels:

  • Sentence RNN: A lower-level RNN encodes each of the previous $K$ sentences into individual vectors.
  • Document RNN: A higher-level RNN takes these sentence vectors as input to produce a single "global context vector" ($D$) that represents the document's history.
Hierarchical RNN architecture for summarizing document context through sentence and document-level layers.

2. Integrating Context into NMT

Once the history vector $D$ is generated, the authors tested three methods for integration into the decoder:

  • Initialization: Using $D$ to set the starting state of the encoder and decoder (a "warm start").
  • Auxiliary Context: Feeding $D$ as an additional input to the decoder at every time step.
  • Gating Auxiliary Context: The most novel contribution, this involves a learnable context gate. This layer decides, for every word generated, how much weight to give to the global history versus the current sentence.
Comparison of decoder architectures: (a) standard decoder, (b) decoder with auxiliary context, and (c) decoder with gating auxiliary context.

Experimental Results

The model was evaluated on a large-scale Chinese-English translation task using 1 million sentence pairs from LDC corpora. The results demonstrated that selective attention is key to performance:

  • BLEU Score Increase: The combined model (Initialization + Gating) improved translation quality by +2.1 BLEU points over the Nematus baseline.
  • Error Reduction: Manual analysis of test documents revealed that 76% of ambiguity-related errors and 75% of inconsistency errors were resolved. For instance, the model correctly identified "corrupt officials" in a context where a baseline system incorrectly translated the term as "enemy."
  • Source vs. Target History: Interestingly, using previous source sentences was effective, but using previous target (translated) sentences hurt performance due to "error propagation," where early mistakes poison subsequent context.

Conclusion

The study highlights that Initialization and Gating are complementary strategies that provide both a strong starting point and real-time guidance for the decoder. The gating mechanism is particularly effective because it prevents the model from being overwhelmed by historical data when the current sentence is clear, only "calling for backup" from the history when encountering ambiguity. Future work may explore larger context windows and more complex discourse modeling, such as explicit anaphora resolution.

Summary updated

BibTeX
@inproceedings{wang2017exploiting,
  author = {Longyue Wang and Zhaopeng Tu and Andy Way and Qun Liu},
  title = {{Exploiting Cross-Sentence Context for Neural Machine Translation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2017},
  doi = {10.18653/v1/d17-1301},
}
Figure