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

Andres Pollano, Anupam Chaudhuri, Anj Simmons
11/22/2023
cs.CLcs.LGmath.AT

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{pollano2023detecting,
  title  = {Detecting out-of-distribution text using topological features of transformer-based language models},
  author = {Andres Pollano and Anupam Chaudhuri and Anj Simmons},
  year   = {2023},
  eprint = {2311.13102},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.13102v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.13102.svg)](https://codeofpaper.com/paper/2311.13102)

Discussion