Saved in:
Bibliographic Details
Main Authors: Pollano, Andres, Chaudhuri, Anupam, Simmons, Anj
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2311.13102
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929425545691136
author Pollano, Andres
Chaudhuri, Anupam
Simmons, Anj
author_facet Pollano, Andres
Chaudhuri, Anupam
Simmons, Anj
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2311_13102
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Detecting out-of-distribution text using topological features of transformer-based language models
Pollano, Andres
Chaudhuri, Anupam
Simmons, Anj
Computation and Language
Machine Learning
Algebraic Topology
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.
title Detecting out-of-distribution text using topological features of transformer-based language models
topic Computation and Language
Machine Learning
Algebraic Topology
url https://arxiv.org/abs/2311.13102