Context-aware Decoder for Neural Machine Translation using a Target-side Document-Level Language Model

Amane Sugiyama, Naoki YoshinagaNAACL 2021

Introduction

Neural Machine Translation (NMT) has seen significant advancements, yet maintaining consistency across an entire document remains a persistent challenge. Standard NMT systems typically operate on a sentence-by-sentence basis, which often leads to errors in pronoun gender (deixis) or inconsistent terminology (lexical cohesion) throughout a text. While context-aware models exist, they generally rely on document-aligned parallel data—a resource that is significantly scarcer than simple sentence-level pairs or monolingual documents.

In this work, presented at NAACL 2021, the authors propose a "Context-aware Decoder" that leverages target-side monolingual document-level language models (D-LMs) to guide standard sentence-level NMT models. This approach bypasses the need for document-level parallel data while achieving state-of-the-art results in discourse consistency.

The C-SCORE Objective

The core innovation is the C-SCORE, a novel scoring metric used during decoding. Derived from a probabilistic framework, C-SCORE combines the standard NMT score—representing the translation's fidelity to the source—with the Point-wise Mutual Information (PMI) between the current sentence and the preceding context. Theoretically, this approach is a mathematically grounded reformulation of "shallow fusion," a common technique for combining language models with NMT.

The authors implement two primary decoding strategies:

  1. Reranking: The NMT model generates a set of $N$-best candidates, which are then re-scored using C-SCORE to select the most contextually appropriate translation.
  2. Context-aware Beam Search: C-SCORE is integrated directly into the beam search process, allowing for real-time, context-aware word generation.

To ensure stability and prevent the D-LM from disproportionately influencing the translation, the system employs temperature scaling to smooth probability distributions.

Why PMI over Conditional Probability?

A critical insight of this research is the superiority of PMI over raw conditional probability ($p(y|context)$) as a consistency signal. While conditional probability is a common choice for language modeling, it is inherently biased toward high-frequency sentences, regardless of their relevance to the specific context.

Correlation analysis between source and reference scores for PMI and conditional probability.

As shown in the figure above, the PMI between sentences in the source language correlates strongly with the PMI of their translations in the target language (Panel a, $R=0.694$). This correlation vanishes when a random context is used (Panel b, $R=0.095$), confirming that PMI captures genuine semantic connections. Conversely, conditional probability maintains a high correlation even with random contexts (Panel d, $R=0.924$), illustrating its bias toward frequent sentence patterns rather than contextual relevance.

Experimental Results

The method was evaluated on English-to-Russian translation using the OpenSubtitles2018 corpus. The NMT model was trained on 5.8 million sentence pairs, while the D-LM utilized 30 million monolingual Russian sentences.

Discourse Accuracy

The impact on discourse-level phenomena was profound. Using a specialized contrastive test set, the C-SCORE method demonstrated massive improvements over baseline models:

  • Lexical Cohesion: Accuracy increased from 45.9% to 94.9%.
  • Verb Ellipsis: Accuracy rose from 27.0% to 77.0%.

General Quality and Efficiency

Beyond discourse-specific metrics, the system achieved BLEU scores competitive with complex end-to-end architectures like DocRepair. Notably, the "Context-aware Beam Search" proved to be a practical middle ground for efficiency, processing 13 sentences per second compared to the 4.3 sentences per second achieved by large-scale reranking.

Conclusion

The Context-aware Decoder demonstrates that document-level consistency can be achieved by decoupling the translation model from the document-level context. By using PMI-based C-SCORE and monolingual target-side data, researchers can significantly improve the discourse quality of NMT systems without the need for rare document-aligned parallel corpora. Future work will explore applying these principles to non-autoregressive NMT and developing more nuanced metrics for document-level evaluation.

Summary updated

BibTeX
@inproceedings{sugiyama2021context,
  author = {Amane Sugiyama and Naoki Yoshinaga},
  title = {{Context-aware Decoder for Neural Machine Translation using a Target-side Document-Level Language Model}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-main.461},
}
Figure