NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Analyzing the Attention Heads for Pronoun Disambiguation in Context-aware Machine Translation Models

Paweł Mąka, Yusuf Can Semerci, Jan Scholtes, Gerasimos SpanakisCOLING 2025

TL;DR

This paper investigates which attention heads in Transformer-based machine translation models are crucial for correctly translating pronouns that depend on surrounding context. By analyzing and manipulating these heads, the authors found that while some heads are highly effective, others are underutilized, suggesting potential for performance improvements through targeted tuning.

What Problem Does This Paper Address?

Context-aware machine translation (MT) aims to produce more coherent and accurate translations by leveraging information from preceding sentences. A key challenge in this area is pronoun disambiguation, where the correct translation of a pronoun depends on identifying its antecedent in the context. While Transformer models have shown great promise, it's not fully understood how their internal mechanisms, specifically attention heads, contribute to this crucial task. This paper seeks to demystify this by pinpointing which attention heads are responsible for understanding pronoun-context relationships and how their behavior impacts translation quality.

Methods

The authors employ a multi-pronged approach to analyze attention heads:

  • Attention Score Analysis: They measure the attention scores assigned by each head to specific relationships between pronouns and their potential antecedents (e.g., source pronoun to source antecedent, target pronoun to source antecedent).
  • Score-Accuracy Correlation: They correlate these attention scores with the model's actual performance on disambiguation tasks to understand if high attention correlates with correct predictions.
  • Modifying Heads: This is a novel technique where they artificially alter attention scores for specific relationships. By either increasing or decreasing attention to certain contextual cues, they observe the impact on the model's accuracy. This allows them to test hypotheses about head functionality.
  • Fine-tuning Heads: Promising heads identified through modification are then fine-tuned to permanently alter their behavior and assess if performance gains can be sustained.

Datasets

The study utilizes the following datasets:

  • ContraPro: An English-to-German contrastive dataset for pronoun disambiguation.
  • Large Contrastive Pronoun Testset (LCPT): An English-to-French contrastive dataset for pronoun disambiguation.
  • IWSLT 2017: Used for fine-tuning and evaluating overall translation quality.

Key Insights and Ideas

  • Not all attention is created equal: While many attention heads attend to relevant contextual information for pronoun disambiguation, not all of them significantly impact the model's ability to perform this task.
  • Underutilized heads offer potential: Some heads show low attention to crucial relationships but, when manipulated, lead to significant accuracy improvements. This suggests these heads could be "tuned" to become more effective.
  • Decoder attention is king: Attention in the decoder, particularly in higher layers, appears to have the most significant impact on pronoun disambiguation accuracy. This is intuitive, as the decoder is directly responsible for generating the translated output.
  • Target-side context is more influential: The study confirms that context from the target side (previously generated translation) is more critical than source-side context for disambiguation.
  • Cross-lingual heads behave consistently: In the multilingual NLLB-200 model, heads showing similar behavior for pronoun disambiguation across English-to-German and English-to-French translations were observed.

Key Results

  • Fine-tuning specific, responsive heads led to accuracy increases of up to 5 percentage points on pronoun disambiguation tasks.
  • The "Modifying Heads" technique revealed heads that, despite low initial attention, significantly boosted accuracy when their attention was amplified.
  • Conversely, some heads that showed high attention did not respond as strongly to modifications, suggesting they might be specialized for other tasks.
  • The study demonstrated that the performance gains from fine-tuning could be solidified into the model's parameters.

Limitations and Future Work

  • Pre-trained models only: The analysis focused on pre-trained models fine-tuned for context-aware MT. The behavior of heads in models trained from scratch might differ.
  • Contrastive datasets: The experiments used contrastive datasets, which might not perfectly reflect real-world generative translation scenarios.
  • Gold context: The study used "gold" (correct) context. In practice, models rely on their own generated context, which can introduce errors.
  • Limited scope: The research focused on pronoun disambiguation and only two language directions (English-German and English-French).
  • Future work: The authors suggest exploring the phenomenon of heads being insufficient for attending to relations when the input tokens are not ideal, and investigating more efficient methods for tuning heads. They also propose further research into the overlap of improvements when multiple heads are modified simultaneously.

Summary updated

BibTeX
@inproceedings{maka2025analyzing,
  author = {Paweł Mąka and Yusuf Can Semerci and Jan Scholtes and Gerasimos Spanakis},
  title = {{Analyzing the Attention Heads for Pronoun Disambiguation in Context-aware Machine Translation Models}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
}
Figure