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
Items 101–200 of 797
A Comprehensive Guide to Explainable AI: From Classical Models to LLMsPreprint
Song, X., HSIEH, W.-C., Bi, Z., Jiang, C., Liu, J., Peng, B., Zhang, S., Pan, X., Xu, J., Wang, J., et al. (2024) · OSF Preprints (OSF Preprints) · doi:10.31219/osf.io/wbk36 · Cited by 79
Measurement of Semantic Textual Similarity in Clinical Texts: Comparison of Transformer-Based Models
Yang, X., He, X., Zhang, H., Ma, Y., Bian, J., & Wu, Y. (2020) · JMIR Medical Informatics · doi:10.2196/19735 · Cited by 78
“To test our hypothesis, we adopted the BertViz package [47] to profile the attention pattern of the RoBERTa-large model (ie, our best STS model).”
MethodAccurate identification of bacteriophages from metagenomic data using Transformer
Shang, J., Tang, X., Guo, R., & Sun, Y. (2022) · Briefings in Bioinformatics · doi:10.1093/bib/bbac258 · Cited by 68
“4) following the method introduced in [42, 43].”
Hou, Z., Yang, Y., Ma, Z., Wong, K., & Li, X. (2023) · Communications Biology · doi:10.1038/s42003-023-04462-5 · Cited by 67
Generalizing Natural Language Analysis through Span-relation Representations
Jiang, Z., Xu, W. H., Araki, J., & Neubig, G. (2020) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2020.acl-main.192 · Cited by 67
How Does Attention Work in Vision Transformers? A Visual Analytics Attempt
Li, Y., Wang, J., Dai, X., Wang, L., Yeh, C. M., Zheng, Y. L., Zhang, W., & Ma, K. (2023) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2023.3261935 · Cited by 79
“Popular attention visualization techniques include flow maps [22], [23], parallel coordinates plots (PCPs) [19], and heatmaps [9], [20], [24].”
BackgroundGandolfi, A. (2024) · International Journal of Artificial Intelligence in Education · doi:10.1007/s40593-024-00403-3 · Cited by 70
“As GPT models employ a unique kind of attention mechanism referred to as transformer attention, characterized by its self-attention layers (Vig (2019)), it is the appearance of random mistakes with a certain density which derails the ability of GPT to continue an appropriate detection.”
Transformer-based map-matching model with limited labeled data using transfer-learning approach
Jin, Z., Kim, J., Yeo, H., & Choi, S. (2022) · Transportation Research Part C Emerging Technologies · doi:10.1016/j.trc.2022.103668 · Cited by 62
“In encoder attention weight analysis, We use the visualization tool provided by Vig (2019) to clearly see the correlations, and the result is shown in Figure 8.”
MethodLi, C., Xiao, K., Sun, L., Tang, R., Dong, X., Qiao, B., & Xu, D. (2024) · Ore Geology Reviews · doi:10.1016/j.oregeorev.2024.106007 · Cited by 59
A prompt-engineered large language model, deep learning workflow for materials classification
Liu, S., Wen, T., Pattamatta, A. S. L. S., & Srolovitz, D. J. (2024) · Materials Today · doi:10.1016/j.mattod.2024.08.028 · Cited by 67
“Although our parameters were initially set to select the top 50 features, due to visualization constraints, we chose the top 25 features for display.”
MethodAMBERT: A Pre-trained Language Model with Multi-Grained Tokenization
Zhang, X., Li, P., & Li, H. (2021) · Findings of the Association for Computational Linguistics: ACL (Findings of ACL) · doi:10.18653/v1/2021.findings-acl.37 · Cited by 67
The Chess Transformer: Mastering Play using Generative Language Models
Noever, D. A., Ciolino, M., & Kalin, J. D. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2008.04057 · Cited by 20
“…of chess moves in Figure 2, each token of the chess game receives varying importance through the transformers encoding-decoding layers (Vig 2019) For the present purposes, this core or universal language structure provides the pre-trained architecture and weights to fine-tune for many…”
BackgroundWhich *BERT? A Survey Organizing Contextualized Encoders
Xia, P., Wu, S., & Durme, B. V. (2020) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.608 · Cited by 78
Spatiality-guided Transformer for 3D Dense Captioning on Point Clouds
Wang, H., Zhang, C., Yu, J., & Cai, W. (2022) · International Joint Conference on Artificial Intelligence · doi:10.24963/ijcai.2022/194 · Cited by 68
Nebula: Self-Attention for Dynamic Malware Analysis
Trizna, D., Demetrio, L., Biggio, B., & Roli, F. (2024) · IEEE Transactions on Information Forensics and Security · doi:10.1109/tifs.2024.3409083 · Cited by 74
“On top of these results, we empirically highlight how Neb-ula is focusing on the portions of textual reports that contain malicious activity, by studying the activation of the attention mechanism and applying explainability techniques [18,19].”
End-to-end Named Entity Recognition and Relation Extraction using Pre-trained Language ModelsPreprint
Giorgi, J., Wang, X., Sahar, N., Shin, W. Y., Bader, G. D., & Wang, B. (2019) · arXiv · doi:10.48550/arxiv.1912.13415 · Cited by 70
“These same patterns have been found in pre-trained BERT models that have not been fine-tuned on a specific, supervised task (Vig, 2019; Raganato & Tiedemann, 2018), and therefore, are retained after our fine-tuning procedure.”
MethodInfluentialNayak, A., Timmapathini, H., Ponnalagu, K., & Venkoparao, V. G. (2020) · Workshop on Insights from Negative Results in NLP (Insights) · doi:10.18653/v1/2020.insights-1.1 · Cited by 86
“The inward attention visualization for fat in Encoder layer 1 - Attention head 3 generated using BertViz (Vig, 2019) can be seen in Figure 1.”
MethodDeep learning based question answering system in Bengali
Mayeesha, T. T., Sarwar, A. M., & Rahman, R. M. (2020) · Journal of Information and Telecommunication · doi:10.1080/24751839.2020.1833136 · Cited by 66
“We have also tried to peek inside what the model sees by using a visualization library made for BERT called BERTviz (Vig, 2019) which is a tool for visualizing transformer models.”
MethodAI safety landscape for large language models: taxonomy, state-of-the-art, and future directions
Chen, C., Gong, X., Liu, Z., Jiang, W. M. W. L. H., Goh, S. Q., & Lam, K. (2026) · Artificial Intelligence Review · doi:10.1007/s10462-026-11590-x · Cited by 54
Enhanced prototypical network for few-shot relation extraction
Wen, W., Liu, Y., Ouyang, C., Lin, Q., & Chung, T. (2021) · Information Processing & Management · doi:10.1016/j.ipm.2021.102596 · Cited by 60
KERMIT: Complementing Transformer Architectures with Encoders of Explicit Syntactic Interpretations
Zanzotto, F. M., Santilli, A., Ranaldi, L., Onorati, D., Tommasino, P., & Fallucchi, F. (2020) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.18 · Cited by 71
“In fact, BERTviz is a good visualization mechanism for seeing how models assign weights to different input elements (Bahdanau et al., 2015; Belinkov and Glass, 2019), but it is extremely obscure in explaining causal relations in classification predictions (Wiegreffe and Pinter, 2019).”
MethodBevilacqua, M., Oketch, K., Qin, R., Stamey, W., Zhang, X., Gan, Y., Yang, K., & Abbasi, A. (2025) · ACM Transactions on Information Systems · doi:10.1145/3702639 · Cited by 56
“Specifically, we extend the work of bertviz[94] to compare parallel token-based representation weights, denoted as w(fij), against the token attention weights generated by the transformer’s attention layers.”
Antikainen, E., Linnosmaa, J., Umer, A., Oksala, N., Eskola, M. J., van Gils, M., Hernesniemi, J. A., & Gabbouj, M. (2023) · Scientific Reports · doi:10.1038/s41598-023-30657-1 · Cited by 60
“( a,b ) were produced using BertViz 37 .”
MethodFiok, K., Karwowski, W., Gutiérrez-Franco, E., & Wilamowski, M. (2021) · Expert Systems with Applications · doi:10.1016/j.eswa.2021.115771 · Cited by 57
Text Summarization for Big Data Analytics: A Comprehensive Review of GPT 2 and BERT Approaches
Mohan, G. B., Kumar, R. P., Parathasarathy, S., Aravind, S., Hanish, K. B., & Pavithria, G. (2023) · Internet of things · doi:10.1007/978-3-031-33808-3_14 · Cited by 49
Attention-based clinical note summarization
Kanwal, N., & Rizzo, G. (2021) · ACM Symposium on Applied Computing · doi:10.1145/3477314.3507256 · Cited by 47
Bhat, A., Agashe, S., Oberoi, P., Mohile, N., Jangir, R., & Joshi, A. (2023) · Proceedings of the 28th International Conference on Intelligent User Interfaces · doi:10.1145/3581641.3584060 · Cited by 47
“Attention visualisation techniques such as BertViz [59] may be implemented in text editors to highlight words written by the writer that contributed to the generation of the suggestion.”
MethodBhat, A., Agashe, S., Mohile, N., Oberoi, P., Jangir, R., & Joshi, A. (2022) · arXiv · doi:10.48550/arxiv.2208.00636 · Cited by 47
Collaborative Multi-Dynamic Pattern Modeling for Human Motion Prediction
Tang, J. H., Zhang, J., Ding, R., Gu, B., & Yin, J. (2023) · IEEE Transactions on Circuits and Systems for Video Technology · doi:10.1109/tcsvt.2023.3239322 · Cited by 53
“In recent years, many works [34], [35], [36], [37], [38], [39], [40] from both human motion prediction and skeletal action recognition have proved the effectiveness of modeling human motion patterns in multi-level by cropping or down-sampling human pose sequences.”
BackgroundDodrio: Exploring Transformer Models with Interactive Visualization
Wang, Z. J., Turko, R., & Chau, D. H. (2021) · Annual Meeting of the Association for Computational Linguistics: System Demonstrations (ACL Demo) · doi:10.18653/v1/2021.acl-demo.16 · Cited by 57
Yu, Z., Wang, Z., Fu, Y., Shi, H., Shaikh, K., & Lin, Y. (2024) · International Conference on Machine Learning · doi:10.48550/arxiv.2406.15765 · Cited by 93
“For instance, (Clark et al., 2019b) visualizes specific types of attention patterns in pretrained BERT (Devlin et al., 2018), and (Vig, 2019) identifies biases and localized relevant attention heads.”
Transformers in health: a systematic review on architectures for longitudinal data analysis
Siebra, C., Kurpicz-Briki, M., & Wac, K. (2024) · Artificial Intelligence Review · doi:10.1007/s10462-023-10677-z · Cited by 52
“This temporal distribution emphasizes that no paper was identified in the initial two years of our search (2018 and 2019).”
VisBERT: Hidden-State Visualizations for Transformers
van Aken, B., Winter, B., Löser, A., & Gers, F. A. (2020) · International World Wide Web Conference (WWW) · doi:10.1145/3366424.3383542 · Cited by 45
“ristic for visualizing the changes that are being made to the tokens’ representations in each layer. In contrast to analysing the single attention weights within BERT’s attention heads as proposed by [14], this method allows us to observe the actual outcomes of the whole encoder module in each layer. Each layer of BER…”
“Subverting the Jewtocracy”: Online Antisemitism Detection Using Multimodal Deep Learning
Chandra, M., Pailla, D. R., Bhatia, H., Sanchawala, A., Gupta, M., Shrivastava, M., & Kumaraguru, P. (2021) · ACM Web Science Conference (WebSci) · doi:10.1145/3447535.3462502 · Cited by 73
“To gain better insights into the the proposed system, we visualize attention weights for both the Text + OCR (using bertviz [33]) and the Image encoder (using GradCAM [27]).”
MethodMulti-Label and Multilingual News Framing Analysis
Akyürek, A. F., Guo, L., Elanwar, R. I., Ishwar, P., Betke, M., & Wijaya, D. T. (2020) · Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2020.acl-main.763 · Cited by 61
“To visualize our multi-label model we use the visualization tool by Vig (2019) in Figure 1.”
MethodTransformer-Based Language-Person Search With Multiple Region Slicing
Li, H., Xiao, J., Sun, M., Lim, E. G., & Zhao, Y. (2021) · IEEE Transactions on Circuits and Systems for Video Technology · doi:10.1109/tcsvt.2021.3073718 · Cited by 46
An exploratory study on code attention in BERT
Sharma, R., Chen, F., Fard, F. H., & Lo, D. (2022) · IEEE International Conference on Program Comprehension (ICPC) · doi:10.1145/3524610.3527921 · Cited by 57
The promises of large language models for protein design and modeling
Valentini, G., Malchiodi, D., Gliozzo, J., Mesiti, M., Soto-Gomez, M., Cabri, A., Reese, J., Casiraghi, E., & Robinson, P. N. (2023) · Frontiers in Bioinformatics · doi:10.3389/fbinf.2023.1304099 · Cited by 48
“Indeed each attention head can capture different types of syntactic and semantic relationships between the elements of the sequence (Vig, 2019).”
BackgroundInfluentialExploring the Latest Applications of OpenAI and ChatGPT: An In-Depth Survey
Hong, Z., & Shao, H. (2024) · Computer Modeling in Engineering & Sciences · doi:10.32604/cmes.2023.030649 · Cited by 47
Chen, Z., Xie, Y., Wu, Y., Lin, Y., Tomiya, S., & Lin, J. (2024) · Digital Discovery · doi:10.1039/d3dd00198a · Cited by 46
Robustifying Token Attention for Vision Transformers
Guo, Y. X., Stutz, D., & Schiele, B. (2023) · IEEE/CVF International Conference on Computer Vision (ICCV) · doi:10.1109/iccv51070.2023.01610 · Cited by 61
“Similar to us, some related works [66, 10, 44, 34, 45] also investigate and visualize the self-attention in order to improve transformer architectures, e.”
BackgroundBiggiogera, J., Boateng, G., Hilpert, P., Vowels, M. J., Bodenmann, G., Neysari, M., Nußbeck, F. W., & Kowatsch, T. (2021) · Companion Publication of the International Conference on Multimodal Interaction (ICMI Companion) · doi:10.1145/3461615.3485423 · Cited by 45
“though LIWC features (and indeed, TF-IDF) have the advantage of being simpler and more easily interpretable, various approaches are being developed to make BERT features more interpretable via its multi-head attention mechanism [45] and Shapley [28].”
MethodDeep Learning-Based Knowledge Graph Generation for COVID-19
Kim, T., Yun, Y. I., & Kim, N. (2021) · Sustainability · doi:10.3390/su13042276 · Cited by 42
Nugent, T., Stelea, N., & Leidner, J. L. (2021) · Lecture notes in computer science · doi:10.1007/978-3-030-86967-0_12 · Cited by 54
Deep Learning Image Captioning in Construction Management: A Feasibility Study
Xiao, B., Wang, Y., & Kang, S.-C. (2022) · Journal of Construction Engineering and Management · doi:10.1061/(asce)co.1943-7862.0002297 · Cited by 42
Ryu, S. H., & Lewis, R. L. (2021) · Workshop on Cognitive Modeling and Computational Linguistics (CMCL) · doi:10.18653/v1/2021.cmcl-1.6 · Cited by 65
Yang, Y., Hou, Z., Wang, Y., Ma, H., Sun, P., Ma, Z., Wong, K., & Li, X. (2022) · Briefings in Bioinformatics · doi:10.1093/bib/bbac027 · Cited by 37
EntityBERT: Entity-centric Masking Strategy for Model Pretraining for the Clinical Domain
Lin, C., Miller, T., Dligach, D., Bethard, S. J., & Savova, G. (2021) · Workshop on Biomedical Language Processing (BioNLP) · doi:10.18653/v1/2021.bionlp-1.21 · Cited by 56
“In Figure 5 we visualize with BertViz (Vig, 2019) the attention weights of head zero from the last layer of the fine-tuned RandMask and EntityBERT models on the TLINK task for a relation that Enti-tyBERT correctly predicted but RandMask missed.”
MethodAggarwal, T., Salatino, A. A., Osborne, F., & Motta, E. (2025) · Information Processing & Management · doi:10.1016/j.ipm.2025.104262 · Cited by 43
“Other directions include exploring explainability techniques, including SHAP values [96], attention visualization [97], and the identification of monosemantic features [98] to understand how LLMs process ontological relationships.”
CLiMP: A Benchmark for Chinese Language Model Evaluation
Xiang, B., Yang, C., Li, Y., Warstadt, A., & Kann, K. (2021) · Conference of the European Chapter of the Association for Computational Linguistics · doi:10.18653/v1/2021.eacl-main.242 · Cited by 87
A Case Study of the Shortcut Effects in Visual Commonsense Reasoning
Ye, K., & Kovashka, A. (2021) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v35i4.16428 · Cited by 50
“While curriculum learning (Jiang et al. 2015; Zamir et al. 2017; Zhang, David, and Gong 2017; Jiang et al. 2018) has been tried to decide the order of tasks for pre-training (Ma et al. 2019; Wang et al. 2020; Clark et al. 2020), to our knowledge, ours is the first method to mask using a curriculum.”
MethodExplainable Sentiment Analysis: A Hierarchical Transformer-Based Extractive Summarization Approach
Bacco, L., Cimino, A., Dell’Orletta⋄, F., & Merone, M. (2021) · Electronics · doi:10.3390/electronics10182195 · Cited by 40
GeoBERT: Pre-Training Geospatial Representation Learning on Point-of-Interest
Gao, Y., Xiong, Y., Wang, S., & Wang, H. (2022) · Applied Sciences · doi:10.3390/app122412942 · Cited by 45
ExBEHRT: Extended Transformer for Electronic Health Records
Rupp, M., Peter, O., & Pattipaka, T. (2023) · Lecture notes in computer science · doi:10.1007/978-3-031-39539-0_7 · Cited by 48
“Analogous to previous work (Li et al. (2020), Rasmy et al. (2021), Meng et al. (2021)), we visualised the attention of the last network layer using BertViz (Vig (2019)).”
MethodOn Exploring Attention-based Explanation for Transformer Models in Text Classification
Liu, S., Le, F., Chakraborty, S., & Abdelzaher, T. (2021) · IEEE International Conference on Big Data (BigData) · doi:10.1109/bigdata52589.2021.9671639 · Cited by 44
“In addition to this limitation, previous studies [13], [14] have emphasized that attention weights reflect the importance of – not the input words but – the contextual embeddings , and the contribution of contextual embedding h i may not directly map to the contribution of the i-th input word.”
BackgroundA scalable approach for developing clinical risk prediction applications in different hospitals
Sun, H., Depraetere, K., Meesseman, L., Roo, J. D., Vanbiervliet, M., Baerdemaeker, J. D., Muys, H., von Dossow, V., Hulde, N., & Szymanowsky, R. (2021) · Journal of Biomedical Informatics · doi:10.1016/j.jbi.2021.103783 · Cited by 33
GenNI: Human-AI Collaboration for Data-Backed Text Generation
Strobelt, H., Kinley, J., Krueger, R., Beyer, J., Pfister, H., & Rush, A. M. (2021) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2021.3114845 · Cited by 38
“BertViz [59] and exBert [21] allow a deep look into the attention mechanisms of transformer models.”
Graph Convolutional Network Based on Multi-Head Pooling for Short Text Classification
Zhao, H., Xie, J., & Wang, H. (2022) · IEEE Access · doi:10.1109/access.2022.3146303 · Cited by 35
“Therefore, the multi-head method [25] [26] [27] is introduced to form multiple subspaces and enables the model to select nodes from different aspects.”
MethodDetectVul: A statement-level code vulnerability detection for Python
Tran, H.-C., Tran, A.-D., & Le, K.-H. (2024) · Future Generation Computer Systems · doi:10.1016/j.future.2024.107504 · Cited by 34
Applying Distilled BERT for Question Answering on ASRS Reports
Kierszbaum, S., & Lapasset, L. (2020) · New Trends in Civil Aviation (NTCA) · doi:10.23919/ntca50409.2020.9291241 · Cited by 31
Keyphrase Extraction from Scholarly Articles as Sequence Labeling using Contextualized EmbeddingsPreprint
Sahrawat, D., Mahata, D., Kulkarni, M., Zhang, H., Gosangi, R., Stent, A. J., Sharma, A., Kumar, Y., Shah, R. R., & Zimmermann, R. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1910.08840 · Cited by 36
“Using BertViz (Vig 2019) we analyzed the aggregated attention of all 12 layers of both models.”
MethodVisQA: X-raying Vision and Language Reasoning in Transformers
Jaunet, T., Kervadec, C., Vuillemot, R., Antipov, G., Baccouche, M., & Wolf, C. (2022) · IEEE Transactions on Visualization and Computer Graphics · doi:10.1109/tvcg.2021.3114683 · Cited by 30
Wang, T., Qin, S., & Chow, K. P. (2021) · IEEE International Conference on Computational Science and Engineering (CSE) · doi:10.1109/cse53436.2021.00030 · Cited by 30
Skip-Attention: Improving Vision Transformers by Paying Less Attention
Venkataramanan, S., Ghodrati, A., Asano, Y. M., Porikli, F., & Habibian, A. (2024) · International Conference on Learning Representations · doi:10.48550/arxiv.2301.02240 · Cited by 48
“Recent NLP works [51, 52] have shown that self-attention across adjacent layers in SoTA language models exhibit very high correlation.”
BackgroundInteractive 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) · arXiv · doi:10.48550/arxiv.2208.07852 · 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…”
Large Language Models for Psychological Assessment: A Comprehensive Overview
Brickman, J., Gupta, M., & Oltmanns, J. R. (2025) · Advances in Methods and Practices in Psychological Science · doi:10.1177/25152459251343582 · Cited by 50
“Attention weights for each token in the input text can also be visualized (Vig, 2019).”
Rocha, T. M., & Carvalho, A. L. D. C. (2021) · IEEE Access · doi:10.1109/access.2021.3066283 · Cited by 35
“To allow us to visualize this learning, we used the BertViz visualization tool created by [54], which relates each word to each other for each layer and head present in the BERT model.”
MethodTeaching Temporal Logics to Neural NetworksPreprint
Hahn, C., Schmitt, F., Kreber, J. U., Rabe, M. N., & Finkbeiner, B. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2003.04218 · Cited by 41
“In our visualizations, for example in Figure 3, stronger colored edges correspond to a higher attention value [47].”
BackgroundSemantic-aware Binary Code Representation with BERTPreprint
Koo, H., Park, S., Choi, D., & Kim, T. (2021) · arXiv.org · doi:10.48550/arxiv.2106.05478 · Cited by 33
Ikhwantri, F., Putra, J. W. G., Yamada, H., & Tokunaga, T. (2022) · Information Processing & Management · doi:10.1016/j.ipm.2022.103195 · Cited by 34
SkinDistilViT: Lightweight Vision Transformer for Skin Lesion Classification
Lungu-Stan, V.-C., Cercel, D.-C., & Pop, F. (2023) · Lecture notes in computer science · doi:10.1007/978-3-031-44207-0_23 · Cited by 38
Understanding Addition in Transformers
Quirke, P., & Barez, F. (2023) · International Conference on Learning Representations · doi:10.48550/arxiv.2310.13121 · Cited by 36
“Their multi-layered architecture and numerous parameters make it difficult to comprehend how they derive specific outputs (Vig, 2019).”
BackgroundInformation Extraction From Free-Form CV Documents in Multiple Languages
Vukadin, D., Kurdija, A. S., Delač, G., & Šilić, M. (2021) · IEEE Access · doi:10.1109/access.2021.3087913 · Cited by 35
Relative Importance in Sentence Processing
Hollenstein, N., & Beinborn, L. (2021) · Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2021.acl-short.19 · Cited by 44
“These weights are optimized with respect to a target objective and higher attention for an input token has been interpreted as higher importance with respect to the output (Vig, 2019).”
BackgroundLatent spaces for antimicrobial peptide design
Renaud, S., & Mansbach, R. A. (2023) · Digital Discovery · doi:10.1039/d2dd00091a · Cited by 29
Zhang, T., Tan, T., Wang, X., Gao, Y., Han, L., Balkenende, L., D'Angelo, A. R., Bao, L., Horlings, H. M., Teuwen, J., et al. (2023) · Cell Reports Medicine · doi:10.1016/j.xcrm.2023.101131 · Cited by 28
“30 The attention patterns produced by one or more attention heads in a given layer were visualized based on attention-head view.”
BackgroundSelf-supervised multi-modality learning for multi-label skin lesion classification
Wang, H., Ahn, E., Bi, L., & Kim, J. (2025) · Computer Methods and Programs in Biomedicine · doi:10.1016/j.cmpb.2025.108729 · Cited by 29
On the Distribution, Sparsity, and Inference-time Quantization of Attention Values in Transformers
Ji, T., Jain, S., Ferdman, M., Milder, P. A., Schwartz, H. A., & Balasubramanian, N. (2021) · Findings of the Association for Computational Linguistics: ACL (Findings of ACL) · doi:10.18653/v1/2021.findings-acl.363 · Cited by 32
Filipavicius, M., Manica, M., Cadow, J., & Martínez, M. R. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2012.03084 · Cited by 29
“We can visualize the multi-head self-attention for the input sequence representation across the layers and heads [10, 36, 44], which can elucidate if the model learns the syntax and semantics necessary to perform well on prediction tasks.”
Ilinykh, N., & Dobnik, S. (2021) · Frontiers in Artificial Intelligence · doi:10.3389/frai.2021.767971 · Cited by 29
“We use the tools provided by Vig (2019) for visualisations.”
MethodUnlocking maintenance insights in industrial text through semantic search
Naqvi, S. M. R., Ghufran, M., Varnier, C., Nicod, J., Javed, K., & Zerhouni, N. (2024) · Computers in Industry · doi:10.1016/j.compind.2024.104083 · Cited by 51
Generating Realistic Tabular Data with Large Language Models
Nguyen, D., Gupta, S., Do, K., Nguyen, T., & Venkatesh, S. (2024) · Proceedings · doi:10.1109/icdm59182.2024.00040 · Cited by 37
“In Figure 4, we use BertViz [42] to visualize the attention links learned by ChatGPT-2 – the LLM model used in LLM-based methods such as Great [7], TapTap [48], and our Pred-LLM.”
MethodBERT-Based Mental Model, a Better Fake News Detector
Ding, J., Hu, Y., & Chang, H. (2020) · International Conference on Computing and Artificial Intelligence (ICCAI) · doi:10.1145/3404555.3404607 · Cited by 32
Recognition Method of New Address Elements in Chinese Address Matching Based on Deep Learning
Zhang, H., Ren, F., Li, H., Yang, R., Zhang, S., & Du, Q. (2020) · ISPRS International Journal of Geo-Information · doi:10.3390/ijgi9120745 · Cited by 26
“For the same color, the darker the color, the greater the weight—that is, the greater the score of the attention on this token [37].”
BackgroundVLDeformer: Vision–Language Decomposed Transformer for fast cross-modal retrieval
Zhang, L., Wu, H., Chen, Q., Deng, Y., Siebert, J. I., Li, Z., Han, Y., Kong, D., & Cao, Z. (2022) · Knowledge-Based Systems · doi:10.1016/j.knosys.2022.109316 · Cited by 26
“The visualized samples are from the COCO 1k test set and depicted by the VIG tool [25].”
MethodStress Test Evaluation of Transformer-based Models in Natural Language Understanding TasksPreprint
Aspillaga, C., Carvallo, A., & Araujo, V. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2002.06261 · Cited by 38
“For both evaluations, we also explored the attention weights via the BertViz library (Vig, 2019).”
MethodHow Transferable are Reasoning Patterns in VQA?
Kervadec, C., Jaunet, T., Antipov, G., Baccouche, M., Vuillemot, R., & Wolf, C. (2021) · 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · doi:10.1109/cvpr46437.2021.00419 · Cited by 25
“In the line of recent work in AI explainability [28, 32], and data visualization [18, 38, 11], we propose an indepth analysis of attention mechanisms in Transformerbased models and provide indications of the patterns of reasoning employed by models of different strengths.”
MethodAshayeri, M., & Abbasabadi, N. (2024) · Energy and Buildings · doi:10.1016/j.enbuild.2024.113914 · Cited by 30
Sparsity-Guided Holistic Explanation for LLMs with Interpretable Inference-Time Intervention
Tan, Z., Chen, T., Zhang, Z., & Liu, H. (2024) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v38i19.30160 · Cited by 45
LazyFormer: Self Attention with Lazy UpdatePreprint
Ying, C., Ke, G., He, D., & Liu, T. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2102.12702 · Cited by 30
“Vig and Yonatan (2019); Vig (2019) show the attention matrices are similar in different layers, especially in the adjacent layers.”
BackgroundGenerative Pre-Training from MoleculesPreprint
Adilov, S. (2021) · ChemRxiv · doi:10.26434/chemrxiv-2021-5fwjd · Cited by 40
“Such software packages as HuggingFace Transformers [Wolf et al., 2020], BertViz [Vig, 2019], and AdapterHub [Pfeiffer et al., 2020] became widely popular among NLP practitioners.”
Analyzing Encoded Concepts in Transformer Language Models
Sajjad, H., Durrani, N., Dalvi, F., Alam, F., Khan, A., & Xu, J. (2022) · Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies · doi:10.18653/v1/2022.naacl-main.225 · Cited by 24
Explainable Pre-Trained Language Models for Sentiment Analysis in Low-Resourced Languages
Mabokela, K. R., Primus, M., & Çelik, T. (2024) · Big Data and Cognitive Computing · doi:10.3390/bdcc8110160 · Cited by 29
Explainable AI: XAI-guided context-aware data augmentation
Mersha, M. A., Yigezu, M. G., Tonja, A. L., Shakil, H., Iskandar, S., Kolesnikova, O., & Kalita, J. (2025) · Expert Systems with Applications · doi:10.1016/j.eswa.2025.128364 · Cited by 32
“Attention mechanism visualization helps interpret how attention layers focus on input tokens [32].”
Mylonas, N., Mollas, I., & Tsoumakas, G. (2023) · Data Mining and Knowledge Discovery · doi:10.1007/s10618-023-00962-4 · Cited by 28
BiasTestGPT: Using ChatGPT for Social Bias Testing of Language ModelsPreprint
Kocielnik, R., Prabhumoye, S., Zhang, V., Jiang, R., Alvarez, R. M., & Anandkumar, A. (2023) · arXiv (Cornell University) · doi:10.48550/arxiv.2302.07371 · Cited by 31
Ni, B., Glaser, B., & Taheri-Mousavi, S. M. (2025) · npj Computational Materials · doi:10.1038/s41524-025-01768-2 · Cited by 23
“Theattentionweightscalculatedwithinthemoftenprovide insights to understand the “ thinking ” process of LLM for natural language applications 72 .”
LMdiff: A Visual Diff Tool to Compare Language Models
Strobelt, H., Hoover, B., Satyanaryan, A., & Gehrmann, S. (2021) · Conference on Empirical Methods in Natural Language Processing: System Demonstrations (EMNLP) · doi:10.18653/v1/2021.emnlp-demo.12 · Cited by 26
“Many such tools exist, for example to inspect attention mechanisms (Hoover et al., 2020; Vig, 2019), explain translations through nearest neighbors (Strobelt et al.”
BackgroundTopoBERT: Exploring the topology of fine-tuned word representations
Rathore, A., Zhou, Y., Srikumar, V., & Wang, B. (2023) · Information Visualization · doi:10.1177/14738716231168671 · Cited by 38
“The BertViz system by Vig 66 visualizes self-attention in transformer-based models to increase interpretability.”
Resilience Assessment of Large Language Models under Transient Hardware Faults
Agarwal, U. K., Chan, A., & Pattabiraman, K. (2023) · Proceedings/Proceedings - International Symposium on Software Reliability Engineering · doi:10.1109/issre59848.2023.00052 · Cited by 35
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.