An Attribution Method for Siamese Encoders

Lucas Moeller, Dmitry Nikolaev, Sebastian Padó


Abstract
Despite the success of Siamese encoder models such as sentence transformers (ST), little is known about the aspects of inputs they pay attention to. A barrier is that their predictions cannot be attributed to individual features, as they compare two inputs rather than processing a single one. This paper derives a local attribution method for Siamese encoders by generalizing the principle of integrated gradients to models with multiple inputs. The output takes the form of feature-pair attributions and in case of STs it can be reduced to a token–token matrix. Our method involves the introduction of integrated Jacobians and inherits the advantageous formal properties of integrated gradients: it accounts for the model’s full computation graph and is guaranteed to converge to the actual prediction. A pilot study shows that in case of STs few token pairs can dominate predictions and that STs preferentially focus on nouns and verbs. For accurate predictions, however, they need to attend to the majority of tokens and parts of speech.
Anthology ID:
2023.emnlp-main.980
Volume:
Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing
Month:
December
Year:
2023
Address:
Singapore
Editors:
Houda Bouamor, Juan Pino, Kalika Bali
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
15818–15827
Language:
URL:
https://aclanthology.org/2023.emnlp-main.980
DOI:
10.18653/v1/2023.emnlp-main.980
Bibkey:
Cite (ACL):
Lucas Moeller, Dmitry Nikolaev, and Sebastian Padó. 2023. An Attribution Method for Siamese Encoders. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 15818–15827, Singapore. Association for Computational Linguistics.
Cite (Informal):
An Attribution Method for Siamese Encoders (Moeller et al., EMNLP 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.emnlp-main.980.pdf
Video:
 https://aclanthology.org/2023.emnlp-main.980.mp4