On Explaining with Attention Matrices

Omar Naim, Nicholas Asher
10/24/2024
cs.CLcs.AI

No official code found. Best implementation: omyokun/On-explaining-with-attention-matrices (0 stars, GPL-3.0, last commit 2024-08-08).

Abstract

This paper explores the much discussed, possible explanatory link between attention weights (AW) in transformer models and predicted output. Contrary to intuition and early research on attention, more recent prior research has provided formal arguments and empirical evidence that AW are not explanatorily relevant. We show that the formal arguments are incorrect. We introduce and effectively compute efficient attention, which isolates the effective components of attention matrices in tasks and models in which AW play an explanatory role. We show that efficient attention has a causal role (provides minimally necessary and sufficient conditions) for predicting model output in NLP tasks requiring contextual information, and we show, contrary to [7], that efficient attention matrices are probability distributions and are effectively calculable. Thus, they should play an important part in the explanation of attention based model behavior. We offer empirical experiments in support of our method illustrating various properties of efficient attention with various metrics on four datasets.

View on arXivView PDF

Code Implementations(1)

GPL-3.0
00Python, Jupyter NotebookDec 11, 20232 years agoGPL-3.0

Similar Papers

Cite this paper

@article{naim2024explaining,
  title  = {On Explaining with Attention Matrices},
  author = {Omar Naim and Nicholas Asher},
  year   = {2024},
  eprint = {2410.18541},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.18541v1}
}

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

Discussion