基于transformer的语言表示模型中注意力的可视化
Visualizing Attention in Transformer-Based Language Representation Models
摘要:
我们提出了一个开源工具,用于在基于transformer的语言表示模型中可视化多头自我注意力。该工具扩展了早期的工作,通过在三个粒度级别上可视化注意力:注意力头级别,模型级别和神经元级别。我们描述了这些视图如何帮助解释模型,并在BERT模型和OpenAI GPT-2模型上演示了该工具。我们还提出了分析GPT-2的三个用例:检测模型偏差,识别重复模式,以及将神经元与模型行为联系起来。
英文摘要:
We present an open-source tool for visualizing multi-head self-attention in Transformer-based language representation models. The tool extends earlier work by visualizing attention at three levels of granularity: the attention-head level, the model level, and the neuron level. We describe how each of these views can help to interpret the model, and we demonstrate the tool on the BERT model and the OpenAI GPT-2 model. We also present three use cases for analyzing GPT-2: detecting model bias, identifying recurring patterns, and linking neurons to model behavior.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。