HackerPapers

arXiv:2305.03210cs.HC

AttentionViz: A Global View of Transformer Attention

Catherine Yeh, Yida Chen, Aoyu Wu, Cynthia Chen, Fernanda Viégas, Martin Wattenberg

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.

arXiv comments
11 pages, 13 figures
Journal reference
DOI
Subjects
cs.HCHuman-Computer Interaction cs.CLComputation and Language cs.CVComputer Vision and Pattern Recognition cs.LGMachine Learning

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from May 2023 to May 2023. Found in 1 HN submission from May 2023 to May 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

  1. Attention Viz 1 comment
    • I've been working on a project I've called DocGPT: https://github.com/featurebasedb/DocGPT. This is a work in progress and I'll be putting together a release next week, once I've got the instructions for running it done. It was my assumption that GPT-4 could be used for keyterm…

      kordlessagainView on HNParent context

  2. Attention Viz 1 comment
    • About button: Attention Viz is an interactive tool that visualizes global attention patterns for transformer models. To create this tool, we visualize the joint embeddings of query and key vectors. paper: https://arxiv.org/abs/2305.03210 docs…

      djoldmanView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.