A Multiscale Visualization of Attention in the Transformer Model

By Jesse Vig. 2019

708 citations recorded by the source corpus.

The Transformer is a sequence model that forgoes traditional recurrent architectures in favor of a fully attention-based approach. Besides improving performance, an advantage of using attention is that it can also help to interpret a model by showing how the model assigns weight to different input elements. However, the multi-layer, multi-head attention mechanism in the Transformer model can be difficult to decipher. To make the model more accessible, we introduce an open-source tool that visualizes attention at multiple scales, each of which provides a unique perspective on the attention mechanism. We demonstrate the tool on BERT and OpenAI GPT-2 and present three example use cases: detecting model bias, locating relevant attention heads, and linking neurons to model behavior.

Subfields: Artificial Intelligence, Hardware and Architecture, Natural Language Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Yonatan Belinkov
  2. Caiming Xiong
  3. Richard Socher
  4. Mohit Bansal
  5. Sebastian Gehrmann
  6. Luke S. Zettlemoyer
  7. Percy Liang
  8. Jimmy J. Lin

In Hardware and Architecture

  1. Zeynep Akkalyoncu Yilmaz
  2. Huan Sun
  3. Xiang Deng
  4. Boshi Wang
  5. Yonatan Belinkov
  6. Bharath Ramsundar
  7. Jimmy J. Lin
  8. Liang Yao

In Natural Language Processing

  1. Yonatan Belinkov
  2. Richard Socher
  3. Caiming Xiong
  4. Mohit Bansal
  5. Sebastian Gehrmann
  6. Jimmy J. Lin
  7. Graham Neubig
  8. Jianfeng Gao

Citations in the corpus