Quantifying Context Mixing in Transformers

Hosein Mohebbi, Willem Zuidema, Grzegorz Chrupała, Afra Alishahi


Abstract
Self-attention weights and their transformed variants have been the main source of information for analyzing token-to-token interactions in Transformer-based models. But despite their ease of interpretation, these weights are not faithful to the models’ decisions as they are only one part of an encoder, and other components in the encoder layer can have considerable impact on information mixing in the output representations. In this work, by expanding the scope of analysis to the whole encoder block, we propose Value Zeroing, a novel context mixing score customized for Transformers that provides us with a deeper understanding of how information is mixed at each encoder layer. We demonstrate the superiority of our context mixing score over other analysis methods through a series of complementary evaluations with different viewpoints based on linguistically informed rationales, probing, and faithfulness analysis.
Anthology ID:
2023.eacl-main.245
Volume:
Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics
Month:
May
Year:
2023
Address:
Dubrovnik, Croatia
Editors:
Andreas Vlachos, Isabelle Augenstein
Venue:
EACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
3378–3400
Language:
URL:
https://aclanthology.org/2023.eacl-main.245
DOI:
10.18653/v1/2023.eacl-main.245
Bibkey:
Cite (ACL):
Hosein Mohebbi, Willem Zuidema, Grzegorz Chrupała, and Afra Alishahi. 2023. Quantifying Context Mixing in Transformers. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, pages 3378–3400, Dubrovnik, Croatia. Association for Computational Linguistics.
Cite (Informal):
Quantifying Context Mixing in Transformers (Mohebbi et al., EACL 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.eacl-main.245.pdf
Software:
 2023.eacl-main.245.software.zip
Video:
 https://aclanthology.org/2023.eacl-main.245.mp4