Scaling Attention Head Analysis via Gradient-Based Attribution in Context-Aware Machine Translation

Paweł Mąka, Yusuf Can Semerci, Jan Scholtes, Gerasimos Spanakis
9/23/2026
cs.CLcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

In this paper, we introduce a gradient-based head attribution strategy where the Token-level Max-Margin loss is backpropagated to the attention maps. This framework enables a large-scale causal analysis of attention heads, making it suitable for LLMs.

Show full abstract

We evaluate our method on the task of disambiguation in Context-aware Machine Translation, where we analyze 50 phenomena across 4 models and 4 language directions. We empirically show the alignment of our method with the effects of increasing the attention scores of token-to-token relations on three models and two language directions, ensuring the robustness of our method. Our analysis reveals the presence of the "general-purpose" attention heads that improve the model's performance when attending to different relations. We find that the average attention a head assigns to a relation does not necessarily relate to the model's performance, which suggests that the models developed redundancies during training in terms of the head functions.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mka2026scaling,
  title  = {Scaling Attention Head Analysis via Gradient-Based Attribution in Context-Aware Machine Translation},
  author = {Paweł Mąka and Yusuf Can Semerci and Jan Scholtes and Gerasimos Spanakis},
  year   = {2026},
  eprint = {2609.28117},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.28117v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.28117.svg)](https://codeofpaper.com/paper/2609.28117)

Discussion