Introduction
Standard Neural Machine Translation (NMT) models, including the powerful Transformer architecture, typically operate on a sentence-by-sentence basis. By treating each sentence as an isolated unit, these models ignore the surrounding document-level context. This "context-blindness" leads to several systemic translation errors. For instance, coreference issues arise when a model cannot determine the antecedent of a pronoun like "it," leading to incorrect gender or word choice. Lexical inconsistency occurs when a specific term is translated differently across a single document, and semantic ambiguity remains unresolved when the meaning of a word depends on information in previous sentences. This paper proposes a modified Transformer architecture designed to incorporate document-level information to mitigate these issues.
Methodology
The authors introduce three primary innovations to the standard Transformer framework: a dedicated context encoder, context integration via attention and gating, and a two-step training strategy.
Architectural Innovations
The model adds a separate Transformer-style encoder specifically to process preceding sentences. This "Context Encoder" uses multi-head self-attention to generate a global representation of the context. This information is then integrated into the main encoder and decoder through new "Context Attention" sub-layers.
To ensure the source sentence remains the primary driver of the translation, a Position-wise Context Gating mechanism is employed. This learnable gate decides how much information to take from the context versus the current sentence, preventing the context from overwhelming the primary input.
Training Strategy
To address the scarcity of document-aligned parallel corpora, a two-step training approach is used. First, a standard Transformer is trained on a large-scale sentence-level corpus to learn robust language patterns. Second, the parameters of this base model are frozen, and only the newly introduced context modules are trained on a smaller document-level dataset. This strategy prevents the model from overfitting to the smaller dataset or "forgetting" its general translation capabilities.
Experimental Setup
The model was evaluated on two major translation tasks:
- Chinese-English (NIST): Utilizing a 2M sentence-pair corpus with a 940K document-level subset. Evaluation was performed on NIST 2002-2008 datasets.
- French-English (IWSLT): Utilizing the IWSLT bilingual training data (TED talks), which consists of 220K sentence pairs naturally organized into documents.
Results and Discussion
The proposed model achieved significant improvements in translation quality across both tasks. On the Chinese-English task, it outperformed the baseline Transformer by 1.96 BLEU points. On the French-English task, an improvement of 0.89 BLEU points was observed on the test set.
Qualitative analysis further supports these gains. For example, the Chinese word yundong (which can mean "sport" or "movement") was correctly translated as "sport" only when the model had access to context about "car racing" from previous sentences.
Key Insights
- Context Window: Experiments indicated that using the two preceding sentences as context provides the optimal balance between performance and computational cost. Adding further context yielded diminishing returns.
- The Power of Gating: The gating mechanism was found to be essential for disambiguation, acting as a guide rather than a replacement for the source sentence information.
- Efficiency: Despite the added complexity, the training speed only drops by approximately 25%, maintaining the high parallelizability that makes the Transformer attractive.
Conclusion
By incorporating document-level context through a dedicated encoder and gating mechanism, the authors significantly improve the consistency and accuracy of Transformer-based NMT. This approach outperforms previous state-of-the-art document-level models based on RNN architectures. Future work includes exploring bidirectional context and safely integrating target-side context to further reduce translation errors without propagating mistakes.
Summary updated