arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2009.07053cs.HCcs.CL
收藏

注意流:语言模型中注意力机制的分析与比较

Attention Flows: Analyzing and Comparing Attention Mechanisms in Language Models

Vanderbilt University(范德堡大学)

Joseph F DeRose, Jiayao Wang, Matthew Berger

摘要:

语言建模的进步导致了基于深度注意力的模型的发展,这些模型在各种各样的自然语言处理(NLP)问题上都是有效的。这些语言模型通过在大型未标记文本语料库上的预训练过程来代表,随后针对特定任务进行微调。虽然已经有相当多的工作致力于理解预训练模型的注意力机制,但很少有人了解模型的注意力机制在针对目标NLP任务进行训练时如何变化。在本文中,我们提出了一个可视化的分析方法来理解微调注意力为基础的语言模型。我们的可视化,注意力流,旨在支持用户查询,跟踪和比较层内,跨层的注意力,并在基于transformer的语言模型的注意力头。为了帮助用户深入了解分类决策是如何做出的,我们的设计集中在最深层描述基于分类的注意力,以及来自先前层的注意力如何在输入中的单词中流动。Attention Flows支持单个模型的分析,以及通过它们的相似性和差异性对预训练和微调模型进行视觉比较。我们使用注意流来研究各种句子理解任务中的注意力机制,并强调注意力是如何演变的,以解决这些任务的细微差别。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑