Exploring Neural Language Models via Analysis of Local and Global Self-Attention Spaces

Blaž Škrlj, Shane Sheehan, Nika Eržen, Marko Robnik-Šikonja, Saturnino Luz, Senja Pollak


Abstract
Large pretrained language models using the transformer neural network architecture are becoming a dominant methodology for many natural language processing tasks, such as question answering, text classification, word sense disambiguation, text completion and machine translation. Commonly comprising hundreds of millions of parameters, these models offer state-of-the-art performance, but at the expense of interpretability. The attention mechanism is the main component of transformer networks. We present AttViz, a method for exploration of self-attention in transformer networks, which can help in explanation and debugging of the trained models by showing associations between text tokens in an input sequence. We show that existing deep learning pipelines can be explored with AttViz, which offers novel visualizations of the attention heads and their aggregations. We implemented the proposed methods in an online toolkit and an offline library. Using examples from news analysis, we demonstrate how AttViz can be used to inspect and potentially better understand what a model has learned.
Anthology ID:
2021.hackashop-1.11
Volume:
Proceedings of the EACL Hackashop on News Media Content Analysis and Automated Report Generation
Month:
April
Year:
2021
Address:
Online
Editors:
Hannu Toivonen, Michele Boggia
Venue:
Hackashop
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
76–83
Language:
URL:
https://aclanthology.org/2021.hackashop-1.11
DOI:
Bibkey:
Cite (ACL):
Blaž Škrlj, Shane Sheehan, Nika Eržen, Marko Robnik-Šikonja, Saturnino Luz, and Senja Pollak. 2021. Exploring Neural Language Models via Analysis of Local and Global Self-Attention Spaces. In Proceedings of the EACL Hackashop on News Media Content Analysis and Automated Report Generation, pages 76–83, Online. Association for Computational Linguistics.
Cite (Informal):
Exploring Neural Language Models via Analysis of Local and Global Self-Attention Spaces (Škrlj et al., Hackashop 2021)
Copy Citation:
PDF:
https://aclanthology.org/2021.hackashop-1.11.pdf
Code
 SkBlaz/attviz