mlsanityData to 7 Oct 2026

Detecting out-of-distribution text using topological features of transformer-based language models

arXiv 2311.13102 ↗First posted 22 Nov 2023cs.CL cs.LG math.ATcited by 2

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

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
  3. 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
  4. 2021Generalized Out-of-Distribution Detection: A Surveycited by 796
  5. 2023The Internal State of an LLM Knows When It's Lyingcited by 644
  6. 2022Out-of-Distribution Detection with Deep Nearest Neighborscited by 596
  7. 2019Ripser: efficient computation of Vietoris-Rips persistence barcodescited by 115
  8. 2021Types of Out-of-Distribution Texts and How to Detect Themcited by 80
  9. 2021Revisiting Mahalanobis Distance for Transformer-Based Out-of-Domain Detectioncited by 67
  10. 2021Artificial Text Detection via Examining the Topology of Attention Mapscited by 49
  11. 2022News Category Datasetcited by 42
  12. 2023Is Fine-tuning Needed? Pre-trained Language Models Are Near Perfect for Out-of-Domain Detectioncited by 29
3 more
  1. 2022The Topological BERT: Transforming Attention into Topology for Natural Language Processingcited by 10
  2. 2022Beyond Mahalanobis-Based Scores for Textual OOD Detectioncited by 3
  3. 2023MLGuard: Defend Your Machine Learning Model!cited by 2

Built on by

Cited by year

Citing papers per year: 2024: 1; 2025: 1.

2 papers.