mlsanityData to 14 Oct 2026

The Topological BERT: Transforming Attention into Topology for Natural Language Processing

arXiv 2206.15195 ↗First posted 30 Jun 2022cs.CL cs.LG math.ATcited by 10

Not on the map. Why?

Abstract (arXiv)

In recent years, the introduction of the Transformer models sparked a revolution in natural language processing (NLP). BERT was one of the first text encoders using only the attention mechanism without any recurrent parts to achieve state-of-the-art results on many NLP tasks. This paper introduces a text classifier using topological data analysis. We use BERT's attention maps transformed into attention graphs as the only input to that classifier. The model can solve tasks such as distinguishing spam from ham messages, recognizing whether a sentence is grammatically correct, or evaluating a movie review as negative or positive. It performs comparably to the BERT baseline and outperforms it on some tasks. Additionally, we propose a new method to reduce the number of BERT's attention heads considered by the topological classifier, which allows us to prune the number of heads from 144 down to as few as ten with no reduction in performance. Our work also shows that the topological model displays higher robustness against adversarial attacks than the original BERT model, which is maintained during the pruning process. To the best of our knowledge, this work is the first to confront topological-based models with adversarial attacks in the context of NLP.

Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Builds on 22 of its 40 references that are in the map. First posted on arXiv 30 Jun 2022.

Builds on

22 of 40 references.

References · 22

  1. 2017Attention Is All You Needcited by 60,361
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  3. 2016Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localizationcited by 6,733
  4. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,899
  5. 2019Optuna: A Next-generation Hyperparameter Optimization Frameworkcited by 2,501
  6. 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
  7. 2018Neural Network Acceptability Judgmentscited by 958
  8. 2019Attention is not Explanationcited by 929
  9. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 856
  10. 2019Are Sixteen Heads Really Better than One?cited by 816
  11. 2020A Primer in BERTology: What we know about how BERT workscited by 815
  12. 2013Generating Sequences With Recurrent Neural Networkscited by 554
10 more
  1. 2019Linguistic Knowledge and Transferability of Contextual Representationscited by 383
  2. 2019Revealing the Dark Secrets of BERTcited by 301
  3. 2015Persistence Images: A Stable Vector Representation of Persistent Homologycited by 236
  4. 2019PersLay: A Neural Network Layer for Persistence Diagrams and New Graph Topological Signaturescited by 126
  5. 2020When BERT Plays the Lottery, All Tickets Are Winningcited by 114
  6. 2020giotto-tda: A Topological Data Analysis Toolkit for Machine Learning and Data Explorationcited by 55
  7. 2021Artificial Text Detection via Examining the Topology of Attention Mapscited by 49
  8. 2021Persformer: A Transformer Architecture for Topological Machine Learningcited by 19
  9. 2022Acceptability Judgements via Examining the Topology of Attention Mapscited by 19
  10. 2021Persistence Homology of TEDtalk: Do Sentence Embeddings Have a Topological Shape?cited by 3

Built on by

Cited by year

Citing papers per year: 2022: 4; 2023: 3; 2024: 3.

10 papers.