Contrastive Learning for Context-aware Neural Machine Translation Using Coreference Information

Yongkeun Hwang, Hyeongu Yun, Kyomin Jung

Introduction

Standard Neural Machine Translation (NMT) systems typically operate on a sentence-by-sentence basis, ignoring the broader document context. This isolation leads to significant errors in document-level translation, particularly regarding anaphora resolution. For instance, translating the English pronoun "it" into a gendered language like German requires identifying its antecedent in a previous sentence to select the correct gender (e.g., masculine er for Mantel / coat).

While context-aware models have been developed, they often fail to utilize surrounding text effectively. Trained primarily with standard cross-entropy loss, these models are not explicitly penalized for ignoring contextual cues, often defaulting to local patterns that result in incorrect pronoun resolution.

Methodology: CorefCL

To address these limitations, we propose CorefCL (Coreference-based Contrastive Learning), a model-agnostic training framework designed to enhance a model's sensitivity to cross-sentential dependencies.

Coreference-based Data Augmentation

The first component of CorefCL involves generating contrastive examples that highlight coreference links. Using an automated tool (NeuralCoref), the system identifies coreference chains—sequences of words referring to the same entity—across sentences. It then creates "negative" examples by corrupting these links through two methods:

  1. Omission: Removing the key reference from the contextual sentence.
  2. Replacement: Substituting the reference with a random, unrelated word.
Figure 2: The process of generating contrastive examples by identifying coreference chains and corrupting antecedents to create negative training samples.

Contrastive Learning Objective

During training, the model is tasked with distinguishing between the original, correct context and these corrupted versions. We employ a max-margin loss function, which forces the model to assign a significantly higher probability to the correct translation when paired with the authentic context versus the "broken" one. This margin ensures the network becomes actively sensitive to cross-sentential dependencies, moving context-awareness from a passive feature to a functional requirement.

Experimental Setup

The efficacy of CorefCL was evaluated across several document-level translation tasks:

  • English-German: Benchmarked on WMT news, IWSLT TED talks, and OpenSubtitles’18.
  • English-Korean: Tested on a new 1.6M sentence web-crawled bilingual subtitle corpus.
  • Targeted Evaluation: The ContraPro test suite was used to specifically measure pronoun resolution accuracy in English-to-German translation.

Results and Analysis

CorefCL consistently improved translation quality across all tested architectures, including simple concatenation and complex multi-encoder setups.

Figure 4: BLEU score improvements across various datasets and model architectures when integrated with CorefCL, showing consistent gains across all benchmarks.

Key findings include:

  • BLEU Score Gains: The framework provided a consistent boost, with improvements of up to 2.8 points on the English-Korean task.
  • Pronoun Resolution: On the ContraPro suite, CorefCL improved resolution accuracy by up to 5.5% over baseline context-aware models.
  • Regularization: CorefCL acts as a powerful regularizer, helping models focus on linguistically relevant contextual parts even within noisy datasets.

Conclusion and Future Work

CorefCL demonstrates that explicit contrastive signals are vital for teaching NMT models to respect document-level consistency. While currently focused on source-side context corruption, future research will explore maintaining coreference consistency on the target side. Additionally, applying CorefCL to large-scale pre-trained models like BART or T5 represents a promising avenue for further refining document-level translation capabilities.

Summary updated

BibTeX
@inproceedings{hwang2021contrastive,
  author = {Yongkeun Hwang and Hyeongu Yun and Kyomin Jung},
  title = {{Contrastive Learning for Context-aware Neural Machine Translation Using Coreference Information}},
  booktitle = {WMT @ EMNLP},
  year = {2021},
}
Figure