GlobEnc: Quantifying Global Token Attribution by Incorporating the Whole Encoder Layer in Transformers

Ali Modarressi, Mohsen Fayyaz, Yadollah Yaghoobzadeh, Mohammad Taher Pilehvar
5/6/2022
cs.CL
transformer-attention

Official code: mohsenfayyaz/GlobEnc (24 stars, Jupyter Notebook, last commit 2023-05-16).

Abstract

There has been a growing interest in interpreting the underlying dynamics of Transformers. While self-attention patterns were initially deemed as the primary option, recent studies have shown that integrating other components can yield more accurate explanations.

Show full abstract

This paper introduces a novel token attribution analysis method that incorporates all the components in the encoder block and aggregates this throughout layers. Through extensive quantitative and qualitative experiments, we demonstrate that our method can produce faithful and meaningful global token attributions. Our experiments reveal that incorporating almost every encoder component results in increasingly more accurate analysis in both local (single layer) and global (the whole model) settings. Our global attribution analysis significantly outperforms previous methods on various tasks regarding correlation with gradient-based saliency scores. Our code is freely available at https://github.com/mohsenfayyaz/GlobEnc.

View on arXivView PDF

Code Implementations(1)

[NAACL 2022] GlobEnc: Quantifying Global Token Attribution by Incorporating the Whole Encoder Layer in Transformers

244Jupyter Notebook, PythonApr 24, 20223 years ago

Similar Papers

Cite this paper

@article{modarressi2022globenc,
  title  = {GlobEnc: Quantifying Global Token Attribution by Incorporating the Whole Encoder Layer in Transformers},
  author = {Ali Modarressi and Mohsen Fayyaz and Yadollah Yaghoobzadeh and Mohammad Taher Pilehvar},
  year   = {2022},
  eprint = {2205.03286},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.03286}
}

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/2205.03286.svg)](https://codeofpaper.com/paper/2205.03286)

Discussion