Detecting out-of-distribution text using topological features of transformer-based language models
Not on the map. Why?
Abstract (arXiv)
To safeguard machine learning systems that operate on textual data against out-of-distribution (OOD) inputs that could cause unpredictable behaviour, we explore the use of topological features of self-attention maps from transformer-based language models to detect when input text is out of distribution. Self-attention forms the core of transformer-based language models, dynamically assigning vectors to words based on context, thus in theory our methodology is applicable to any transformer-based language model with multihead self-attention. We evaluate our approach on BERT and compare it to a traditional OOD approach using CLS embeddings. Our results show that our approach outperforms CLS embeddings in distinguishing in-distribution samples from far-out-of-domain samples, but struggles with near or same-domain datasets.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 15 of its 24 references that are in the map. First posted on arXiv 22 Nov 2023.
Builds on
15 of 24 references.
References · 15
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
- 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
- 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
- 2023The Internal State of an LLM Knows When It's Lyingcited by 644
- 2022Out-of-Distribution Detection with Deep Nearest Neighborscited by 596
- 2019Ripser: efficient computation of Vietoris-Rips persistence barcodescited by 115
- 2021Types of Out-of-Distribution Texts and How to Detect Themcited by 80
- 2021Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detectioncited by 67
- 2021Artificial Text Detection via Examining the Topology of Attention Mapscited by 49
- 2022News Category Datasetcited by 42
- 2023Is Fine-tuning Needed? Pre-trained Language Models Are Near Perfect for Out-of-Domain Detectioncited by 29
3 more
Built on by
Citing papers per year: 2024: 1; 2025: 1.
2 papers.