# What Does BERT Look At? An Analysis of BERT's Attention

**Authors:** Kevin Clark, Urvashi Khandelwal, Omer Levy, Christopher D. Manning  
**arXiv:** [1906.04341](https://arxiv.org/abs/1906.04341)  
**Date:** 2019-06-11  
**Summary page:** https://www.summarizepaper.com/en/paper/1906.04341v1/

## Key points

- Authors explore attention mechanisms of large pre-trained neural networks like BERT in NLP
- Previous studies focused on model outputs and internal vector representations
- Novel methods proposed for analyzing attention mechanisms of BERT
- BERT's attention heads exhibit distinct patterns, including delimiter tokens, positional offsets, or attending over entire sentence
- Heads within the same layer often display similar behaviors
- Certain attention heads align well with linguistic concepts such as syntax and coreference
- Attention-based probing classifier used to support analysis
- BERT's attention contains valuable syntactic information
- Research expands understanding of how pre-trained neural networks learn from unlabeled data through attention mechanisms
- Findings demonstrate alignment of BERT's attention with linguistic notions of syntax and coreference

## Summary

In their paper titled "What Does BERT Look At? An Analysis of BERT's Attention," authors Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning explore the attention mechanisms of large pre-trained neural networks like BERT in the field of Natural Language Processing (NLP). These networks have achieved significant success in learning from unlabeled data, prompting researchers to investigate the language aspects they can capture. While previous studies have primarily focused on model outputs and internal vector representations, this research proposes novel methods for analyzing the attention mechanisms of pre-trained models, specifically BERT. The authors observe that BERT's attention heads exhibit distinct patterns, including attending to delimiter tokens, specific positional offsets, or broadly attending over the entire sentence. Interestingly, heads within the same layer often display similar behaviors. Moreover, the study demonstrates that certain attention heads align well with linguistic concepts such as syntax and coreference. For example, some heads accurately attend to direct objects of verbs, determiners of nouns, objects of prepositions and coreferent mentions. This finding suggests that BERT's attention captures substantial syntactic information. To further support their analysis, the authors propose an attention-based probing classifier. By utilizing this classifier they provide additional evidence that BERT's attention contains valuable syntactic information. Overall this research expands our understanding of how large pre-trained neural networks like BERT learn from unlabeled data by investigating their attention mechanisms. The findings highlight specific patterns exhibited by BERT's attention heads and demonstrate their alignment with linguistic notions of syntax and coreference. This study contributes to advancing NLP research and sheds light on the capabilities of pre-trained models in capturing important language features through attention mechanisms.
