Introduction
Transformer models have fundamentally changed Neural Machine Translation (NMT), yet they largely remain "black boxes." Traditional interpretability tools often focus solely on source-side attributions—identifying which source word influenced a specific target word. However, translation is inherently a dual process: the model must balance information from the original source sentence with the partial translation it has already generated (the target prefix). Understanding the relative influence of these two contexts is critical for diagnosing issues like "hallucinations," where a model generates fluent but inaccurate text by ignoring the source.
Methodology: ALTI+
To address this, researchers introduced ALTI+, an advancement of the "Aggregation of Layer-wise Token-to-token Interactions" (ALTI) method. Unlike standard attention weights, which can be misleading due to residual connections and layer normalization, ALTI+ provides a more accurate measure of token contribution by:
- Mathematical Decomposition: Breaking down Multi-Head Attention (MHA) and Layer Normalization (LN) into a sum of transformed vectors.
- Contribution Measurement: Using Manhattan distance between these vectors to quantify the impact of specific input tokens from both the source and target prefix.
- Rollout Aggregation: Tracking these contributions through every layer of the encoder and decoder to map the complete information flow.
ALTI+ is uniquely designed for the encoder-decoder bottleneck, allowing for a simultaneous view of how source and target information interact during the generation process.
Key Insights
The application of ALTI+ across bilingual (De-En) and multilingual (M2M) models yielded several significant findings regarding the internal logic of Transformers:
- The EOS "No-Op" Signal: Models frequently assign high attention to the source End-of-Sentence (
</s>) token. ALTI+ reveals that this token acts as a "no-op" signal; when the model attends to it, it is effectively bypassing the source to rely more heavily on the linguistic patterns within the target prefix. - Anatomy of Hallucinations: During hallucinations, source-side attribution drops precipitously. The model stops "listening" to the source and generates text based almost entirely on the internal logic of the target prefix.
- Information Mixing in the Encoder: In the encoder, tokens retain a significant portion of their original identity. Even at the final layer, 41-47% of a representation's identity is derived from the original input token, with the remainder coming from contextual information.
Results and Performance
ALTI+ provides explanations that align more closely with human intuition than previous methods. It achieved an Alignment Error Rate (AER) of 38.8, outperforming raw attention weights (47.7) and Vector Norms (41.4). Furthermore, the method highlighted a resource disparity: translations into low-resource languages (e.g., Zulu) show significantly lower source attribution than high-resource languages, suggesting the model struggles to ground translations when training data is scarce.
Conclusion
While ALTI+ offers a powerful window into the Transformer's "thought process," it currently does not account for the final softmax layer's impact on word selection. Future research may leverage these attribution maps to actively mitigate hallucinations by enforcing a minimum level of source-side reliance during decoding, moving us closer to more reliable and transparent NMT systems.
Summary updated