Analyzing the Structure of Attention in a Transformer Language Model
Open accessThe DOI matches its Crossref record; 29 of the 29 references it cites were found in a registry or an index.
Abstract
The Transformer is a fully attention-based alternative to recurrent networks that has achieved state-of-the-art results across a range of NLP tasks.In this paper, we analyze the structure of attention in a Transformer language model, the GPT-2 small pretrained model.We visualize attention for individual instances and analyze the interaction between attention and syntax over a large corpus.We find that attention targets different parts of speech at different layer depths within the model, and that attention aligns with dependency relations most strongly in the middle layers.We also find that the deepest layers of the model capture the most distant relationships.Finally, we extract exemplar sentences that reveal highly specific patterns targeted by particular attention heads.
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
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 [96]
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 [96]
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
“Previous research (Vig & Belinkov, 2019;Jo & Myaeng, 2020;Geva et al., 2021;Wan et al., 2022), which has shown that deep layers encode semantic information and distal relationships within sentences.”
From From Imitation to Introspection: Probing Self-Consciousness in Language Models (2025) · cites this paper as Vig & Belinkov, 2019
Experimental — accuracy not yet measuredThe cited source says what the claim attributes to it.
In the citing paper
“Attention visualization [17] shows what tokens the model attends to, but attention doesn't always reflect importance.”
From AgentSHAP: Interpreting LLM Agent Tool Importance with Monte Carlo Shapley Value Estimation (2025) · cites this paper as [17]
The check wasn’t confident either way, so it gives no verdict — never disputed.
In the citing paper
“No existing XAI methods address tool-level explanations.”
From AgentSHAP: Interpreting LLM Agent Tool Importance with Monte Carlo Shapley Value Estimation (2025) · cites this paper as [17]
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 4×
“, 2018), which are based on the Transformer (Vaswani et al., 2017).”
BackgroundMethodInfluentialBERT: 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 7×
“We also adapt the original encoder-decoder implementation to the decoder-only GPT-2 model, as well as the encoder-only BERT model.”
BackgroundMethodInfluentialBERT: 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 7×
“We also adapt the original encoder-decoder implementation to the decoder-only GPT-2 model, as well as the encoder-only BERT model.”
BackgroundMethodInfluentialNeural 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
Deep Contextualized Word Representations
Peters, M., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., & Zettlemoyer, L. (2018) · Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers) · doi:10.18653/v1/n18-1202 · Cited by 11,983 · cited 3×
“Contextual word representations have recently been used to achieve state-of-the-art performance across a range of language understanding tasks (Peters et al., 2018; Radford et al., 2018; Devlin et al., 2018).”
BackgroundMethodTransformer-XL: Attentive language models beyond a fixed-length context
Dai, Z., Yang, Z., Yang, Y., Carbonell, J., Le, Q., & Salakhutdinov, R. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/p19-1285 · Cited by 3,169 · cited 1×
“We would also like to analyze attention patterns in text much longer than a single sentence, especially for new Trans-former variants such as the Transformer-XL (Dai et al., 2019) and Sparse Transformer (Child et al., 2019), which can handle very long contexts.”
MethodKemp, 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.”
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,023 · cited 1×
“Analyzing attention is a simpler process that also produces human-interpretable descriptions of model behavior, though recent work casts doubt on its role in explaining individual predictions (Jain and Wallace, 2019).”
BackgroundBERT Rediscovers the Classical NLP Pipeline
Tenney, I., Das, D., & Pavlick, E. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/p19-1452 · Cited by 1,307 · cited 2×
“In a Transformer model, the middle layers were most predictive of dependencies (Liu et al., 2019; Tenney et al., 2019).”
MethodResult
Cited by
A primer in BERTology: What we know about how BERT works
Rogers, A., Kovaleva, O., & Rumshisky, A. (2020) · Transactions of the Association for Computational Linguistics · doi:10.1162/tacl_a_00349 · Cited by 1,552
(2024) · doi:10.1109/access.2024.3365742 · Cited by 934
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
“The illustration is based on Vig et al. (Vig, 2019; Vig & Belinkov, 2019).”
MethodRethinking Spatial Dimensions of Vision Transformers
Heo, B., Yun, S., Han, D., Chun, S., Choe, J., & Oh, S. J. (2021) · 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · doi:10.1109/iccv48922.2021.01172 · Cited by 640
“The entropy and distance pattern of ViT is similar to the pattern of transformer in the language domain [35].”
BackgroundMethodInfluentialA Multiscale Visualization of Attention in the Transformer Model
Vig, J. (2019) · Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations · doi:10.18653/v1/p19-3007 · Cited by 600
“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).”
BackgroundSelf-citationFNet: Mixing Tokens with Fourier Transforms
Lee-Thorp, J., Ainslie, J., Eckstein, I., & Ontanon, S. (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.319 · Cited by 519
Towards Faithfully Interpretable NLP Systems: How Should We Define and Evaluate Faithfulness?
Jacovi, A., & Goldberg, Y. (2020) · Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2020.acl-main.386 · Cited by 503
Transformer Feed-Forward Layers Are Key-Value Memories
Geva, M., Schuster, R., Berant, J., & Levy, O. (2021) · Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2021.emnlp-main.446 · Cited by 353
“The study of the transformer architecture has focused on the role and function of self-attention layers (Voita et al., 2019; Clark et al., 2019; Vig and Belinkov, 2019) and on inter-layer differences (i.e. lower vs. upper layers) (Tenney et al., 2019; Jawahar et al., 2019).”
BackgroundTransformer Feed-Forward Layers Are Key-Value Memories
Geva, M., Schuster, R., Berant, J., & Levy, O. (2020) · arXiv · doi:10.48550/arxiv.2012.14913 · Cited by 353
Dissociating language and thought in large language models
Mahowald, K., Ivanova, A. A., Blank, I. A., Kanwisher, N., Tenenbaum, J. B., & Fedorenko, E. (2024) · Trends in Cognitive Sciences · doi:10.1016/j.tics.2024.01.011 · Cited by 345
“…to some extent by allowing different attention heads to attend to different input features (e.g. Manning et al., 2020; Vaswani et al., 2017; Vig and Belinkov, 2019); certain approaches promote modularization even more explicitly, e.g., by endowing transformers with a mixture-of-experts…”
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
“Prior work in NLP also suggests that deeper layers in text-based Transformers attend to more complex properties [83] and encode higher-level representations [36, 56, 58, 76].”
BackgroundSelf-citationDocument-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling
Zhou, W., Huang, K., Ma, T., & Huang, J. (2021) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v35i16.17717 · Cited by 316
Pose Recognition with Cascade Transformers
Li, K., Wang, S., Zhang, X., Xu, Y., Xu, W., & Tu, Z. (2021) · 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · doi:10.1109/cvpr46437.2021.00198 · Cited by 301
Attention, please! A survey of neural attention models in deep learning
de Santana Correia, A., & Colombini, E. L. (2022) · Artificial Intelligence Review · doi:10.1007/s10462-022-10148-x · Cited by 298
“On the other hand, some studies have found how attention in neural models captures various notions of syntax and co-reference (Vig and Belinkov 2019) (Clark et al.”
BackgroundExtraction 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
“For example, in NLP, it has been shown that certain heads learn dependency and part of speech relationships between words (52, 53).”
BackgroundPrediction of chemical reaction yields using deep learning
Schwaller, P., Vaucher, A. C., Laino, T., & Reymond, J.-L. (2021) · Machine Learning: Science and Technology · doi:10.1088/2632-2153/abc81d · Cited by 291
“Future work could (visually) investigate the attention weights to find out what tokens and molecules contribute the most to the predictions [34, 35].”
BackgroundFrom Zero to Hero: On the Limitations of Zero-Shot Language Transfer with Multilingual Transformers
Lauscher, A., Ravishankar, V., Vulić, I., & Glavaš, G. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.363 · Cited by 236
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].”
BackgroundCompositionality Decomposed: How do Neural Networks Generalise?
Hupkes, D., Dankers, V., Mul, M., & Bruni, E. (2020) · Journal of Artificial Intelligence Research · doi:10.1613/jair.1.11674 · Cited by 194
Knowledge Neurons in Pretrained Transformers
Dai, D., Dong, L., Hao, Y., Sui, Z., Chang, B., & Wei, F. (2022) · Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/2022.acl-long.581 · Cited by 187
Enriching contextualized language model from knowledge graph for biomedical information extraction
Fei, H., Ren, Y., Zhang, Y., Ji, D., & Liang, X. (2021) · Briefings in Bioinformatics · doi:10.1093/bib/bbaa110 · Cited by 172
Transforming 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
How Context Affects Language Models' Factual Predictions
Petroni, F., Lewis, P., Piktus, A., Rocktäschel, T., Wu, Y., Miller, A. H., & Riedel, S. (2020) · arXiv · doi:10.48550/arxiv.2005.04611 · Cited by 154
“…of “probes” have been developed to analyse the syntactic structures, such as syntax trees [Marvin and Linzen, 2018, Hewitt and Manning, 2019, Vig and Belinkov, 2019], negative polarity items [Warstadt and Bowman, 2019, Warstadt et al., 2019], semantic fragments [Richardson et al., 2019],…”
BackgroundexBERT: 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
“Previous studies have uncovered specific attention heads that learn particular dependencies (Vig and Belinkov, 2019; Clark et al., 2019).”
BackgroundWhat Happens To BERT Embeddings During Fine-tuning?
Merchant, A., Rahimtoroghi, E., Pavlick, E., & Tenney, I. (2020) · Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP · doi:10.18653/v1/2020.blackboxnlp-1.4 · Cited by 139
When BERT Plays the Lottery, All Tickets Are Winning
Prasanna, S., Rogers, A., & Rumshisky, A. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.259 · Cited by 131
Tenney, I., Wexler, J., Bastings, J., Bolukbasi, T., Coenen, A., Gehrmann, S., Jiang, E., Pushkarna, M., Radebaugh, C., Reif, E., et al. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations · doi:10.18653/v1/2020.emnlp-demos.15 · Cited by 138
Attention Interpretability Across NLP Tasks
Vashishth, S., Upadhyay, S., Tomar, G. S., & Faruqui, M. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1909.11218 · Cited by 63
“While on the other hand, some studies have discovered how attention in neural models captures several linguistic notions of syntax and coreference (Vig & Belinkov, 2019; Clark et al., 2019; Tenney et al., 2019).”
BackgroundOn the Explainability of Natural Language Processing Deep Models
Zini, J. E., & Awad, M. (2023) · ACM Computing Surveys · doi:10.1145/3529755 · Cited by 120
“The authors in [116] study the interaction between the syntax and the attention weights in GPT-2 [86].”
BackgroundMethodInfluentialAMP‐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
“Interestingly, the residues are able to capture the actual structural dependencies between residues in the middle layers (Vig & Belinkov, 2019), as exhibited by the subsequent attention visualizations of Layer 14 in Figure 4b,c.”
BackgroundAre Transformers universal approximators of sequence-to-sequence functions?Preprint
Yun, C., Bhojanapalli, S., Rawat, A. S., Reddi, S. J., & Kumar, S. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1912.10077 · Cited by 415
“One such line of work focuses on probing the output of attention layers to understand the attention mechanism and internal language representation (Hewitt & Manning, 2019; Clark et al., 2019; Co-enen et al., 2019; Vig & Belinkov, 2019).”
BackgroundAdvances of machine learning in materials science: Ideas and techniques
Chong, S. S., Ng, Y. S., Wang, H., & Zheng, J. (2023) · Frontiers of Physics · doi:10.1007/s11467-023-1325-z · Cited by 126
Language Model Behavior: A Comprehensive Survey
Chang, T. A., & Bergen, B. K. (2024) · Computational Linguistics · doi:10.1162/coli_a_00492 · Cited by 105
Xia, Y., Shenoy, M., Jazdi, N., & Weyrich, M. (2023) · 2023 IEEE 28th International Conference on Emerging Technologies and Factory Automation (ETFA) · doi:10.1109/etfa54631.2023.10275362 · Cited by 103
“5 Attention mechanism is analyzed and visualized in [17].”
BackgroundInformation flow across the cortical timescale hierarchy during narrative construction
Chang, C. H. C., Nastase, S. A., & Hasson, U. (2022) · Proceedings of the National Academy of Sciences · doi:10.1073/pnas.2209307119 · Cited by 92
Fixed Encoder Self-Attention Patterns in Transformer-Based Machine Translation
Raganato, A., Scherrer, Y., & Tiedemann, J. (2020) · Findings of the Association for Computational Linguistics: EMNLP 2020 · doi:10.18653/v1/2020.findings-emnlp.49 · Cited by 86
Towards Transparent and Explainable Attention Models
Mohankumar, A. K., Nema, P., Narasimhan, S., Khapra, M. M., Srinivasan, B. V., & Ravindran, B. (2020) · Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics · doi:10.18653/v1/2020.acl-main.387 · Cited by 91
Shared functional specialization in transformer-based language models and the human brain
Kumar, S., Sumers, T. R., Yamakoshi, T., Goldstein, A., Hasson, U., Norman, K. A., Griffiths, T. L., Hawkins, R. D., & Nastase, S. A. (2024) · Nature Communications · doi:10.1038/s41467-024-49173-5 · Cited by 86
“4), we followed a procedure similar to the “ attention distance ” measure 152 .”
MethodA 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).”
BackgroundIs Attention Explanation? An Introduction to the Debate
Bibal, A., Cardon, R., Alfter, D., Wilkens, R., Wang, X., François, T., & Watrin, P. (2022) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2022.acl-long.269 · Cited by 229
“Later in their paper, they also mention, like Galassi et al. (2020), that some works show that attention in transformers focuses on syntacti-215 cal structures (Voita et al., 2018; Vig and Belinkov, 2019; Tenney et al., 2019; Clark et al., 2019).”
BackgroundAttentionViz: 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
“[47] briefly mentions that the first token is treated as a null position for attentionreceiving in GPT-2 “when the linguistic property captured by the attention head doesn’t appear in the input text.”
BackgroundDissociating language and thought in large language models
Mahowald, K., Ivanova, A. A., Blank, I. A., Kanwisher, N., Tenenbaum, J. B., & Fedorenko, E. (2023) · arXiv · doi:10.48550/arxiv.2301.06627 · Cited by 80
Contextual and Non-Contextual Word Embeddings: an in-depth Linguistic Investigation
Miaschi, A., & Dell’Orletta, F. (2020) · Proceedings of the 5th Workshop on Representation Learning for NLP · doi:10.18653/v1/2020.repl4nlp-1.15 · Cited by 72
“…et al., 2017) to more domain specific approaches, such as interpreting attention mechanisms (Raganato and Tiedemann, 2018; Kovaleva et al., 2019; Vig and Belinkov, 2019) or designing specific probing tasks that a model can solve only if it captures a precise linguistic phenomenon using the…”
BackgroundWhat do they capture?: a structural analysis of pre-trained language models for source code
Wan, Y., Zhao, W., Zhang, H., Sui, Y., Xu, G., & Jin, H. (2022) · Proceedings of the 44th International Conference on Software Engineering · doi:10.1145/3510003.3510050 · Cited by 73
“The attention variability is formally defined as follows [40]:”
BackgroundDo Syntax Trees Help Pre-trained Transformers Extract Information?
Sachan, D., Zhang, Y., Qi, P., & Hamilton, W. L. (2021) · Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume · doi:10.18653/v1/2021.eacl-main.228 · Cited by 68
Retrofitting Structure-aware Transformer Language Model for End Tasks
Fei, H., Ren, Y., & Ji, D. (2020) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.168 · Cited by 125
Look Before You Leap: An Exploratory Study of Uncertainty Analysis for Large Language Models
Huang, Y., Song, J., Wang, Z., Zhao, S., Chen, H., Juefei-Xu, F., & Ma, L. (2025) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2024.3519464 · Cited by 339
“Therefore, “white-box” analysis for interpreting LLMs (e.g., inspecting neuron activation [85], inspecting attention values [86], [87]) that requires both significant manual and computational efforts is not feasible.”
Understanding Attention for Text Classification
Sun, X., & Lu, W. (2020) · Proceedings of the conference - Association for Computational Linguistics. Meeting · doi:10.18653/v1/2020.acl-main.312 · Cited by 94
“Vig and Belinkov (2019) analyzed the attention structure on the Transformer (Vaswani et al., 2017) language model as well as GPT-2 (Radford et al., 2019) pre-trained model.”
BackgroundPrediction of RNA–protein interactions using a nucleotide language model
Yamada, K., & Hamada, M. (2022) · Bioinformatics Advances · doi:10.1093/bioadv/vbac023 · Cited by 68
“Researchers in an emerging field, called BERTology, intend to elucidate how BERT learns contextual information by analyzing attention, which essentially represents the flow of information within a model (Vig and Belinkov, 2019).”
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
“Attention to the first token may be null attention (Vig and Belinkov, 2019).”
BackgroundSelf-citationAssessing Phrasal Representation and Composition in Transformers
Yu, L., & Ettinger, A. (2020) · Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2020.emnlp-main.397 · Cited by 58
Interpreting Attention Models with Human Visual Attention in Machine Reading Comprehension
Sood, E., Tannert, S., Frassinelli, D., Bulling, A., & Vu, N. T. (2020) · Conference on Computational Natural Language Learning · doi:10.18653/v1/2020.conll-1.2 · Cited by 102
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
Qiao, M., He, X., Cheng, X., Li, P., Zhao, Q., Zhao, C., & Tian, Z. (2022) · Information Sciences · doi:10.1016/j.ins.2022.10.112 · Cited by 66
Mishra, A. K., Renganathan, J., & Gupta, A. (2024) · Engineering Applications of Artificial Intelligence · doi:10.1016/j.engappai.2024.108223 · Cited by 66
Harnessing AI for solar energy: Emergence of transformer models
Hanif, M. F., & Mi, J. (2024) · Applied Energy · doi:10.1016/j.apenergy.2024.123541 · Cited by 68
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
Development of Language Models for Continuous Uzbek Speech Recognition System
Mukhamadiyev, A., Mukhiddinov, M., Khujayorov, I., Ochilov, M., & Cho, J. (2023) · Sensors · doi:10.3390/s23031145 · Cited by 64
“Methods for developing attention-based language models were also presented in [57,58].”
MethodShort-Text Semantic Similarity (STSS): Techniques, Challenges and Future Perspectives
Amur, Z. H., Hooi, Y. K., Bhanbhro, H., Dahri, K., & Soomro, G. M. (2023) · Applied Sciences · doi:10.3390/app13063911 · Cited by 78
An explainable attention network for fraud detection in claims management
Farbmacher, H., Löw, L., & Spindler, M. (2020) · Journal of Econometrics · doi:10.1016/j.jeconom.2020.05.021 · Cited by 52
“Some recent studies have analyzed the interpretability of attention weights for particular applications (for instance, Jain and Wallace 2019, Jain et al. 2019, Vig and Belinkov 2019, Vashishth et al. 2019).”
BackgroundSupervising Model Attention with Human Explanations for Robust Natural Language Inference
Stacey, J., Belinkov, Y., & Rei, M. (2022) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v36i10.21386 · Cited by 86
“As the attention heads can have different roles (Clark et al. 2019; Vig and Belinkov 2019), when supervising an existing self-attention layer we investigate how many and which heads should be supervised.”
BackgroundSelf-citationSmart Contract Vulnerability Detection: The Role of Large Language Model (LLM)
Boi, B., Esposito, C., & Lee, S. (2024) · ACM SIGAPP Applied Computing Review · doi:10.1145/3687251.3687253 · Cited by 41
“This mechanism allows the model to weigh the importance of different words in a sentence, enabling it to understand context and meaning more deeply than previous models [37].”
Zero-Shot Learning for Cross-Lingual News Sentiment Classification
Pelicon, A., Pranjić, M., Miljković, D., Škrlj, B., & Pollak, S. (2020) · Applied Sciences · doi:10.3390/app10175993 · Cited by 67
“The existing toolkits that offer the exploration of attention have been actively developed in recent years [41,42] and are widely used to better understand a given model’s behavior.”
BackgroundLinguistic Profiling of a Neural Language Model
Miaschi, A., Brunato⋄, D., Dell’Orletta⋄, F., & Venturi⋄, G. (2020) · International Conference on Computational Linguistics · doi:10.18653/v1/2020.coling-main.65 · Cited by 102
“…et al., 2017) to more domain specific approaches, such as interpreting attention mechanisms (Raganato and Tiedemann, 2018; Kovaleva et al., 2019; Vig and Belinkov, 2019), studying correlations between representations (Saphra and Lopez, 2019) or designing specific probing tasks that a model can…”
BackgroundexBERT: 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
“Vig and Belinkov [2019] also explored the dependency relations across heads and discovered that initial layers typically encode positional relations, middle layers capture the most dependency relations, and later layers look for unique patterns and structures.”
BackgroundVL-InterpreT: An Interactive Visualization Tool for Interpreting Vision-Language Transformers
Aflalo, E., Du, M., Tseng, S.-Y., Liu, Y., Wu, C., Duan, N., & Lal, V. (2022) · IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings · doi:10.1109/cvpr52688.2022.02072 · Cited by 91
“Interpretability of NLP transformers was initially approached through the analysis of attention to capture its alignments with syntactic or semantic relationships [8, 31].”
MethodOn Attention Redundancy: A Comprehensive Study
Bian, Y., Huang, J., Cai, X., Yuan, J., & Church, K. (2021) · Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT) · doi:10.18653/v1/2021.naacl-main.72 · Cited by 68
“Vig and Belinkov (2019) argued that middle and last attention layers can extract dependency relations and distant information, respectively.”
BackgroundA Transformer-Based Neural Machine Translation Model for Arabic Dialects That Utilizes Subword Units
Baniata, L. H., Ampomah, I. K. E., & Park, S. (2021) · Sensors · doi:10.3390/s21196509 · Cited by 54
“[49], this approach is examined through computing two things;”
BackgroundMethodInfluential(2025) · doi:10.1038/s41467-025-57181-2 · Cited by 34
Natural language processing models reveal neural dynamics of human conversation
Cai, J., Hadjinicolaou, A. E., Paulk, A. C., Soper, D. J., Xia, T., Wang, A. F., Rolston, J. D., Richardson, R. M., Williams, Z. M., & Cash, S. S. (2025) · Nature Communications · doi:10.1038/s41467-025-58620-w · Cited by 63
“These models are capable of capturing speci fi c word sequences and their composition within phrases and sentences through hierarchical layers using vectors 34 – 36 .”
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
Arango-Argoty, G., Kipkogei, E., Stewart, R., Patra, A., Kagiampakis, I., & Jacob, E. (2023) · doi:10.1101/2023.09.12.23295357 · Cited by 34
Improving BERT Performance for Aspect-Based Sentiment AnalysisPreprint
Karimi, A., Rossi, L., & Prati, A. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2010.11731 · Cited by 68
“These heads have been designed to pay particular attention to parts of the input sentences that correspond to a particular given task [15].”
Recent advances in deep learning for protein-protein interaction: a review
Cui, J., Yang, S., Yi, L., Xi, Q., Yang, D., & Zuo, Y. (2025) · BioData Mining · doi:10.1186/s13040-025-00457-6 · Cited by 39
“2) [65].”
SANVis: Visual Analytics for Understanding Self-Attention Networks
Park, C., Choo, J., Na, I., Jo, Y., Shin, S., Yoo, J., Kwon, B. C., Zhao, J., Noh, H., & Lee, Y. (2019) · Visualization · doi:10.1109/visual.2019.8933677 · Cited by 41
“ies [6, 7, 27] aim to analyze the inner-workings of self-attention models.”
BackgroundExplainable 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
Santis, E. D., Martino, A., & Rizzi, A. (2024) · IEEE Transactions on Pattern Analysis and Machine Intelligence · doi:10.1109/tpami.2024.3358168 · Cited by 41
“This hypothesis is strengthened by some studies, such as in [19], where the structure of the self-attention mechanism is investigated on three levels of granularity (the attention-head level, the model level, and the neuron level) through a suitable visualization methodology.”
BackgroundMethodMulti-scale adaptive YOLO for instance segmentation of grape pedicels
Shen, Q., Zhang, X., Shen, M., & Xu, D. (2024) · Computers and Electronics in Agriculture · doi:10.1016/j.compag.2024.109712 · Cited by 36
Li, C., Yao, Z., Wu, X., Zhang, M., Holmes, C., Li, C., & He, Y. (2024) · Proceedings of the AAAI Conference on Artificial Intelligence · doi:10.1609/aaai.v38i16.29810 · Cited by 47
T-cell receptor binding prediction: A machine learning revolution
Weber, A., Pélissier, A., & Martínez, M. R. (2024) · ImmunoInformatics · doi:10.1016/j.immuno.2024.100040 · Cited by 37
“Intriguingly, different attention layers identified distinct information, supporting earlier NLP findings that deeper layers in text-based Transformers focus on more complex attributes and encode sophisticated representations [88, 89].”
BackgroundInterpreting Deep Learning Models in Natural Language Processing: A ReviewPreprint
Sun, X., Yang, D., Li, X., Zhang, T., Meng, Y., Qiu, H., Wang, G., Hovy, E. H., & Li, J. (2021) · arXiv (Cornell University) · doi:10.48550/arxiv.2110.10470 · Cited by 84
“[195] observed that the attention heads that focus on a particular POS tag tend to cluster by layer depth.”
BackgroundIlinykh, N., & Dobnik, S. (2021) · Frontiers in Artificial Intelligence · doi:10.3389/frai.2021.767971 · Cited by 29
“Similar to null attention observed in the analysis of textual models (Vig and Belinkov, 2019), we treat such attention links as non-informative.”
BackgroundMethodLarge Language Models in Legal Systems: A Survey
Dehghani, F., Dehghani, R., Ardebili, Y. N., & Rahnamayan, S. (2025) · Humanities and Social Sciences Communications · doi:10.1057/s41599-025-05924-3 · Cited by 44
“…fairness-aware training algorithms, and the use of counterfactual data augmentation to address social and legal bias in AI outputs (Binns, 2018; Weidinger et al., 2022 are being explored for their potential to provide insight into legal reasoning processes (Wachter et al., 2017; Vig, 2019).”
Self-Explaining Structures Improve NLP ModelsPreprint
Sun, Z., Fan, C. C., Han, Q., Sun, X., Meng, Y., Wu, F. Q., & Li, J. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2012.01786 · Cited by 62
“• AvgAttention: The method of averaging attention scores within a text span (Vig and Belinkov, 2019; Tenney et al., 2019; Clark et al., 2019).”
MethodExplainability-based Debugging of Machine Learning for Vulnerability Discovery
Sotgiu, A., Pintor, M., & Biggio, B. (2022) · International Conference on Availability, Reliability and Security (ARES) · doi:10.1145/3538969.3543809 · Cited by 33
“A line of studies analyzes the information flows in BERT, showing how this model is able to recognize structures in the input through the attention weights [6, 28].”
BackgroundMulti-view informed attention-based model for Irony and Satire detection in Spanish variants
Bueno, R. O., Rosso, P., & Pagóla, J. E. M. (2021) · Knowledge-Based Systems · doi:10.1016/j.knosys.2021.107597 · Cited by 31
Esale: Enhancing Code-Summary Alignment Learning for Source Code Summarization
Fang, C., Sun, W., Chen, Y., Chen, X., Wei, Z., Zhang, Q., You, Y., Luo, B., Liu, Y., & Chen, Z. (2024) · IEEE Transactions on Software Engineering · doi:10.1109/tse.2024.3422274 · Cited by 40
Baniata, L. H., Kang, S., & Ampomah, I. K. E. (2022) · Mathematics · doi:10.3390/math10193666 · Cited by 27
Encoder–Decoder Calibration for Multimodal Machine Translation
Tayir, T., Li, L., Li, B., Liu, J., & Lee, K. A. (2024) · IEEE Transactions on Artificial Intelligence · doi:10.1109/tai.2024.3354668 · Cited by 41
“However a number of recent studies have raised interest in whether ACWs truly represent the responsibility of each input for model predictions [16], [17], [18], [33].”
BackgroundMask-Align: Self-Supervised Neural Word Alignment
Chen, C., Sun, M., & Liu, Y. (2021) · doi:10.18653/v1/2021.acl-long.369 · Cited by 28
“Note that leaky attention is different from adding a special token in the source sequence, which will share the same high attention weights with the existing collector instead of calibrating it (Vig and Belinkov, 2019).”
BackgroundOwen, D. C., Antypas, D., Hassoulas, A., Pardiñas, A. F., Espinosa-Anke, L., & Camacho-Collados, J. (2023) · JMIR AI · doi:10.2196/41205 · Cited by 34
Measuring the Mixing of Contextual Information in the Transformer
Ferrando, J., Gállego, G. I., & Costa‐jussà, M. R. (2022) · Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.18653/v1/2022.emnlp-main.595 · Cited by 108
Attention Calibration for Transformer in Neural Machine Translation
Lu, Y., Zeng, J., Zhang, J., Wu, S., & Li, M. (2021) · doi:10.18653/v1/2021.acl-long.103 · Cited by 37
“…of regarding attention weights as explanation, Wiegr-effe and Pinter claim that the trained attention mechanisms do learn something meaningful about the relationship between inputs and outputs, such as syntactic information (Raganato and Tiedemann, 2018; Vig and Belinkov, 2019; Pham et al., 2019).”
BackgroundMcLevey, J., Crick, T., Browne, P., & Durant, D. (2022) · Canadian Review of Sociology/Revue canadienne de sociologie · doi:10.1111/cars.12378 · Cited by 21
Boosting single-cell gene regulatory network reconstruction via bulk-cell transcriptomic data
Shu, H., Ding, F., Zhou, J., Xue, Y., Zhao, D. Y., Zeng, J., & Ma, J. (2022) · Briefings in Bioinformatics · doi:10.1093/bib/bbac389 · Cited by 24
Aboutalebi, H., Pavlova, M., Gunraj, H., Shafiee, M. J., Sabri, A., Alaref, A. A., & Wong, A. M. (2022) · Frontiers in Medicine · doi:10.3389/fmed.2021.821120 · Cited by 26
The compositionality of neural networks: integrating symbolism and connectionism.Preprint
Hupkes, D., Dankers, V., Mul, M., & Bruni, E. (2019) · arXiv (Cornell University) · Cited by 20
The compositionality of neural networks: integrating symbolism and connectionismPreprint
Hupkes, D., Dankers, V., Mul, M., & Bruni, E. (2019) · arXiv.org · doi:10.48550/arxiv.1908.08351 · Cited by 34
Brain and Cognitive Science Inspired Deep Learning: A Comprehensive Survey
Zhang, Z., Ding, X., Liang, X., Zhou, Y., Qin, B., & Liu, T. (2025) · IEEE Transactions on Knowledge and Data Engineering · doi:10.1109/tkde.2025.3527551 · Cited by 28
Metadata
- Authors
- Vig, J., & Belinkov, Y.
- Affiliations
- Palo Alto Research Center (US)
- Harvard University (US)
- Venue
- Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP
- Published
- 2019
- Pages
- 63-76
- OpenAlex
- W2949603537
- Cited by
- 301
- References
- 26
- Citations by year
- 2026: 23 · 2025: 36 · 2024: 41 · 2023: 43 · 2022: 48 · 2021: 51 · 2020: 49 · 2019: 10
- FWCI
- 15.12
- Type
- conference paper
- Language
- en
- Open access
- hybrid
- doi.org
- Licence
- cc-by
- Locations
- BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP (BlackboxNLP) (publishedVersion, cc-by)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Physical Sciences › Computer Science › Artificial Intelligence › Explainable Artificial Intelligence (XAI)
- Keywords
- attention mechanism, transformer models, GPT-2, attention visualization, syntax, dependency relations, parts of speech, layer depth, attention heads, pre-trained language models
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.