论文标题
注意力流:分析和比较语言模型中的注意机制
Attention Flows: Analyzing and Comparing Attention Mechanisms in Language Models
论文作者
论文摘要
语言建模的进步导致了在各种自然语言处理(NLP)问题中表现出的深层基于注意力的模型的发展。这些语言模型的特征是在大型未标记的文本语料库上进行预训练过程,随后对特定任务进行了微调。尽管已经致力于理解预训练模型的注意力机制,但在接受目标NLP任务训练时,模型的注意机制如何变化尚不清楚。在本文中,我们提出了一种视觉分析方法,以了解基于注意力的语言模型中的微调。我们的可视化,注意力流旨在支持用户在基于变压器的语言模型中的层次,层次以及注意力头的层次,层次和注意力头的关注方面进行比较。为了帮助用户了解如何做出分类决策,我们的设计集中在描绘基于分类的注意力的最深层,以及先前层中的注意力如何在输入中的单词中流动。注意力流通过其相似性和差异来支持单个模型的分析以及预训练和微调模型之间的视觉比较。我们使用注意力流来研究各种句子中的注意机制理解任务,并突出关注如何发展以解决解决这些任务的细微差别。
Advances in language modeling have led to the development of deep attention-based models that are performant across a wide variety of natural language processing (NLP) problems. These language models are typified by a pre-training process on large unlabeled text corpora and subsequently fine-tuned for specific tasks. Although considerable work has been devoted to understanding the attention mechanisms of pre-trained models, it is less understood how a model's attention mechanisms change when trained for a target NLP task. In this paper, we propose a visual analytics approach to understanding fine-tuning in attention-based language models. Our visualization, Attention Flows, is designed to support users in querying, tracing, and comparing attention within layers, across layers, and amongst attention heads in Transformer-based language models. To help users gain insight on how a classification decision is made, our design is centered on depicting classification-based attention at the deepest layer and how attention from prior layers flows throughout words in the input. Attention Flows supports the analysis of a single model, as well as the visual comparison between pre-trained and fine-tuned models via their similarities and differences. We use Attention Flows to study attention mechanisms in various sentence understanding tasks and highlight how attention evolves to address the nuances of solving these tasks.