Better Explain Transformers by Illuminating Important Information

Linxin Song, Yan Cui, Ao Luo, Freddy Lecue, Irene Li
1/18/2024
cs.CL

Official code: LinxinS97/Mask-LRP (8 stars, last commit 2024-01-18).

Abstract

Transformer-based models excel in various natural language processing (NLP) tasks, attracting countless efforts to explain their inner workings. Prior methods explain Transformers by focusing on the raw gradient and attention as token attribution scores, where non-relevant information is often considered during explanation computation, resulting in confusing results. In this work, we propose highlighting the important information and eliminating irrelevant information by a refined information flow on top of the layer-wise relevance propagation (LRP) method. Specifically, we consider identifying syntactic and positional heads as important attention heads and focus on the relevance obtained from these important heads. Experimental results demonstrate that irrelevant information does distort output attribution scores and then should be masked during explanation computation. Compared to eight baselines on both classification and question-answering datasets, our method consistently outperforms with over 3\% to 33\% improvement on explanation metrics, providing superior explanation performance. Our anonymous code repository is available at: https://github.com/LinxinS97/Mask-LRP

View on arXivView PDF

Code Implementations(1)

LinxinS97/Mask-LRPOfficial100%
81PythonJun 11, 20232 years ago

Similar Papers

Cite this paper

@article{song2024better,
  title  = {Better Explain Transformers by Illuminating Important Information},
  author = {Linxin Song and Yan Cui and Ao Luo and Freddy Lecue and Irene Li},
  year   = {2024},
  eprint = {2401.09972},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2401.09972v3}
}

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

Discussion