A Multiscale Visualization of Attention in the Transformer Model
Open accessThe DOI matches its Crossref record; 22 of the 22 references it cites were found in a registry or an index.
Abstract
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Figures









Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“Prior work has shown how to use attention weights to visually depict which words in an input sequence, plus which words in previously-generated output, were responsible for a given token's output [95,96].”
From Investigating Explainability of Generative AI for Code through Scenario-based Design (2022) · cites this paper as [95]
Experimental — accuracy not yet measuredThe source backs part of the claim, not all of it — or backs it for a different population, condition or comparison.
In the citing paper
“Attention distribution is a popular approach to explain an individual prediction made by a neural networks model, by the relative importance of parts of input to determine the output [95,96].”
From Investigating Explainability of Generative AI for Code through Scenario-based Design (2022) · cites this paper as [95]
Experimental — accuracy not yet measured
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., & Polosukhin, I. (2017) · arXiv · doi:10.48550/arxiv.1706.03762 · Cited by 120,404 · cited 2×
“Jones (2017) designed a visualization tool specifically for multihead attention, which visualizes attention over multiple heads in a layer by superimposing their attention patterns (Vaswani et al., 2017, 2018).”
MethodBERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018) · arXiv · doi:10.48550/arxiv.1810.04805 · Cited by 73,173 · cited 1×
“In 2018, the BERT (Bidirectional Encoder Representations from Transformers) language representation model achieved state-of-the-art performance across NLP tasks ranging from sentiment analysis to question answering (Devlin et al., 2018).”
BackgroundBERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1423 · Cited by 54,325 · cited 1×
“In 2018, the BERT (Bidirectional Encoder Representations from Transformers) language representation model achieved state-of-the-art performance across NLP tasks ranging from sentiment analysis to question answering (Devlin et al., 2018).”
BackgroundNeural Machine Translation by Jointly Learning to Align and Translate
Bahdanau, D., Cho, K., & Bengio, Y. (2014) · arXiv · doi:10.48550/arxiv.1409.0473 · Cited by 16,213 · cited 3×
“Various tools have been developed to visualize attention in NLP models, ranging from attention-matrix heatmaps (Bahdanau et al., 2015; Rush et al., 2015; Rocktäschel et al., 2016) to bipartite graph representations (Liu et al., 2018; Lee et al., 2017; Strobelt et al., 2018).”
BackgroundMethodKemp, C. D., & Tufte, E. R. (1992) · Biometrics · doi:10.2307/2532323 · Cited by 2,713
A Neural Attention Model for Abstractive Sentence Summarization
Rush, A. M., Chopra, S., & Weston, J. (2015) · Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/d15-1044 · Cited by 2,656 · cited 2×
“Various tools have been developed to visualize attention in NLP models, ranging from attention-matrix heatmaps (Bahdanau et al., 2015; Rush et al., 2015; Rocktäschel et al., 2016) to bipartite graph representations (Liu et al., 2018; Lee et al., 2017; Strobelt et al., 2018).”
MethodJain, S., & Wallace, B. (2019) · Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT) · doi:10.18653/v1/n19-1357 · Cited by 2,037 · cited 1×
“, 2015; Belinkov and Glass, 2019), although its value in explaining individual predictions may be limited (Jain and Wallace, 2019).”
BackgroundAnalyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned
Voita, E., Talbot, D., Moiseev, F., Sennrich, R., & Titov, I. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/p19-1580 · Cited by 1,146 · cited 2×
“Recent work shows that attention in the Transformer correlates with syntactic constructs such as dependency relations and part-of-speech tags (Raganato and Tiedemann, 2018; Voita et al., 2019; Vig and Belinkov, 2019).”
BackgroundGender bias in coreference resolution: Evaluation and debiasing methods
Zhao, J., Wang, T., Yatskar, M., Ordonez, V., & Chang, K.-W. (2018) · Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers) · doi:10.18653/v1/n18-2003 · Cited by 684 · cited 1×
“This suggests that the model’s coreference mechanism may encode gender bias (Zhao et al., 2018; Lu et al., 2018).”
BackgroundTensor2Tensor for Neural Machine TranslationPreprint
Vaswani, A., Bengio, S., Brevdo, E., Chollet, F., Gomez, A. N., Gouws, S., Jones, L., Kaiser, Ł., Kalchbrenner, N., Parmar, N., et al. (2018) · arXiv (Cornell University) · doi:10.48550/arxiv.1803.07416 · Cited by 656 · cited 1×
“Jones (2017) designed a visualization tool specifically for multi-head attention, which visualizes attention over multiple heads in a layer by superimposing their attention patterns (Vaswani et al., 2017, 2018).”
Research works printed but not linked: 1
- [18]18. Jesse Vig. 2019. BertViz: A tool for visualizing multi- head self-attention in the BERT model. In ICLR Workshop: Debugging Machine Learning Models.
Cited by
ProtTrans: Toward Understanding the Language of Life Through Self-Supervised Learning
Elnaggar, A., Heinzinger, M., Dallago, C., Rehawi, G., Wang, Y., Jones, L., Gibbs, T., Feher, T., Angerer, C., Steinegger, M., et al. (2022) · IEEE Transactions on Pattern Analysis and Machine Intelligence · doi:10.1109/tpami.2021.3095381 · Cited by 2,329
“We visualized [68] the attention weights of ProtAlbert to”
MethodPre-trained models for natural language processing: A survey
Qiu, X., Sun, T., Xu, Y., Shao, Y., Dai, N., & Huang, X. (2020) · Science China Technological Sciences · doi:10.1007/s11431-020-1647-3 · Cited by 1,591
“BertViz [185] Visualization Tool https://github.”
Liu, X., Zheng, Y., Du, Z., Ding, M., Qian, Y., Yang, Z., & Tang, J. (2024) · AI Open · doi:10.1016/j.aiopen.2023.08.012 · Cited by 596
Ji, Y., Zhou, Z., Liu, H., & Davuluri, R. V. (2021) · Bioinformatics · doi:10.1093/bioinformatics/btab083 · Cited by 1,303
ChemBERTa: Large-Scale Self-Supervised Pretraining for Molecular Property Prediction
Chithrananda, S., Grand, G., & Ramsundar, B. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2010.09885 · Cited by 379
“Meanwhile, software infrastructure for transformers is maturing rapidly: HuggingFace [12] provides streamlined pretraining and finetuning pipelines, while packages like BertViz [13] offer sophisticated interfaces for attention visualization.”
MethodIn-context Learning and Induction Heads
Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., Mann, B., Askell, A., Bai, Y., Chen, A., et al. (2022) · arXiv · doi:10.48550/arxiv.2209.11895 · Cited by 1,170
VL-BERT: Pre-training of Generic Visual-Linguistic Representations
Su, W., Zhu, X., Cao, Y., Li, B., Lu, L., Wei, F., & Dai, J. (2019) · arXiv · doi:10.48550/arxiv.1908.08530 · Cited by 950
Liu, X., Zheng, Y., Du, Z., Ding, M., Qian, Y., Yang, Z., & Tang, J. (2021) · arXiv · doi:10.48550/arxiv.2103.10385 · Cited by 908
Rasmy, L., Xiang, Y., Xie, Z., Tao, C., & Zhi, D. (2021) · npj Digital Medicine · doi:10.1038/s41746-021-00455-y · Cited by 886
Rethinking Attention with Performers
Choromanski, K., Likhosherstov, V., Dohan, D., Song, X., Gane, A., Sarlos, T., Hawkins, P., Davis, J., Mohiuddin, A., Kaiser, L., et al. (2020) · arXiv · doi:10.48550/arxiv.2009.14794 · Cited by 695
“Furthermore, we analyze the amino-acid similarity matrix estimated from the attention matrices produced by the Performer model, as described in Vig et al. (Vig et al., 2020).”
MethodShifting machine learning for healthcare from development to deployment and from models to data
Zhang, A., Xing, L., Zou, J., & Wu, J. C. (2022) · Nature Biomedical Engineering · doi:10.1038/s41551-022-00898-y · Cited by 420
ProGen: Language Modeling for Protein Generation
Madani, A., McCann, B., Naik, N., Keskar, N. S., Anand, N., Eguchi, R. R., Huang, P.-S., & Socher, R. (2020) · bioRxiv (Cold Spring Harbor Laboratory) · doi:10.1101/2020.03.07.982272 · Cited by 212
Elnaggar, A., Heinzinger, M., Dallago, C., Rihawi, G., Wang, Y., Jones, L., Gibbs, T., Fehér, T., Angerer, C. M., Steinegger, M., et al. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2007.06225 · Cited by 67
“We visualized [68] the attention weights of ProtAlbert to”
MethodKG-BERT: BERT for Knowledge Graph Completion
Yao, L., Mao, C., & Luo, Y. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1909.03193 · Cited by 366
“We use the visualization tool released by (Vig 2019) 2 .”
MethodSpQR: A Sparse-Quantized Representation for Near-Lossless LLM Weight Compression
Dettmers, T., Svirschevski, R., Egiazarian, V., Kuznedelev, D., Frantar, E., Ashkboos, S., Borzunov, A., Hoefler, T., & Alistarh, D. (2024) · International Conference on Learning Representations · doi:10.48550/arxiv.2306.03078 · Cited by 441
“This could be related to some attention heads having more important functions [VTM + 19, Vig19, OEN + 22].”
ProtTrans: Towards Cracking the Language of Life’s Code Through Self-Supervised Learning
Elnaggar, A., Heinzinger, M., Dallago, C., Rehawi, G., Wang, Y., Jones, L., Gibbs, T., Feher, T., Angerer, C., Steinegger, M., et al. (2020) · bioRxiv (Cold Spring Harbor Laboratory) · doi:10.1101/2020.07.12.199554 · Cited by 354
BERTology Meets Biology: Interpreting Attention in Protein Language Models
Vig, J., Madani, A., Varshney, L. R., Xiong, C., Socher, R., & Rajani, N. F. (2020) · doi:10.1101/2020.06.26.174417 · Cited by 338
“Visualization techniques have been used to convey the structure and properties of attention in Transformers [31, 40, 80, 82].”
MethodSelf-citationXie, J., Zhang, J., Sun, J., Ma, Z., Qin, L., Li, G., Zhou, H., & Zhan, Y. (2022) · IEEE Transactions on Neural Systems and Rehabilitation Engineering · doi:10.1109/tnsre.2022.3194600 · Cited by 314
polyBERT: a chemical language model to enable fully machine-driven ultrafast polymer informatics
Kuenneth, C., & Ramprasad, R. (2023) · Nature Communications · doi:10.1038/s41467-023-39868-6 · Cited by 275
“As shown for trained NLP Transformers, 46 deciphering and visualizing the attention layers of the Transformer encoders can reveal such information.”
Extraction of organic chemistry grammar from unsupervised learning of chemical reactions
Schwaller, P., Hoover, B., Reymond, J.-L., Strobelt, H., & Laino, T. (2021) · Science Advances · doi:10.1126/sciadv.abe4166 · Cited by 296
Toward Trustworthy AI Development: Mechanisms for Supporting Verifiable Claims
Brundage, M., Avin, S., Wang, J., Belfield, H., Krueger, G., Hadfield, G., Khlaaf, H., Yang, J., Toner, H., Fong, R., et al. (2020) · arXiv · doi:10.48550/arxiv.2004.07213 · Cited by 306
Analyzing the Structure of Attention in a Transformer Language Model
Vig, J., & Belinkov, Y. (2019) · Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP · doi:10.18653/v1/w19-4808 · Cited by 301
“Past work suggests that attention heads in the Transformer may specialize in particular linguistic phenomena (Vaswani et al., 2017; Raganato and Tiedemann, 2018; Vig, 2019).”
BackgroundMethodSelf-citationVL-BERT: Pre-training of Generic Visual-Linguistic Representations
Su, W., Zhu, X., Cao, Y., Li, B., Lu, L., Wei, F., & Dai, J. (2020) · International Conference on Learning Representations · Cited by 713
Liu, S., Liu, S., Liu, Z., Peng, X., & Yang, Z. (2022) · Computers & Education · doi:10.1016/j.compedu.2022.104461 · Cited by 269
Explaining the black-box model: A survey of local interpretation methods for deep neural networks
Liang, Y., Li, S., Yan, C., Li, M., & Jiang, C. (2021) · Neurocomputing · doi:10.1016/j.neucom.2020.08.011 · Cited by 253
Two are Better than One: Joint Entity and Relation Extraction with Table-Sequence Encoders
Wang, J., & Lu, W. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.133 · Cited by 216
Bridging Textual and Tabular Data for Cross-Domain Text-to-SQL Semantic Parsing
Lin, X. V., Socher, R., & Xiong, C. (2020) · Findings of the Association for Computational Linguistics: EMNLP 2020 · doi:10.18653/v1/2020.findings-emnlp.438 · Cited by 181
“We use the BERTViz library 17 developed by Vig (2019).”
MethodAbbas, Q., Jeong, W., & Lee, S. W. (2025) · Healthcare · doi:10.3390/healthcare13172154 · Cited by 236
“These mechanisms inherently offer interpretability by design, although their outputs can sometimes be opaque without supplementary visualization [67,110,111].”
Explainable Generative AI (GenXAI): a survey, conceptualization, and research agenda
Schneider, J. (2024) · Artificial Intelligence Review · doi:10.1007/s10462-024-10916-x · Cited by 156
Investigating Explainability of Generative AI for Code through Scenario-based Design
Sun, J., Liao, Q. V., Muller, M., Agarwal, M., Houde, S., Talamadupula, K., & Weisz, J. D. (2022) · 27th International Conference on Intelligent User Interfaces · doi:10.1145/3490099.3511119 · Cited by 219
“Prior work has shown how to use attention weights to visually depict which words in an input sequence, plus which words in previously-generated output, were responsible for a given token’s output [95, 96].”
BackgroundCausal Mediation Analysis for Interpreting Neural NLP: The Case of Gender Bias
Vig, J., Gehrmann, S., Belinkov, Y., Qian, S., Nevo, D., Sakenis, S., Huang, J., Singer, Y., & Shieber, S. M. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2004.12265 · Cited by 61
“Vig (2019) previously identified the same head (layer 5, head 10; noted as 5-10) as relating to coreference resolution based on visual inspection.”
BackgroundSelf-citationBastings, J., & Filippova, K. (2020) · Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP · doi:10.18653/v1/2020.blackboxnlp-1.14 · Cited by 150
Interactive and Visual Prompt Engineering for Ad-hoc Task Adaptation With Large Language Models
Strobelt, H., Webson, A., Sanh, V., Hoover, B., Beyer, J., Pfister, H., & Rush, A. M. (2022) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2022.3209479 · Cited by 204
“, Transformers, RNNs, LSTMs) to understand how it encodes knowledge of the language [1, 6, 11, 12, 19, 24, 34, 39, 40]; (2) to explore and compare the behavior of a model’s internal distributions during text generation [9, 35]; and (3) to understand how model behavior differs under controlled input or parameter change…”
Transformer-based deep learning for predicting protein properties in the life sciences
Chandra, A., Tünnermann, L., Löfstedt, T., & Gratz, R. (2023) · eLife · doi:10.7554/elife.82819 · Cited by 184
“Moreover, the intricacy in the existing ways of interpreting Transformer models, especially its multihead attention, is also being improved so that model’s internal learnings can be made more easy for analysis ( Hao et al., 2021 ; Vig, 2019b ).”
BackgroundTransforming Conversations with AI—A Comprehensive Study of ChatGPT
Bansal, G., Chamola, V., Hussain, A., Guizani, M., & Niyato, D. (2024) · Cognitive Computation · doi:10.1007/s12559-023-10236-2 · Cited by 164
Gao, Y., Zhou, M., Liu, D., Yan, Z., Zhang, S., & Metaxas, D. (2022) · arXiv (Cornell University) · doi:10.48550/arxiv.2203.00131 · Cited by 278
“Transformer models, with the attention mechanism as the core operator, are emerging in vision tasks and demon-1. https://github.com/yhygao/CBIM-Medical-Image-Segmentation strating promising performance and generalization on image classification via large-scale training [17], [35], [36].”
MethodA Survey on Gender Bias in Natural Language Processing
Stańczak, K., & Augenstein, I. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2112.14168 · Cited by 57
Synthesis of Compositional Animations from Textual Descriptions
Ghosh, A., Cheema, N., Oguz, C., Theobalt, C., & Slusallek, P. (2021) · 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · doi:10.1109/iccv48922.2021.00143 · Cited by 169
“, adverbs of a verb [63], we use the attention visualization tool [65] with randomly selected samples of the KIT Motion Language dataset [52].”
MethodMOFormer: Self-Supervised Transformer Model for Metal–Organic Framework Property Prediction
Cao, Z., Magar, R., Wang, Y., & Barati Farimani, A. (2023) · Journal of the American Chemical Society · doi:10.1021/jacs.2c11420 · Cited by 163
A Primer on the Inner Workings of Transformer-based Language ModelsPreprint
Ferrando, J., Sarti, G., Bisazza, A., & Costa‐jussà, M. R. (2024) · arXiv (Cornell University) · doi:10.48550/arxiv.2405.00208 · Cited by 218
HiT: Hierarchical Transformer with Momentum Contrast for Video-Text Retrieval
Liu, S., Fan, H., Qian, S., Chen, Y., Ding, W., & Wang, Z. (2021) · 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · doi:10.1109/iccv48922.2021.01170 · Cited by 166
Understanding and Overcoming the Challenges of Efficient Transformer Quantization
Bondarenko, Y., Nagel, M., & Blankevoort, T. (2021) · Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2021.emnlp-main.627 · Cited by 81
“…2019), RoBERTa (Liu et al., 2019), XLNet (Yang ∗ Qualcomm AI Research is an initiative of Qualcomm Technologies, Inc. et al., 2019), Transformer-XL (Dai et al., 2019), GPT family (Radford et al., 2018, 2019; Brown et al., 2020), have become an indispensable building block in modern NLP pipelines.”
BackgroundSinghal, A., Neveditsin, N., Tanveer, H., & Mago, V. (2024) · JMIR Medical Informatics · doi:10.2196/50048 · Cited by 172
“…stochastic neighbor embedding, and singular vector canonical correlation analysis are used for this purpose [104]; (6) attention visualization [105]—techniques for visualizing attention in transformer-based language models used across various NLP tasks on SMPs help reveal the models’ inner…”
MethodBorn, J., & Manica, M. (2023) · Nature Machine Intelligence · doi:10.1038/s42256-023-00639-z · Cited by 220
Trustworthiness in Retrieval-Augmented Generation Systems: A SurveyPreprint
Zhou, Y., Zhang, W., Shao, J., Liu, Y., Li, X., Jin, J., Qian, H., Liu, Z., Li, C., Zhang, C., et al. (2024) · arXiv (Cornell University) · doi:10.48550/arxiv.2409.10102 · Cited by 231
“Methods include attention visualization [2, 151], activation maximization [51], and layer-wise relevance propagation [103] to see how the model processes input and which parts of the data it focuses on.”
BatteryBERT: A Pretrained Language Model for Battery Database Enhancement
Huang, S., & Cole, J. M. (2022) · Journal of Chemical Information and Modeling · doi:10.1021/acs.jcim.2c00035 · Cited by 135
Chatterjee, J., & Dethlefs, N. (2021) · Renewable and Sustainable Energy Reviews · doi:10.1016/j.rser.2021.111051 · Cited by 180
A transformer-based deep neural network model for SSVEP classification
Chen, J., Zhang, Y., Pan, Y., Xu, P., & Guan, C. (2023) · Neural Networks · doi:10.1016/j.neunet.2023.04.045 · Cited by 173
exBERT: A Visual Analysis Tool to Explore Learned Representations in Transformer Models
Hoover, B., Strobelt, H., & Gehrmann, S. (2020) · Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations · doi:10.18653/v1/2020.acl-demos.22 · Cited by 151
“Attention visualizations have thus taken significant steps toward these goals of making explorations fast and interactive for the user (Vig, 2019).”
Background(2020) · neural information processing systems · Cited by 142
Self-citationAMP‐BERT: Prediction of antimicrobial peptide function based on a BERT model
Lee, H., Lee, S., Lee, I., & Nam, H. (2023) · Protein Science · doi:10.1002/pro.4529 · Cited by 119
“The supplementary figures consist of visualizations of self-attention values across all 30 layers with 16 heads for external test sequence DRAMP18350, produced using BertViz (Vig, 2019), and additional self-attention Circos plots for DRAMP00293, DRAMP02743, DRAMP03120, and DRAMP04398.”
MethodAutomatic Text Summarization of COVID-19 Medical Research Articles using BERT and GPT-2Preprint
Kieuvongngam, V., Tan, B., & Niu, Y. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2006.01997 · Cited by 164
“The attention can be broadly interpreted as a vector of importance weights, i.e. how strongly the tokens in sequences are correlated with other tokens [Vig, 2019].”
BackgroundXAIR: A Systematic Metareview of Explainable AI (XAI) Aligned to the Software Development Process
Clement, T., Kemmerzell, N., Abdelaal, M., & Amberg, M. (2023) · Machine Learning and Knowledge Extraction · doi:10.3390/make5010006 · Cited by 131
Attention Flows: Analyzing and Comparing Attention Mechanisms in Language Models
DeRose, J. F., Wang, J., & Berger, M. (2021) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2020.3028976 · Cited by 109
“how does one token influence another token across the layers of the network? Thus, in contrast to prior work that is more exploratory regarding self-attention [21, 50], our work seeks to analyze attention to help explain the classification decisions made by BERT.”
BackgroundMethodResultTan, J., Shenker-Tauris, N., Rodriguez-Hernaez, J., Wang, E., Sakellaropoulos, T., Boccalatte, F. E., Thandapani, P., Skok, J. A., Aifantis, I., Fenyö, D., et al. (2023) · Nature Biotechnology · doi:10.1038/s41587-022-01612-8 · Cited by 135
“To generate a genome-wide testing dataset, we selected all 1-Mb regions in a sliding window with 0.5-Mb overlap between neighboring regions.”
InfluentialEXplainable Artificial Intelligence (XAI)—From Theory to Methods and Applications
Ortigossa, E. S., Gonçalves, T., & Nonato, L. G. (2024) · IEEE Access · doi:10.1109/access.2024.3409843 · Cited by 124
“Although Vaswani et al. [65] claimed attention mechanisms employed on Transformers could yield more interpretable models, such transparency is questionable [95], i.e., the interpretation of internal workings of a transformer model can be challenging and must be better understood [179], [180].”
BackgroundMethodInfluentialLin, T., Zhang, W., Li, S., Yuan, Y., Yu, B., Li, H., He, W., Jiang, H., Li, M., Song, X., et al. (2025) · arXiv (Cornell University) · doi:10.48550/arxiv.2502.09838 · Cited by 173
“As is widely recognized, the ViT encodes visual concepts with increasing abstraction, generally, becoming finer as we progress over levels (Vig 2019).”
Garrido-Muñoz, I., Montejo-Ráez, A., Martínez-Santiago, F., & Ureña-López, L. A. (2021) · Applied Sciences · doi:10.3390/app11073184 · Cited by 123
Iteratively Prompt Pre-trained Language Models for Chain of Thought
Wang, B., Deng, X., & Sun, H. (2022) · Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2022.emnlp-main.174 · Cited by 73
“We randomly choose examples in the development/test set, and use BertViz (Vig, 2019) to visualize the attentions within the forward pass of the prompter after the following processing steps: 1) we aggregate the attention weights of different attention heads within the same trans-former layer; 2) to better view the pro…”
MethodToward Transparent AI: A Survey on Interpreting the Inner Structures of Deep Neural Networks
Räuker, T., Ho, A., Casper, S., & Hadfield-Menell, D. (2023) · 2023 IEEE Conference on Secure and Trustworthy Machine Learning (SaTML) · doi:10.1109/satml54575.2023.00039 · Cited by 122
“Interactive tools for visual analysis of attentional attribution are provided by [163], [176], [263], [278].”
MethodSelf-Attention Network for Skeleton-based Human Action Recognition
Cho, S., Maqbool, M. H., Liu, F., & Foroosh, H. (2020) · IEEE Winter Conference on Applications of Computer Vision · doi:10.1109/wacv45572.2020.9093639 · Cited by 131
“We visualize the self-attention response from the last self-attention layer with a visualization tool [32] to understand how each frame is correlated for a certain action video.”
MethodVaswani (2017) · doi:10.1109/tse.2022.3178469 · Cited by 89
“The figure shows the attention of the first transformer layer of seBERTcalculated with BertViz [22].”
BackgroundArtificial intelligence: revolutionizing cardiology with large language models
Boonstra, M., Weissenbacher, D., Moore, J. H., Gonzalez-Hernandez, G., & Asselbergs, F. (2024) · European Heart Journal · doi:10.1093/eurheartj/ehad838 · Cited by 84
“37 The pretrained can then be fine-tuned to perform a task of interest using a small training data set.”
BERT Representations for Video Question Answering
Yang, Z., Garcia, N., Chu, C., Otani, M., Nakashima, Y., & Takemura, H. (2020) · 2020 IEEE Winter Conference on Applications of Computer Vision (WACV) · doi:10.1109/wacv45572.2020.9093596 · Cited by 107
A tutorial on open-source large language models for behavioral science
Hussain, Z., Binz, M., Mata, R., & Wulff, D. U. (2024) · Behavior Research Methods · doi:10.3758/s13428-024-02455-8 · Cited by 141
“However, it should be noted that these relations are typically not human-interpretable (e.g., Vig, 2019; Vig & Belinkov, 2019).”
BackgroundZero shot health trajectory prediction using transformer
Renc, P., Jia, Y., Samir, A. E., Wąs, J., Li, Q., Bates, D. W., & Sitek, A. (2024) · npj Digital Medicine · doi:10.1038/s41746-024-01235-0 · Cited by 189
“In future work,weplantoimplementandtestadvancedvisualizationattentionlayers ofthetransformer 29 to gain insights into the model ’ s reasoning process.”
Masked Language Modeling for Proteins via Linearly Scalable Long-Context Transformers
Choromański, K., Likhosherstov, V., Dohan, D., Song, X., Gane, A., Sarlós, T., Hawkins, P., Davis, J. Q., Belanger, D., Colwell, L. J., et al. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2006.03555 · Cited by 28
Comparing Pre-trained and Feature-Based Models for Prediction of Alzheimer's Disease Based on Speech
Balagopalan, A., Eyre, B., Robin, J., Rudzicz, F., & Novikova, J. (2021) · Frontiers in Aging Neuroscience · doi:10.3389/fnagi.2021.635945 · Cited by 96
“Interpreting Attention Patterns in BERT-Based Models We look at multi-scale attention visualizations of BERT finetuned for the AD detection task, using the BertViz library (Vig, 2019) (Figure 2).”
MethodAttentionViz: A Global View of Transformer Attention
Yeh, C. V., Chen, Y., Wu, A., Chen, C., Viégas, F. B., & WATTENBERG, M. P. (2023) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2023.3327163 · Cited by 163
“When using BERT or GPT-2, users can click on a point in Single View to open Sentence View in the left sidebar, which displays a BertViz-inspired visualization of sentence-level attention with the clicked token highlighted [53] (Fig.”
BackgroundMethodResultInfluentialThe Large Language Models on Biomedical Data Analysis: A Survey
Lan, W., Tang, Z., Liu, M., Chen, Q., Peng, W., Chen, Y. P., & Pan, Y. F. (2025) · IEEE Journal of Biomedical and Health Informatics · doi:10.1109/jbhi.2025.3530794 · Cited by 114
Pandey, S., & Sharma, S. (2023) · Healthcare Analytics · doi:10.1016/j.health.2023.100198 · Cited by 77
Deep learning prediction models based on EHR trajectories: A systematic review
Amirahmadi, A., Ohlsson, M., & Etminani, K. (2023) · Journal of Biomedical Informatics · doi:10.1016/j.jbi.2023.104430 · Cited by 128
Neural Media Bias Detection Using Distant Supervision With BABE - Bias Annotations By Experts
Spinde, T., Plank, M., Krieger, J.-D., Ruas, T., Gipp, B., & Aizawa, A. (2021) · Findings of the Association for Computational Linguistics: EMNLP (Findings of EMNLP) · doi:10.18653/v1/2021.findings-emnlp.101 · Cited by 154
“Existing research already presents ways to visualize Transformer-based models and make their results more accessible and interpretable (Vig, 2019).”
MethodPromptAid: Visual Prompt Exploration, Perturbation, Testing and Iteration for Large Language Models
Mishra, A., Danzy, B., Soni, U., Arunkumar, A., Huang, J., Kwon, B. C., & Bryan, C. (2025) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2025.3535332 · Cited by 107
“…prior tools can broadly be categorized as supporting two types of tasks: (1) greying black boxed NLP models [28], [29], [30], [31], [32], [33], [34], [35], primarily for model developers and experts, and (2) understanding post hoc model behavior based on input variances [36], [37], One…”
IMoJIE: Iterative Memory-Based Joint Open Information Extraction
Kolluru, K., Aggarwal, S., Rathore, V., Mausam, & Chakrabarti, S. (2020) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2020.acl-main.521 · Cited by 120
Explainable Information Retrieval: A SurveyPreprint
Anand, A., Lyu, L., Idahl, M., Wang, Y., Wallat, J., & Zhang, Z. (2022) · arXiv (Cornell University) · doi:10.48550/arxiv.2211.02405 · Cited by 106
“The attention weights can be used to explain what part of the input a model attends to when making a prediction, for example, by visualizing the attention weights at certain layers [126].”
BackgroundAnalyzing Individual Neurons in Pre-trained Language Models
Durrani, N., Sajjad, H., Dalvi, F., & Belinkov, Y. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.395 · Cited by 54
State of the Art of Visual Analytics for eXplainable Deep Learning
Rosa, B. L., Blasilli, G., Bourqui, R., Auber, D., Santucci, G., Capobianco, R., Bertini, E., Giot, R., & Angelini, M. (2023) · Computer Graphics Forum · doi:10.1111/cgf.14733 · Cited by 117
“The solution showing the shortest gap is BertViz [Vig19]: the authors proposed explain-able approaches for transformers in 2019, the same year the relative DL models (BERT and GPT-2) were proposed.”
BackgroundVisualizing Transformers for NLP: A Brief Survey
Brasoveanu, A. M. P., & Andonie, R. (2020) · 2020 24th International Conference Information Visualisation (IV) · doi:10.1109/iv51561.2020.00051 · Cited by 84
“, [19]) or embeddings [18], parallel coordinates plots [19], and the inclusion of corpus views from ExBERT [17].”
BackgroundMethodInfluentialArtificial Intelligence and Deep Learning for Rheumatologists
McMaster, C., Bird, A., Liew, D. F. L., Buchanan, R. R. C., Owen, C., Chapman, W. W., & Pires, D. E. V. (2022) · Arthritis & Rheumatology · doi:10.1002/art.42296 · Cited by 98
Greco, C. M., & Tagarelli, A. (2023) · Artificial Intelligence and Law · doi:10.1007/s10506-023-09374-7 · Cited by 104
Qi, Y., Pan, Z., Hong, Y., Yang, M.-H., van den Hengel, A., & Wu, Q. (2021) · 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · doi:10.1109/iccv48922.2021.00168 · Cited by 80
Foundation Models for Natural Language Processing: Pre-trained Language Models Integrating Media
Paaß, G., & Giesselbach, S. (2023) · Artificial intelligence: foundations, theory, and algorithms/Artificial intelligence: Foundations, theory, and algorithms · doi:10.1007/978-3-031-23190-2 · Cited by 105
Pfeffer, M. A., Ling, S. H., & Wong, J. K. W. (2024) · Computers in Biology and Medicine · doi:10.1016/j.compbiomed.2024.108705 · Cited by 91
exBERT: A Visual Analysis Tool to Explore Learned Representations in Transformers Models
Hoover, B., Strobelt, H., & Gehrmann, S. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1910.05276 · Cited by 40
On Position Embeddings in BERT
Wang, B., Shang, L., Lioma, C., Jiang, X., Yang, H., Liu, Q., & Simonsen, J. G. (2021) · Research at the University of Copenhagen (University of Copenhagen) · Cited by 133
A Cross-Language Investigation into Jailbreak Attacks in Large Language ModelsPreprint
Li, J., Liu, Y., Liu, C., Shi, L., Ren, X., Zheng, Y., Liu, Y., & Xue, Y. (2024) · arXiv (Cornell University) · doi:10.48550/arxiv.2401.16765 · Cited by 105
“Visualization techniques, such as multi-layered Deconvolutional Networks (deconvnet) [43] and guided back-propagation [35], are pivotal for understanding deep learning models, including Transformer-based models, which often utilize attention score illustrations [7, 39].”
BackgroundChallenges of Large Language Models for Mental Health CounselingPreprint
Chung, N. C., Dyer, G., & Brocki, L. (2023) · arXiv (Cornell University) · doi:10.48550/arxiv.2311.13857 · Cited by 82
“Particularly, due to the self-attention mechanisms in transformer architectures, quantifying the relationship be-tween the prediction and the input [44, 45, 46] may prove to be useful for understanding the language models.”
BackgroundFormNet: Structural Encoding beyond Sequential Modeling in Form Document Information Extraction
Lee, C.-Y., Li, C.-L., Dozat, T., Perot, V., Su, G., Hua, N., Ainslie, J., Wang, R., Fujii, Y., & Pfister, T. (2022) · Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/2022.acl-long.260 · Cited by 74
Table Pre-training: A Survey on Model Architectures, Pre-training Objectives, and Downstream Tasks
Dong, H., Cheng, Z., He, X., Zhou, M., Zhou, A., Zhou, F., Liu, A., Han, S., & Zhang, D. (2022) · International Joint Conference on Artificial Intelligence · doi:10.24963/ijcai.2022/761 · Cited by 93
TCR-BERT: learning the grammar of T-cell receptors for flexible antigen-xbinding analysesPreprint
Wu, K., Yost, K. E., Dániel, B., Belk, J. A., Xia, Y., Egawa, T., Satpathy, A. T., Chang, H. Y., & Zou, J. (2021) · bioRxiv (Cold Spring Harbor Laboratory) · doi:10.1101/2021.11.18.469186 · Cited by 88
“To sample a new TRA/TRB pair, we start by randomly selecting one of the given seed sequence pairs.”
MethodLarge language models in plant biology
Lam, H. Y. I., Ong, X. E., & Mutwil, M. (2024) · Trends in Plant Science · doi:10.1016/j.tplants.2024.04.013 · Cited by 78
Kim, H., Na, J., & Lee, W. B. (2021) · Journal of Chemical Information and Modeling · doi:10.1021/acs.jcim.1c01289 · Cited by 64
Attention for Vision-Based Assistive and Automated Driving: A Review of Algorithms and Datasets
Kotseruba, I., & Tsotsos, J. K. (2022) · IEEE Transactions on Intelligent Transportation Systems · doi:10.1109/tits.2022.3186613 · Cited by 81
Copy Suppression: Comprehensively Understanding an Attention HeadPreprint
McDougall, C. S., Conmy, A., Rushing, C., McGrath, T., & Nanda, N. (2023) · arXiv (Cornell University) · doi:10.48550/arxiv.2310.04625 · Cited by 99
“Attention heads correlated with previous tokens (Vig, 2019) and rare words (Voita et al.”
BackgroundEntity Enhanced BERT Pre-training for Chinese NER
Chen, J., Shi, Y., Yang, Q., & Zhang, Y. (2020) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.518 · Cited by 84
“Figure 6 uses BertViz (Vig, 2019) to visualize the last-layer attention patterns of “ 休 (Hugh)” in a news example.”
MethodCheng, Y.-B., Chen, X., Chen, J., Wei, P., Zhang, D., & Lin, L. (2021) · IEEE International Conference on Multimedia and Expo (ICME) · doi:10.1109/icme51207.2021.9428459 · Cited by 78
“To visualize the learned temporal dependencies, we utilize the visualization tool [27] to show the attention maps of the last layer.”
MethodKeyphrase Extraction as Sequence Labeling Using Contextualized Embeddings
Sahrawat, D., Mahata, D., Zhang, H., Kulkarni, M., Sharma, A., Gosangi, R., Stent, A. J., Kumar, Y., Shah, R. R., & Zimmermann, R. (2020) · Lecture notes in computer science · doi:10.1007/978-3-030-45442-5_41 · Cited by 86
“Using BertViz [25] we analyzed the aggregated attention of all 12 layers of both the models.”
MethodAccounting fraud detection using contextual language learning
Bhattacharya, I., & Mićković, A. (2024) · International Journal of Accounting Information Systems · doi:10.1016/j.accinf.2024.100682 · Cited by 79
Next-Gen Medical Imaging: U-Net Evolution and the Rise of Transformers
Zhang, C. H., Deng, X., & Ling, S. H. (2024) · Sensors · doi:10.3390/s24144668 · Cited by 71
“There are three main components: Queries (Q), Keys (K), and Values (V) [57–59].”
Background
Metadata
- Authors
- Vig, J.
- Affiliations
- Palo Alto Research Center (US)
- Corresponding author
- Vig, Jesse
- ORCID
- Vig, Jesse
- Venue
- Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations
- Published
- 2019
- Pages
- 37-42
- OpenAlex
- W2949202705
- Semantic Scholar
- 0de0a44b859a3719d11834479112314b4caba669
- Cited by
- 600
- References
- 17
- Citations by year
- 2026: 46 · 2025: 87 · 2024: 79 · 2023: 112 · 2022: 84 · 2021: 112 · 2020: 71 · 2019: 9
- FWCI
- 26.40
- Type
- conference paper
- Language
- en
- Open access
- hybrid
- doi.org
- Licence
- cc-by
- Locations
- Annual Meeting of the Association for Computational Linguistics: System Demonstrations (ACL Demo) (publishedVersion, cc-by)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Explainable Artificial Intelligence (XAI)
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Computer Graphics and Computer-Aided Design › Data Visualization and Analytics
- Keywords
- attention visualization, transformer models, multi-scale visualization, interpretability, multi-head attention, BERT, GPT-2, attention heads, open-source visualization tool
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.