Do Context-Aware Translation Models Pay the Right Attention?

Kayo Yin, Patrick Fernandes, Danish Pruthi, Aditi Chaudhary, André F. T. Martins, Graham Neubig

Introduction

Modern Neural Machine Translation (NMT) systems typically operate on a sentence-by-sentence basis, which often leads to errors in discourse-level phenomena. For instance, translating the English pronoun "it" into French requires determining if the referent is masculine (il) or feminine (elle). If the referent appeared in a previous sentence, a standard model lacks the necessary information to make an accurate choice. While "context-aware" models were developed to address this by incorporating neighboring sentences, evidence suggests they often fail to utilize this context effectively, frequently attending to irrelevant tokens or spurious correlations. This research investigates whether these models focus on the correct contextual clues and proposes a method to guide their attention using human rationales.

The SCAT Dataset

To bridge the gap between human and machine reasoning, the authors introduced SCAT (Supporting Context for Ambiguous Translations). This dataset consists of 14,000 English-French examples where professional translators performed disambiguation tasks for Pronoun Anaphora Resolution (PAR) and Word Sense Disambiguation (WSD). Crucially, translators were required to highlight the specific words in the context that informed their decisions, providing a "gold standard" for attention.

Example of the SCAT annotation interface showing human-highlighted supporting context ('témoins') for pronoun disambiguation.

Methodology

The study proceeded in three phases:

  1. Rationale Collection: Gathering human-annotated supporting context via the SCAT dataset.
  2. Attention Analysis: Comparing Transformer attention maps against human rationales using metrics like KL Divergence and "Probes Needed" (the number of high-attention tokens required to find a human-highlighted one).
  3. Attention Regularization: Introducing a new training objective that includes a regularization loss ($R(\theta)$). This loss penalizes the model when its attention distribution deviates from human-annotated highlights. Two approaches were tested: training from scratch (attnreg-rand) and fine-tuning a pre-trained model (attnreg-pre).

Results and Analysis

The analysis revealed distinct patterns between PAR and WSD. While WSD is often solvable using local context within the current sentence, PAR almost invariably requires looking back at previous sentences. Furthermore, humans found target-side context (previously translated French sentences) significantly more useful than source-side context for pronoun resolution.

Human confidence levels for Pronoun Anaphora Resolution (PAR) and Word Sense Disambiguation (WSD) across different context levels.

The regularized models demonstrated marked improvements:

  • General Quality: The attnreg-rand model improved translation quality by 0.54 BLEU points over the baseline.
  • Targeted Accuracy: On the "Big-PAR" contrastive evaluation, the model achieved a 14.7% relative improvement in pronoun resolution accuracy.
  • Context Dependency: When supporting context was masked, regularized models showed a sharper performance drop than baselines, indicating they had successfully learned to rely on relevant contextual cues rather than ignoring them.

Conclusion and Future Work

This work demonstrates that explicitly teaching NMT models to "pay attention" to human-selected words significantly enhances their ability to resolve discourse-level ambiguities. While currently limited to English-French, the approach shows promise for improving the interpretability and accuracy of context-aware translation. Future research may explore using eye-tracking data as a more natural source of human rationales to provide supervision without manual highlighting.

Summary updated

BibTeX
@inproceedings{yin2021do,
  author = {Kayo Yin and Patrick Fernandes and Danish Pruthi and Aditi Chaudhary and André F. T. Martins and Graham Neubig},
  title = {{Do Context-Aware Translation Models Pay the Right Attention?}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.acl-long.65},
}
Figure