SPEAR: Soft Prompt Enhanced Anomaly Recognition for Time Series Data

Hanzhe Wei, Jiajun Wu, Jialin Yang, Henry Leung, Steve Drew
10/4/2025
cs.LGcs.AI

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Time series anomaly detection plays a crucial role in a wide range of fields, such as healthcare and internet traffic monitoring. The emergence of large language models (LLMs) offers new opportunities for detecting anomalies in the ubiquitous time series data. Traditional approaches struggle with variable-length time series sequences and context-based anomalies. We propose Soft Prompt Enhanced Anomaly Recognition (SPEAR), a novel approach to leverage LLMs for anomaly detection with soft prompts and quantization. Our methodology involves quantizing and transforming the time series data into input embeddings and combining them with learnable soft prompt embeddings. These combined embeddings are then fed into a frozen LLM. The soft prompts are updated iteratively based on a cross-entropy loss, allowing the model to adapt to time series anomaly detection. The use of soft prompts helps adapt LLMs effectively to time series tasks, while quantization ensures optimal handling of sequences, as LLMs are designed to handle discrete sequences. Our experimental results demonstrate that soft prompts effectively increase LLMs' performance in downstream tasks regarding time series anomaly detection.

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. 3 weaker matches are 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{wei2025spear,
  title  = {SPEAR: Soft Prompt Enhanced Anomaly Recognition for Time Series Data},
  author = {Hanzhe Wei and Jiajun Wu and Jialin Yang and Henry Leung and Steve Drew},
  year   = {2025},
  eprint = {2510.03962},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.03962v1}
}

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

Discussion