Measuring the Mixing of Contextual Information in the Transformer

Javier Ferrando, Gerard I. Gállego, Marta R. Costa-jussà


Abstract
The Transformer architecture aggregates input information through the self-attention mechanism, but there is no clear understanding of how this information is mixed across the entire model. Additionally, recent works have demonstrated that attention weights alone are not enough to describe the flow of information. In this paper, we consider the whole attention block –multi-head attention, residual connection, and layer normalization– and define a metric to measure token-to-token interactions within each layer. Then, we aggregate layer-wise interpretations to provide input attribution scores for model predictions. Experimentally, we show that our method, ALTI (Aggregation of Layer-wise Token-to-token Interactions), provides more faithful explanations and increased robustness than gradient-based methods.
Anthology ID:
2022.emnlp-main.595
Volume:
Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing
Month:
December
Year:
2022
Address:
Abu Dhabi, United Arab Emirates
Editors:
Yoav Goldberg, Zornitsa Kozareva, Yue Zhang
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
8698–8714
Language:
URL:
https://aclanthology.org/2022.emnlp-main.595
DOI:
10.18653/v1/2022.emnlp-main.595
Bibkey:
Cite (ACL):
Javier Ferrando, Gerard I. Gállego, and Marta R. Costa-jussà. 2022. Measuring the Mixing of Contextual Information in the Transformer. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 8698–8714, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
Cite (Informal):
Measuring the Mixing of Contextual Information in the Transformer (Ferrando et al., EMNLP 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.emnlp-main.595.pdf