Capturing document context inside sentence-level neural machine translation models with self-training

Elman Mansimov, Gábor Melis, Lei Yu

Abstract

Neural machine translation (NMT) has arguably achieved human level parity when trained and evaluated at the sentence-level. Document-level neural machine translation has received less attention and lags behind its sentence-level counterpart. The majority of the proposed document-level approaches investigate ways of conditioning the model on several source or target sentences to capture document context. These approaches require training a specialized NMT model from scratch on parallel document-level corpora. We propose an approach that doesn't require training a specialized model on parallel document-level corpora and is applied to a trained sentence-level NMT model at decoding time. We process the document from left to right multiple times and self-train the sentence-level model on pairs of source sentences and generated translations. Our approach reinforces the choices made by the model, thus making it more likely that the same choices will be made in other sentences in the document. We evaluate our approach on three document-level datasets: NIST Chinese-English, WMT19 Chinese-English and Open-Subtitles English-Russian. We demonstrate that our approach has higher BLEU score and higher human preference than the baseline. Qualitative analysis of our approach shows that choices made by model are consistent across the document.

Introduction

While Neural Machine Translation (NMT) has reached human-level parity for individual sentences, it often fails when translating entire documents. Standard models translate sentences in isolation, lacking "document context." This leads to jarring inconsistencies, such as character names changing mid-text or gender markings flipping randomly between sentences.

Existing solutions usually involve training massive, specialized models on rare document-level parallel data. This paper introduces a method to turn standard sentence-level translation models into document-aware ones without retraining them from scratch. By "self-training" the model on its own generated translations at decoding time, the authors reinforce consistent terminology and stylistic choices across an entire document.

Methods

The core idea is self-training at decoding time. Instead of using a static model, the translation process is treated as a mini-learning session:

  1. Monotonic Processing: The model translates the first sentence of a document.
  2. Gradient Updates: It takes that (source, generated translation) pair and performs a few steps of gradient descent to update its own weights, reinforcing the choices just made.
  3. Weight Decay: To prevent "forgetting" general translation knowledge, a decay prior keeps updated weights close to original parameters.
  4. Multi-pass Decoding: The model processes the entire document multiple times ($P$ passes) to allow information from the end of a document to influence the beginning.
  5. Oracle Self-training: As a benchmark, the model is updated using ground-truth translations to establish a theoretical upper bound.

Evaluation and Results

The researchers evaluated their method on three diverse document-level datasets: NIST Chinese-English (news), WMT19 Chinese-English (modern news), and OpenSubtitles English-Russian (dialogue context).

Quantitative Performance

On the NIST dataset, the approach improved the baseline by an average of 0.53 BLEU for standard models and 0.93 BLEU for models using backtranslation (BT).

BLEU results on NIST Chinese-English dataset

Key Insights

  • Consistency via Reinforcement: By updating weights on its own output, the model builds a "temporary memory" of the document's vocabulary. If it translates a name a certain way once, the weight update makes it much more likely to choose that same name again.
  • Document Length Correlation: Performance gains (BLEU improvement) increase as the document gets longer. More sentences provide more opportunities for the model to learn and apply document-specific context.
BLEU improvement vs document length
  • The "Rich Get Richer" Effect: The authors found that the better the underlying sentence-level model is, the more it benefits from self-training. Higher quality initial translations lead to more effective reinforcement.
  • Human Preference: In head-to-head evaluations for NIST Zh-En, human annotators preferred the self-trained version 122 times compared to 78 for the baseline.

Discussion and Limitations

While effective, this approach introduces computational overhead because gradient updates occur during inference, making it slower than standard decoding. There is also a theoretical risk of error propagation, where early mistakes are reinforced throughout the document, though empirical results suggest the benefits of consistency outweigh this. Future work may explore bidirectional self-training to further refine document context.

Summary updated

Abstract

Neural machine translation (NMT) has arguably achieved human level parity when trained and evaluated at the sentence-level. Document-level neural machine translation has received less attention and lags behind its sentence-level counterpart. The majority of the proposed document-level approaches investigate ways of conditioning the model on several source or target sentences to capture document context. These approaches require training a specialized NMT model from scratch on parallel document-level corpora. We propose an approach that doesn't require training a specialized model on parallel document-level corpora and is applied to a trained sentence-level NMT model at decoding time. We process the document from left to right multiple times and self-train the sentence-level model on pairs of source sentences and generated translations. Our approach reinforces the choices made by the model, thus making it more likely that the same choices will be made in other sentences in the document. We evaluate our approach on three document-level datasets: NIST Chinese-English, WMT19 Chinese-English and Open-Subtitles English-Russian. We demonstrate that our approach has higher BLEU score and higher human preference than the baseline. Qualitative analysis of our approach shows that choices made by model are consistent across the document.
BibTeX
@misc{mansimov2020capturing,
  author = {Elman Mansimov and Gábor Melis and Lei Yu},
  title = {{Capturing document context inside sentence-level neural machine translation models with self-training}},
  year = {2020},
  eprint = {2003.05259},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2003.05259},
}
Figure