AttentionViz: A Global View of Transformer Attention
Catherine Yeh, Yida Chen, Aoyu Wu, Cynthia Chen, Fernanda B. 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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 646a14a4-c513-4e9a-9e4f-618ac6952b8cCited by top-tier papers16
- Unveiling High-dimensional Backstage: A Survey for Reliable Visual Analytics with Dimensionality ReductionHyeon Jeon, Hyunwook Lee, Yun-Hsin Kuo, Taehyun Yang et al.CHI 2025 · 29 citations
- Dissecting Query-Key Interaction in Vision TransformersXu Pan, Aaron Philip, Ziqian Xie, Odelia SchwartzNeurIPS 2024 · 18 citations
- DroidSpeak: KV Cache Sharing Across Fine-tuned Model VariantsYuhan Liu, Yuyang Huang, Jiayi Yao, Shaoting Feng et al.NSDI 2026 · 14 citations
- AdversaFlow: Visual Red Teaming for Large Language Models with Multi-Level Adversarial FlowDazhen Deng, Chuhan Zhang, Huawei Zheng, Yuwen Pu et al.IEEE VIS 2024 · 14 citations
- Understanding Large Language Model Behaviors Through Interactive Counterfactual Generation and AnalysisFurui Cheng, Vilém Zouhar, Robin Shing Moon Chan, Daniel Fürst et al.IEEE VIS 2025 · 5 citations
Builds on15
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou et al.ICCV 2021 · 8,921 citations
- Intriguing Properties of Vision TransformersMuzammal Naseer, Kanchana Ranasinghe, Salman Khan, Munawar Hayat et al.NeurIPS 2021 · 863 citations
- Scaling Vision Transformers to 22 Billion ParametersMostafa Dehghani, Josip Djolonga, Basil Mustafa, Piotr Padlewski et al.ICML 2023 · 848 citations
- How Do Vision Transformers Work?Namuk Park, Songkuk KimICLR 2022 · 653 citations
Related papers
- Attention Flows: Analyzing and Comparing Attention Mechanisms in Language ModelsJoseph F. DeRose, Jiayao Wang, Matthew BergerIEEE VIS 2020 · 109 citations
- AttCAT: Explaining Transformers via Attentive Class Activation TokensYao Qiang, Deng Pan, Chengyin Li, Xin Li et al.NeurIPS 2022 · 66 citations
- Transformer Explainer: Learning LLM Transformers with Interactive Visual Explanation and ExperimentationAeree Cho, Grace C. Kim, Alexander Karpekov, Seongmin Lee et al.CHI 2026 · 2 citations
- VL-InterpreT: An Interactive Visualization Tool for Interpreting Vision-Language TransformersEstelle Aflalo, Meng Du, Shao-Yen Tseng, Yongfei Liu et al.CVPR 2022 · 34 citations
- Learning Correlation Structures for Vision TransformersManjin Kim, Paul Hongsuck Seo, Cordelia Schmid, Minsu ChoCVPR 2024
