Contrastive Learning for Context-aware Neural Machine TranslationUsing Coreference Information

Yongkeun Hwang, Hyungu Yun, Kyomin Jung

Abstract

Standard Neural Machine Translation (NMT) systems often struggle with document-level coherence, particularly in resolving coreferences across sentence boundaries. We present CorefCL (Coreference-based Contrastive Learning), a novel training framework designed to enhance the sensitivity of context-aware NMT models to inter-sentential dependencies. By employing coreference-based data augmentation and a contrastive loss function, CorefCL forces models to actively utilize contextual information. Our experiments across English-German and English-Korean tasks demonstrate significant improvements in translation quality (BLEU) and pronoun resolution accuracy.

Introduction

While sentence-level NMT has achieved remarkable success, it frequently fails to maintain consistency in extended discourses. A common failure mode involves pronoun resolution: for instance, translating the English "it" into a gendered target language requires knowledge of the antecedent in a previous sentence. Existing context-aware models, which incorporate surrounding sentences into the encoder, often suffer from "context neglect" due to the standard cross-entropy loss not explicitly penalizing the disregard of contextual cues.

Methodology: CorefCL

CorefCL addresses context neglect through a two-pronged approach: coreference-based data augmentation and a contrastive learning objective.

Coreference-based Data Augmentation

Using automated tools, the system identifies coreference chains within the source text. It then generates "negative" context examples by corrupting these chains in two ways:

  1. Word Omission: Removing the antecedent from the context.
  2. Word Replacement: Replacing the antecedent with a semantically unrelated word.

Contrastive Learning Objective

The model is trained to maximize the margin between the likelihood of the correct translation given the original context versus the corrupted context. This max-margin loss ensures the model treats contextual entities as critical constraints rather than optional features.

Comparison of different context-aware NMT architectures, ranging from simple concatenation to hierarchical multi-encoders.

The framework is model-agnostic and can be integrated into various architectures, including standard concatenation (concat) and complex hierarchical multi-encoders (multi-enc-hier), as illustrated in the figure above.

Experimental Evaluation

We evaluated CorefCL on several document-level datasets: WMT (News), IWSLT (TED talks), OpenSubtitles’18, and a newly curated English-Korean subtitle corpus. Performance was measured using BLEU scores and the ContraPro benchmark for English-to-German pronoun resolution.

Results and Discussion

Experimental results indicate that CorefCL consistently outperforms baseline context-aware models. Notable gains include a +1.6 BLEU improvement on English-Korean tasks and a 5.5% increase in pronoun resolution accuracy on the ContraPro suite.

A qualitative example where CorefCL correctly resolves the pronoun 'it' to the masculine 'Er' (referring to 'coat'), whereas the baseline model incorrectly uses the feminine 'Sie'.

As shown in the qualitative comparison, the contrastive training allows the model to correctly identify masculine antecedents (e.g., "coat" -> "der Mantel") and select the appropriate gendered pronoun ("Er") in German, a task where standard models often default to incorrect forms like "Sie".

Key Insights

  • Regularization: Improvements were particularly significant on smaller datasets (IWSLT) and the En-Ko corpus, suggesting that CorefCL acts as an effective regularizer against over-reliance on local sentence patterns.
  • Corruption Strategy: Ablation studies confirmed that combining word omission and replacement yields the best performance, as it teaches the model to distinguish between the presence and identity of entities.

Conclusion

CorefCL provides a robust mechanism for teaching NMT models to follow conversational threads. By explicitly modeling coreference through contrastive learning, we achieve higher translation consistency. Future work will explore extending this framework to target-side coreference and applying it to large-scale pre-trained transformers.

Summary updated

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