Text-ADBench: Text Anomaly Detection Benchmark based on LLMs Embedding

Feng Xiao, Jicong Fan
7/16/2025
cs.CLcs.AIcs.LG

Official code: jicongfan/Text-Anomaly-Detection-Benchmark (1 star, MIT, last commit 2026-04-10).

Abstract

Text anomaly detection is a critical task in natural language processing (NLP), with applications spanning fraud detection, misinformation identification, spam detection and content moderation, etc. Despite significant advances in large language models (LLMs) and anomaly detection algorithms, the absence of standardized and comprehensive benchmarks for evaluating the existing anomaly detection methods on text data limits rigorous comparison and development of innovative approaches. This work performs a comprehensive empirical study and introduces a benchmark for text anomaly detection, leveraging embeddings from diverse pre-trained language models across a wide array of text datasets. Our work systematically evaluates the effectiveness of embedding-based text anomaly detection by incorporating (1) early language models (GloVe, BERT); (2) multiple LLMs (LLaMa-2, LLama-3, Mistral, OpenAI (small, ada, large)); (3) multi-domain text datasets (news, social media, scientific publications); (4) comprehensive evaluation metrics (AUROC, AUPRC). Our experiments reveal a critical empirical insight: embedding quality significantly governs anomaly detection efficacy, and deep learning-based approaches demonstrate no performance advantage over conventional shallow algorithms (e.g., KNN, Isolation Forest) when leveraging LLM-derived embeddings.In addition, we observe strongly low-rank characteristics in cross-model performance matrices, which enables an efficient strategy for rapid model evaluation (or embedding evaluation) and selection in practical applications. Furthermore, by open-sourcing our benchmark toolkit that includes all embeddings from different models and code at https://github.com/jicongfan/Text-Anomaly-Detection-Benchmark, this work provides a foundation for future research in robust and scalable text anomaly detection systems.

View on arXivView PDF

Code Implementations(1)

MIT
10Shell, PythonJul 15, 20256 months agoMIT

Similar Papers

Cite this paper

@article{xiao2025textadbench,
  title  = {Text-ADBench: Text Anomaly Detection Benchmark based on LLMs Embedding},
  author = {Feng Xiao and Jicong Fan},
  year   = {2025},
  eprint = {2507.12295},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.12295v1}
}

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/2507.12295.svg)](https://codeofpaper.com/paper/2507.12295)

Discussion