Large Language Models (LLMs) have proven to be the "Swiss Army Knives" of artificial intelligence, yet their application to time-series anomaly detection (TSAD) has historically yielded limited success. Previous research has often shown LLMs performing worse than even basic statistical methods when tasked with finding anomalies in numerical sequences.
Rather than solely focusing on what LLMs get wrong, this paper investigates the fundamental question of why they struggle. By identifying the core bottlenecks in LLM reasoning for time-series data, the authors introduce a surprisingly simple, zero-shot methodology that allows LLMs to outperform specialized numerical models.
The Core Challenges: Why Do LLMs Fail at TSAD?
The researchers identify two primary bottlenecks that hinder LLM performance on time-series data:
- Understanding Failure: LLMs often get "distracted" by complex normal patterns, such as repeating weekly cycles or gradual trend shifts. When the baseline data is highly variable, subtle anomalies are easily obscured, leading the model to predict no anomalies at all.
- Localization Failure: Even when an LLM successfully detects that an anomaly exists within a sequence, it is notoriously bad at counting. If an anomaly occurs at the 452nd position in a long string of numbers, the LLM will frequently guess the wrong index, resulting in a "false miss" during evaluation.
Proposed Methodology
To "un-break" LLM reasoning for time-series data, the authors propose a straightforward, multi-pronged approach:
- De-seasonalization (Preprocessing): Traditional models often bake decomposition directly into their architecture. For LLMs, the authors show that decomposition should be a preprocessing step. Using a lightweight statistical tool (Autocorrelation Function), they identify and subtract the dominant repeating cycle. This strips away the "background noise" of seasonality, leaving behind residual data where anomalies stick out clearly.
- Index-Aware Prompting: To solve the counting problem, the authors stop feeding the LLM raw lists of numbers (e.g.,
[0.5, 0.6, 0.1...]). Instead, they provide explicitly indexed pairs:(0, 0.5), (1, 0.6), (2, 0.1).... This simple structural cue transforms a difficult internal counting task into a basic text-retrieval task. - Multimodal Fusion: The model is fed both the textual indexed values and a visual line plot. The image helps the LLM grasp the global context and "big picture," while the text allows for surgical precision in pinpointing the exact start and end indices of an anomaly.
Key Findings and Results
The impact of these structural cues is substantial. The authors evaluated their method on two major benchmarks: AnomLLM (a synthetic benchmark testing specific anomaly types) and TSB-AD (a massive real-world benchmark containing diverse univariate data).
- Massive Performance Gains: The proposed method outperformed 21 existing prompting strategies on the AnomLLM benchmark. It boosted F1 scores by an average of 39.9%, achieving up to a 66.6% improvement in specific scenarios.
- Beating the Specialists: On the real-world TSB-AD benchmark, the LLM-based approach achieved the highest average F1 score, outperforming 16 non-LLM baselines. This included beating specialized deep learning models like AnomalyTransformer and foundation models like Chronos.
- The Power of Context: The true advantage of LLMs lies in contextual reasoning. The authors demonstrated that an LLM can use a text prompt (e.g., "The sensor was down for maintenance") to correctly ignore a flat-line signal that traditional models would falsely flag as a critical anomaly.
Limitations and Future Work
While the results are highly promising, the authors note a few practical limitations. First is the "latency tax": LLMs are inherently slower than statistical models. While a traditional model processes a sequence in milliseconds, an LLM takes seconds to generate a response, making this approach currently unsuitable for high-frequency, real-time industrial monitoring. Additionally, context window limits restrict how many "index-value" pairs can be fed into a prompt before the model loses track of the data.
Future work will likely move toward a "tool-use" paradigm, where the LLM autonomously decides when to call a decomposition tool or a statistical test, rather than relying on forced preprocessing steps. Nonetheless, this paper proves that with the right structural cues, LLMs can be top-tier, zero-shot anomaly detectors.
Summary updated