---
title: "Visualizing and Measuring the Geometry of BERT — Coenen 2019"
description: "The paper asks how BERT internally organizes the linguistic knowledge that makes it so easy to fine-tune."
authors: ["Andy Coenen", "Emily Reif", "Ann Yuan", "Been Kim", "Adam Pearce", "Fernanda Viegas", "Martin Wattenberg"]
year: 2019
venue: "arXiv:1906.02715"
source: "https://arxiv.org/abs/1906.02715"
doi: "10.48550/arxiv.1906.02715"
arxiv: "1906.02715"
licence: "arXiv — non-exclusive license to distribute"
licence_url: "http://arxiv.org/licenses/nonexclusive-distrib/1.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/coenen-2019-visualizing-measuring-geometry-bert/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/coenen-2019-visualizing-measuring-geometry-bert/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2019](https://md.research.elamur.ai/free/en/papers/2019/page/5/) / Visualizing and Measuring the Geometry of BERT

# Visualizing and Measuring the Geometry of BERT

**Authors:** [Andy Coenen](https://md.research.elamur.ai/free/en/authors/andy-coenen/), [Emily Reif](https://md.research.elamur.ai/free/en/authors/emily-reif/), [Ann Yuan](https://md.research.elamur.ai/free/en/authors/ann-yuan/), [Been Kim](https://md.research.elamur.ai/free/en/authors/been-kim/), Adam Pearce, [Fernanda Viegas](https://md.research.elamur.ai/free/en/authors/fernanda-viegas/), [Martin Wattenberg](https://md.research.elamur.ai/free/en/authors/martin-wattenberg/) · **Year:** 2019 · **Venue:** arXiv:1906.02715 · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

**Links:** [Publisher's page](https://arxiv.org/abs/1906.02715) · [PDF](https://arxiv.org/pdf/1906.02715) · [DOI 10.48550/arxiv.1906.02715](https://doi.org/10.48550/arxiv.1906.02715) · [arXiv 1906.02715](https://arxiv.org/abs/1906.02715) · [OpenAlex](https://openalex.org/W2948771346)

**Citations:** 163 citations (openalex-snapshot · 2026-10-14) · [175](#cited-by) in our library, of the 140673 papers whose bibliographies we read

## Summary

The paper asks how BERT internally organizes the linguistic knowledge that makes it so easy to fine-tune. It combines visualizations with quantitative tests. For syntax, the Google Brain authors build "attention probes". For each token pair, they gather the attention values from every head and layer of BERT-base into a single vector. They then train simple linear classifiers on Penn Treebank sentences converted to dependency form.

They also give a mathematical explanation for Hewitt and Manning's observation that squared Euclidean distance between context embeddings tracks parse tree distance. Such "Pythagorean" tree embeddings always exist and are easy to build, even approximately with random vectors. For semantics, they study word senses using SemCor. They train a probe that projects embeddings into a smaller subspace and test how merging unrelated contexts shifts sense representations.

The central finding is that syntactic and semantic information appear to occupy separate, relatively low-dimensional linear subspaces of the same vectors. This matters for interpretability. It also exposes a failure mode of attention, where tokens absorb meaning across sentence boundaries, and it offers an alternative to hyperbolic tree embeddings.

## Key points

- **Attention probe data:** The probe uses Penn Treebank parses converted with PyStanfordDependencies. Of the 3.1 million dependency relations, only the 30 relation types with more than 5,000 examples were kept.
- **Attention probe results:** Linear probes on model-wide attention vectors reach 85.8% accuracy for detecting whether a dependency exists. They reach 71.9% for predicting its type.
- **Tree embedding theorems:** Every n-node tree can be given a Pythagorean (power-2) embedding in R^(n−1). For every p \< 2, some tree has no power-p embedding. A "random branch embedding" built from random unit vectors approximates the Pythagorean case in high dimensions.
- **Concatenation experiment:** The authors joined 25,096 SemCor sentence pairs that use one keyword in different senses. This raised the final-layer sense misclassification rate from 2.43% (single sentences) to 8.23% (concatenated).
- **Semantic subspace projection:** Projecting embeddings into the learned semantic subspace raised similarity ratios from 1.43 to 1.88 for single sentences and from 1.28 to 1.58 for concatenated ones. Misclassification fell to 2.27% and 7.31% respectively.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

Fields: [Other](https://md.research.elamur.ai/free/en/shelves/other/)

## Cited by

Cited by

175 papers of our library cite it (of the 140673 whose bibliographies we read); 12 of them have a page here, 163 not yet.

- [Quantifying Attention Flow in Transformers](https://md.research.elamur.ai/free/en/papers/abnar-2020-quantifying-attention-flow-transformers/)
- [Attention is Not Only a Weight: Analyzing Transformers with Vector Norms](https://md.research.elamur.ai/free/en/papers/kobayashi-2020-attention-is-not-only-weight/)
- [COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining](https://md.research.elamur.ai/free/en/papers/meng-2021-coco-lm-correcting-contrasting-text/)
- [What Happens To BERT Embeddings During Fine-tuning?](https://md.research.elamur.ai/free/en/papers/merchant-2020-what-happens-bert-embeddings-during/)
- [Modeling the Evolution of English Noun Compounds with Feature-Rich Diachronic Compositionality Prediction](https://md.research.elamur.ai/free/en/papers/miletic-2025-modeling-evolution-english-noun-compounds/)
- [A framework for analyzing concept representations in neural models](https://md.research.elamur.ai/free/en/papers/naowarat-2026-framework-analyzing-concept-representations-neural/)
- [The Linear Representation Hypothesis and the Geometry of Large Language Models](https://md.research.elamur.ai/free/en/papers/park-2023-linear-representation-hypothesis-geometry-large/)
- [Intermediate-Task Transfer Learning with Pretrained Language Models: When and Why Does It Work?](https://md.research.elamur.ai/free/en/papers/pruksachatkun-2020-intermediate-task-transfer-learning-pretrained/)
- [Pre-trained Models for Natural Language Processing: A Survey](https://md.research.elamur.ai/free/en/papers/qiu-2020-pre-trained-models-natural-language/)
- [Integrating Multimodal Information in Large Pretrained Transformers](https://md.research.elamur.ai/free/en/papers/rahman-2020-integrating-multimodal-information-large-pretrained/)
- [oLMpics -- On what Language Model Pre-training Captures](https://md.research.elamur.ai/free/en/papers/talmor-2019-olmpics-language-model-pre-training/)
- [Probing Pretrained Language Models for Lexical Semantics](https://md.research.elamur.ai/free/en/papers/vulic-2020-probing-pretrained-language-models-lexical/)

## Cite

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@misc{coenen2019visualizing,
  title = {{Visualizing and Measuring the Geometry of BERT}},
  author = {Coenen, Andy and Reif, Emily and Yuan, Ann and Kim, Been and Pearce, Adam and Viegas, Fernanda and Wattenberg, Martin},
  year = {2019},
  doi = {10.48550/arxiv.1906.02715},
  eprint = {1906.02715},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1906.02715}
}
```

- [← previous VisualBERT: A Simple and Performant Baseline for Vision and Language](https://md.research.elamur.ai/free/en/papers/li-2019-visualbert-simple-performant-baseline-vision/)
- [next → VL-BERT: Pre-training of Generic Visual-Linguistic Representations](https://md.research.elamur.ai/free/en/papers/su-2019-vl-bert-pre-training-generic/)
- [↑ back to papers of 2019](https://md.research.elamur.ai/free/en/papers/2019/page/5/)

## References

28 references, 12 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. Terra Blevins, Omer Levy, and Luke Zettlemoyer. Deep rnns encode soft hierarchical syntax. arXiv preprint arXiv:1805.04218, 2018. [find](https://scholar.google.com/scholar?q=Terra+Blevins%2C+Omer+Levy%2C+and+Luke+Zettlemoyer%2E+Deep+rnns+encode+soft+hierarchical+syntax%2E+arXiv+preprint+arXiv%3A1805%2E04218%2C+2018%2E)
2. Shan Carter, Zan Armstrong, Ludwig Schubert, Ian Johnson, and Chris Olah. Activation atlas. Distill, 2019. [https://distill.pub/2019/activation-atlas](https://distill.pub/2019/activation-atlas). [↗](https://distill.pub/2019/activation-atlas)
3. Alexis Conneau, German Kruszewski, Guillaume Lample, Loïc Barrault, and Marco Baroni. What you can cram into a single vector: Probing sentence embeddings for linguistic properties. arXiv preprint arXiv:1805.01070, 2018. [find](https://scholar.google.com/scholar?q=Alexis+Conneau%2C+German+Kruszewski%2C+Guillaume+Lample%2C+Lo%C3%AFc+Barrault%2C+and+Marco+Baroni%2E+What+you+can+cram+into+a+single+vector%3A+Probing+sentence+embeddings+for+linguistic+properties%2E+arXiv+preprint+arXi) [our card](https://md.research.elamur.ai/free/en/papers/conneau-2018-what-you-can-cram-into/)
4. Marie-Catherine De Marneffe, Bill MacCartney, Christopher D Manning, et al. Generating typed dependency parses from phrase structure parses. In Lrec, volume 6, pages 449–454, 2006. [find](https://scholar.google.com/scholar?q=Marie%2DCatherine+De+Marneffe%2C+Bill+MacCartney%2C+Christopher+D+Manning%2C+et+al%2E+Generating+typed+dependency+parses+from+phrase+structure+parses%2E+In+Lrec%2C+volume+6%2C+pages+449%E2%80%93454%2C+2006%2E) [our card](https://md.research.elamur.ai/free/en/papers/map-2006-marneffe-generating-typed-dependency-parses-phrase/)
5. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. [find](https://scholar.google.com/scholar?q=Jacob+Devlin%2C+Ming%2DWei+Chang%2C+Kenton+Lee%2C+and+Kristina+Toutanova%2E+Bert%3A+Pre%2Dtraining+of+deep+bidirectional+transformers+for+language+understanding%2E+arXiv+preprint+arXiv%3A1810%2E04805%2C+2018%2E)
6. John Hewitt and Christopher D Manning. A structural probe for finding syntax in word representations. Association for Computational Linguistics, 2019. [find](https://scholar.google.com/scholar?q=John+Hewitt+and+Christopher+D+Manning%2E+A+structural+probe+for+finding+syntax+in+word+representations%2E+Association+for+Computational+Linguistics%2C+2019%2E) [our card](https://md.research.elamur.ai/free/en/papers/hewitt-2019-structural-probe-finding-syntax-word/)
7. Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, and Rory Sayres. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). arXiv preprint arXiv:1711.11279, 2017. — [arXiv:1711.11279](https://arxiv.org/abs/1711.11279) [find](https://scholar.google.com/scholar?q=Been+Kim%2C+Martin+Wattenberg%2C+Justin+Gilmer%2C+Carrie+Cai%2C+James+Wexler%2C+Fernanda+Viegas%2C+and+Rory+Sayres%2E+Interpretability+beyond+feature+attribution%3A+Quantitative+testing+with+concept+activation+vector)
8. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. [find](https://scholar.google.com/scholar?q=Alex+Krizhevsky%2C+Ilya+Sutskever%2C+and+Geoffrey+E+Hinton%2E+Imagenet+classification+with+deep+convolutional+neural+networks%2E+In+Advances+in+neural+information+processing+systems%2C+pages+1097%E2%80%931105%2C+2012%2E)
9. Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995. [find](https://scholar.google.com/scholar?q=Yann+LeCun%2C+Yoshua+Bengio%2C+et+al%2E+Convolutional+networks+for+images%2C+speech%2C+and+time+series%2E+The+handbook+of+brain+theory+and+neural+networks%2C+3361%2810%29%3A1995%2C+1995%2E)
10. Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of lstms to learn syntax-sensitive dependencies. Transactions of the Association for Computational Linguistics, 4:521–535, 2016. [find](https://scholar.google.com/scholar?q=Tal+Linzen%2C+Emmanuel+Dupoux%2C+and+Yoav+Goldberg%2E+Assessing+the+ability+of+lstms+to+learn+syntax%2Dsensitive+dependencies%2E+Transactions+of+the+Association+for+Computational+Linguistics%2C+4%3A521%E2%80%93535%2C+2016%2E) [our card](https://md.research.elamur.ai/free/en/papers/linzen-2016-assessing-ability-lstms-learn-syntax/)
11. Nelson F Liu, Matt Gardner, Yonatan Belinkov, Matthew Peters, and Noah A Smith. Linguistic knowledge and transferability of contextual representations. arXiv preprint arXiv:1903.08855, 2019. [find](https://scholar.google.com/scholar?q=Nelson+F+Liu%2C+Matt+Gardner%2C+Yonatan+Belinkov%2C+Matthew+Peters%2C+and+Noah+A+Smith%2E+Linguistic+knowledge+and+transferability+of+contextual+representations%2E+arXiv+preprint+arXiv%3A1903%2E08855%2C+2019%2E) [our card](https://md.research.elamur.ai/free/en/papers/liu-2019-linguistic-knowledge-transferability-contextual-representations/)
12. Hiroshi Maehara. Euclidean embeddings of finite metric spaces. Discrete Mathematics, 313(23):2848–2856, 2013. [find](https://scholar.google.com/scholar?q=Hiroshi+Maehara%2E+Euclidean+embeddings+of+finite+metric+spaces%2E+Discrete+Mathematics%2C+313%2823%29%3A2848%E2%80%932856%2C+2013%2E)
13. Mitchell P. Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Comput. Linguist., 19(2):313–330, June 1993. [find](https://scholar.google.com/scholar?q=Mitchell+P%2E+Marcus%2C+Mary+Ann+Marcinkiewicz%2C+and+Beatrice+Santorini%2E+Building+a+large+annotated+corpus+of+english%3A+The+penn+treebank%2E+Comput%2E+Linguist%2E%2C+19%282%29%3A313%E2%80%93330%2C+June+1993%2E) [our card](https://md.research.elamur.ai/free/en/papers/bank-1993-marcus-building-large-annotated-corpus-english/)
14. David McClosky. Pystanforddependencies. PyStanfordDependencies, 2015. [find](https://scholar.google.com/scholar?q=David+McClosky%2E+Pystanforddependencies%2E+PyStanfordDependencies%2C+2015%2E)
15. Leland McInnes, John Healy, and James Melville. Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint arXiv:1802.03426, 2018. [find](https://scholar.google.com/scholar?q=Leland+McInnes%2C+John+Healy%2C+and+James+Melville%2E+Umap%3A+Uniform+manifold+approximation+and+projection+for+dimension+reduction%2E+arXiv+preprint+arXiv%3A1802%2E03426%2C+2018%2E) [our card](https://md.research.elamur.ai/free/en/papers/mcinnes-2018-umap-uniform-manifold-approximation-projection/)
16. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013. [find](https://scholar.google.com/scholar?q=Tomas+Mikolov%2C+Ilya+Sutskever%2C+Kai+Chen%2C+Greg+S+Corrado%2C+and+Jeff+Dean%2E+Distributed+representations+of+words+and+phrases+and+their+compositionality%2E+In+Advances+in+neural+information+processing+system)
17. George A. Miller, Claudia Leacock, Randee Tengi, and Ross Bunker. A semantic concordance. In HLT, 1993. [find](https://scholar.google.com/scholar?q=George+A%2E+Miller%2C+Claudia+Leacock%2C+Randee+Tengi%2C+and+Ross+Bunker%2E+A+semantic+concordance%2E+In+HLT%2C+1993%2E)
18. Maximillian Nickel and Douwe Kiela. Poincaré embeddings for learning hierarchical representations. In Advances in neural information processing systems, pages 6338–6347, 2017. [https://github.com/dmcc/](https://github.com/dmcc/) [↗](https://github.com/dmcc/) [our card](https://md.research.elamur.ai/free/en/papers/nickel-2017-poincare-embeddings-learning-hierarchical-representations/)
19. F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830… [find](https://scholar.google.com/scholar?q=F%2E+Pedregosa%2C+G%2E+Varoquaux%2C+A%2E+Gramfort%2C+V%2E+Michel%2C+B%2E+Thirion%2C+O%2E+Grisel%2C+M%2E+Blondel%2C+P%2E+Prettenhofer%2C+R%2E+Weiss%2C+V%2E+Dubourg%2C+J%2E+Vanderplas%2C+A%2E+Passos%2C+D%2E+Cournapeau%2C+M%2E+Brucher%2C+M%2E+Perrot%2C+and+E%2E+Duc)
20. Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018. [find](https://scholar.google.com/scholar?q=Matthew+E+Peters%2C+Mark+Neumann%2C+Mohit+Iyyer%2C+Matt+Gardner%2C+Christopher+Clark%2C+Kenton+Lee%2C+and+Luke+Zettlemoyer%2E+Deep+contextualized+word+representations%2E+arXiv+preprint+arXiv%3A1802%2E05365%2C+2018%2E)
21. Alessandro Raganato, Jose Camacho-Collados, and Roberto Navigli. Word sense disambiguation: A unified evaluation framework and empirical comparison. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pages 99–110, Va… [find](https://scholar.google.com/scholar?q=Alessandro+Raganato%2C+Jose+Camacho%2DCollados%2C+and+Roberto+Navigli%2E+Word+sense+disambiguation%3A+A+unified+evaluation+framework+and+empirical+comparison%2E+In+Proceedings+of+the+15th+Conference+of+the+Europe) [our card](https://md.research.elamur.ai/free/en/papers/onto-2017-raganato-word-sense-disambiguation-unified-evaluation/)
22. Isaac J Schoenberg. On certain metric spaces arising from euclidean spaces by a change of metric and their imbedding in hilbert space. Annals of mathematics, pages 787–793, 1937. [find](https://scholar.google.com/scholar?q=Isaac+J+Schoenberg%2E+On+certain+metric+spaces+arising+from+euclidean+spaces+by+a+change+of+metric+and+their+imbedding+in+hilbert+space%2E+Annals+of+mathematics%2C+pages+787%E2%80%93793%2C+1937%2E)
23. Ian Tenney, Dipanjan Das, and Ellie Pavlick. Bert rediscovers the classical nlp pipeline. arXiv preprint arXiv:1905.05950, 2019. [find](https://scholar.google.com/scholar?q=Ian+Tenney%2C+Dipanjan+Das%2C+and+Ellie+Pavlick%2E+Bert+rediscovers+the+classical+nlp+pipeline%2E+arXiv+preprint+arXiv%3A1905%2E05950%2C+2019%2E) [our card](https://md.research.elamur.ai/free/en/papers/tenney-2019-bert-rediscovers-classical-nlp-pipeline/)
24. Ian Tenney, Patrick Xia, Berlin Chen, Alex Wang, Adam Poliak, R Thomas McCoy, Najoung Kim, Benjamin Van Durme, Samuel R Bowman, Dipanjan Das, et al. What do you learn from context? probing for sentence structure in contextualized word representations. 2018. [find](https://scholar.google.com/scholar?q=Ian+Tenney%2C+Patrick+Xia%2C+Berlin+Chen%2C+Alex+Wang%2C+Adam+Poliak%2C+R+Thomas+McCoy%2C+Najoung+Kim%2C+Benjamin+Van+Durme%2C+Samuel+R+Bowman%2C+Dipanjan+Das%2C+et+al%2E+What+do+you+learn+from+context%3F+probing+for+sentenc) [our card](https://md.research.elamur.ai/free/en/papers/tenney-2019-learn-context-probing-sentence-structure/)
25. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998–6008, 2017. [find](https://scholar.google.com/scholar?q=Ashish+Vaswani%2C+Noam+Shazeer%2C+Niki+Parmar%2C+Jakob+Uszkoreit%2C+Llion+Jones%2C+Aidan+N+Gomez%2C+%C5%81ukasz+Kaiser%2C+and+Illia+Polosukhin%2E+Attention+is+all+you+need%2E+In+Advances+in+neural+information+processing+sys)
26. Jesse Vig. Visualizing attention in transformer-based language models. arXiv preprint arXiv:1904.02679, 2019. — [arXiv:1904.02679](https://arxiv.org/abs/1904.02679) [find](https://scholar.google.com/scholar?q=Jesse+Vig%2E+Visualizing+attention+in+transformer%2Dbased+language+models%2E+arXiv+preprint+arXiv%3A1904%2E02679%2C+2019%2E+%E2%80%94+%5BarXiv%3A1904%2E02679%5D%28https%3A%2F%2Farxiv%2Eorg%2Fabs%2F1904%2E02679%29)
27. Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818–833. Springer, 2014. [find](https://scholar.google.com/scholar?q=Matthew+D+Zeiler+and+Rob+Fergus%2E+Visualizing+and+understanding+convolutional+networks%2E+In+European+conference+on+computer+vision%2C+pages+818%E2%80%93833%2E+Springer%2C+2014%2E) [our card](https://md.research.elamur.ai/free/en/papers/zeiler-2013-visualizing-understanding-convolutional-networks/)
28. Yury. Minimizing the maximum dot product among k unit vectors in an n-dimensional space. [https://cstheory.stackexchange.com/q/14748](https://cstheory.stackexchange.com/q/14748), 2012. Accessed: 2019-05-09. [↗](https://cstheory.stackexchange.com/q/14748)
