AttentionViz: A Global View of Transformer Attention

Catherine Yeh, Yida Chen, Aoyu Wu, Cynthia Chen, Fernanda Viégas +1 more
5/4/2023
cs.HCcs.CLcs.CV

No confident code implementation found for this paper.

Abstract

Transformer models are revolutionizing machine learning, but their inner workings remain mysterious. In this work, we present a new visualization technique designed to help researchers understand the self-attention mechanism in transformers that allows these models to learn rich, contextual relationships between elements of a sequence. The main idea behind our method is to visualize a joint embedding of the query and key vectors used by transformer models to compute attention. Unlike previous attention visualization techniques, our approach enables the analysis of global patterns across multiple input sequences. We create an interactive visualization tool, AttentionViz (demo: http://attentionviz.com), based on these joint query-key embeddings, and use it to study attention mechanisms in both language and vision transformers. We demonstrate the utility of our approach in improving model understanding and offering new insights about query-key interactions through several application scenarios and expert feedback.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yeh2023attentionviz,
  title  = {AttentionViz: A Global View of Transformer Attention},
  author = {Catherine Yeh and Yida Chen and Aoyu Wu and Cynthia Chen and Fernanda Viégas and Martin Wattenberg},
  year   = {2023},
  eprint = {2305.03210},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.03210v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.03210.svg)](https://codeofpaper.com/paper/2305.03210)

Discussion