Research map / Time series / Anomaly detection
When Will It Fail?: Anomaly to Prompt for Forecasting Future Anomalies in Time Series
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes A2P, a unified transformer that forecasts future signals and detects anomalies in them, using an anomaly-aware forecasting network and a learnable Anomaly Prompt Pool to predict when anomalies will occur.
Problem
Predicting the specific future time points at which anomalies will occur in multivariate time series (Anomaly Prediction), where naive forecasting-plus-anomaly-detection pipelines fail because forecasters are trained only on normal signals.
Approach
Pre-train an anomaly-aware forecasting network and a learnable Anomaly Prompt Pool that injects synthetic anomaly prompts at the embedding level, share a transformer backbone between forecasting and reconstruction-based anomaly detection, and weight the forecasting loss by predicted anomaly probability.
Key results
- A2P reaches average F1 of 46.84 at L_out=100 and 58.89 at L_out=400 on multivariate datasets, outperforming all forecasting+AD combinations in the main table.
- On MBA, A2P forecasting MSE is 0.788 at L_out=100 versus 1.012 for the best baseline (MICN).
- Ablation: removing AAF and SAP drops average F1 from 46.84 to 36.82.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use A2P instead of the strongest reported baseline | Anomaly Prediction · MBA, Exathlon, SMD, WADI; Lout=100 | Avg. F1: 41.55 -> 46.84 | Helped |
| Use A2P instead of the strongest reported baseline | Anomaly Prediction · MBA, Exathlon, SMD, WADI; Lout=200 | Avg. F1: 41.38 -> 53.08 | Helped |
| Use A2P instead of the strongest reported baseline | Anomaly Prediction · MBA, Exathlon, SMD, WADI; Lout=400 | Avg. F1: 41.18 -> 58.89 | Helped |
| Add AAF and SAP (ablation) | A2P · MBA, Exathlon, SMD, WADI | Avg. F1: 36.82 -> 46.84 | Helped |
| Add SAP (ablation) | A2P with AAF · MBA, Exathlon, SMD, WADI | Avg. F1: 38.89 -> 46.84 | Helped |
| Add AAF (ablation) | A2P with SAP · MBA, Exathlon, SMD, WADI | Avg. F1: 42.41 -> 46.84 | Helped |
| Add both LF and LD pre-training losses (ablation) | A2P · MBA, Exathlon, SMD, WADI | Avg. F1: 38.89 -> 46.84 | Helped |
| Add LD pre-training loss (ablation) | A2P with LF · MBA, Exathlon, SMD, WADI | Avg. F1: 41.42 -> 46.84 | Helped |
| Add LF pre-training loss (ablation) | A2P with LD · MBA, Exathlon, SMD, WADI | Avg. F1: 45.38 -> 46.84 | Helped |
| Share the transformer backbone between forecasting and anomaly detection (ablation) | A2P · MBA, Exathlon, SMD, WADI | Avg. F1: 41.45 -> 46.84 | Helped |
| Weight forecasting loss using anomaly probability (ablation) | A2P · MBA, Exathlon, SMD, WADI | Avg. F1: 44.44 -> 46.84 | Helped |
| Use MSE rather than BCE for AAF (ablation) | A2P · MBA, Exathlon, SMD, WADI | Avg. F1: 45.92 -> 46.84 | Helped |
Surprising findings
- Naive combinations of state-of-the-art forecasters and anomaly detectors fail at predicting future anomalies, with several baselines scoring near or below 20 F1 on some datasets.
Limitations
- Evaluation relies on modified F1 with tolerance window rather than standard point adjustment, making comparison to prior AD numbers difficult.
- Anomaly-aware forecasting and prompt pool depend on synthetic anomaly injection, whose fidelity to real anomalies is not verified.
- Pool size M affects performance, especially on MBA, requiring dataset-specific tuning.
Experimental setup
Datasets: MBA Exathlon SMD WADI
Benchmarks: MBA Exathlon SMD WADI MSL SMAP PSM SWaT
Metrics: F1 with tolerance MSE VUS-PR VUS-ROC
Baselines: PatchTST MICN GPT2 iTransformer FITS Anomaly Transformer DCdetector CAD TranAD BeatGAN DiffusionAD
Builds on: Anomaly Transformer DCdetector PatchTST
Closest papers by meaning
- Can LLMs Understand Time Series Anomalies? (ICLR 2025 · similarity 0.85)
- The Elephant in the Room: Towards A Reliable Time-Series Anomaly Detection Benchmark (NeurIPS 2024 · similarity 0.85)
- RobustTSF: Towards Theory and Design of Robust Time Series Forecasting with Anomalies (ICLR 2024 · similarity 0.84)
- When Model Meets New Normals: Test-Time Adaptation for Unsupervised Time-Series Anomaly Detection (AAAI 2024 · similarity 0.84)
- Position: Quo Vadis, Unsupervised Time Series Anomaly Detection? (ICML 2024 · similarity 0.84)
- LAST SToP for Modeling Asynchronous Time Series (ICML 2025 · similarity 0.83)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
