TL;DR
ViTs (Vision-Language Models for Time Series) shifts the paradigm of anomaly detection from "reading numbers" to "seeing patterns." By converting time series data into images and employing a three-stage "Chain-of-TS" fine-tuning strategy, the model achieves state-of-the-art zero-shot performance, outperforming even massive models like GPT-4o while handling sequences of arbitrary lengths without retraining.
What Problem Does This Paper Address?
Time Series Anomaly Detection (TSAD) is critical for maintaining web services, yet existing deep learning models struggle with the "train once, infer across scenarios" goal. Most traditional models are restricted to fixed window sizes; if you train on one-hour windows, the model fails on one-week windows.
Recently, researchers have tried using Large Language Models (LLMs) for this task. However, feeding raw numbers into an LLM as text creates two major hurdles:
- Context Length: Long time series quickly exceed the token limits of LLMs.
- Numerical Instability: LLMs aren't natively designed to understand the complex relationships between long strings of digits.
The authors argue that human experts don't look at raw spreadsheets to find bugs—they look at dashboards. They propose that machines should do the same.
Methods
The researchers introduce ViTs, a framework that treats time series curves as visual representations.
1. Visual Representation & Rescaling
Instead of tokenizing numbers, ViTs plots time series as line charts. To handle varying lengths, the authors use image rescaling rather than data downsampling. While downsampling can smooth out critical "spike" anomalies, rescaling the image preserves the visual integrity of the signal while fitting it into a consistent input size for the Vision Transformer (ViT).
2. The Chain-of-TS Fine-tuning Strategy
To bridge the gap between general image recognition and specialized time series analysis, the authors developed a three-stage pipeline:
- Stage 1: Knowledge Injection (SFT): Teaches the model basic concepts like trends, periodicity, and noise levels through image-text pairs.
- Stage 2: Detection Enhancement (SFT): Trains the model to identify specific anomalous intervals.
- Stage 3: Reasoning Refinement (RL): Uses Group Relative Policy Optimization (GRPO)—the same RL technique used in models like DeepSeek-R1—to reward the model for correct anomaly detection and proper formatting while penalizing false positives.
3. STL-based Data Generation
Because high-quality, labeled anomaly data is scarce, the authors built an automated generator based on Seasonal-Trend-Loess (STL) decomposition. This allows them to synthesize thousands of diverse samples featuring spikes, level shifts, trend changes, and frequency anomalies.
Datasets
- Synthetic: 15k QA pairs for training; 2k for evaluation.
- Public Benchmarks: The model was tested in a zero-shot setting (no training on these specific datasets) against:
- KPI: Real-world data from large internet companies.
- Yahoo: A standard anomaly detection benchmark.
- WSD: Web service metrics.
Key Insights and Ideas
- Vision > Text for Numbers: The paper demonstrates that VLMs are naturally better at capturing global patterns (like seasonality) than text-based LLMs, which get "lost" in the individual digits.
- Simplicity Wins: In testing different plot types (Line charts vs. STFT vs. Wavelets), the authors found that while frequency-domain plots (STFT) help, a simple, well-trained line chart model is often more robust because the VLM can focus on the data rather than complex axis labels.
- The Power of RL: The third stage of training (RL) provided a nearly 10% boost in F1 score. It specifically helped the model "reason" through the data, reducing false positives in normal windows.
- Adaptive Inference: By rescaling images to a fixed 200-point visual width, the model can analyze a 1-hour window or a 1-week window with the same underlying architecture.
Key Results
ViTs (based on a 7B parameter backbone) significantly outperformed much larger proprietary and open-source models:
- Superiority over GPT-4o: On synthetic datasets, ViTs achieved an average F1 score of 0.8581, compared to GPT-4o’s 0.5983.
- Zero-Shot King: Despite being trained only on synthetic data, ViTs outperformed specialized SOTA models like TimesNet and TranAD on public datasets, achieving an average F1 of 0.8142.
- Efficiency: It achieved these results with only 15k training samples, a relatively small amount compared to typical LLM fine-tuning regimes.
Limitations and Future Work
- Periodic Focus: The current data generator and evaluation focus heavily on periodic time series (KPIs). Its performance on highly stochastic or non-periodic data (like stock prices) is less explored.
- Multivariate Data: The paper focuses on univariate time series (one metric at a time). Real-world systems often require analyzing multiple correlated metrics simultaneously.
- Inference Speed: While visual rescaling is efficient, running a full VLM for every sliding window in a high-frequency monitoring system may be computationally expensive compared to lightweight statistical methods.
The authors plan to release all datasets and code to the public, providing a new foundation for "visual" time series foundation models.
Summary updated