cs.LGSep 25, 2025

Towards Foundation Models for Zero-Shot Time Series Anomaly Detection: Leveraging Synthetic Data and Relative Context Discrepancy

Authors: Tian Lan, Hao Duong Le, Jinbo Li, Wenjun He, Meng Wang, Chenghao Liu, Chen Zhang

Organizations: Department of Industrial Engineering, Tsinghua University, Beijing, China · Lab, Huawei Technologies, ShenZhen, China · Datadog AI Research, Paris, France

Abstract

Time series anomaly detection (TSAD) is a critical task, but developing models that generalize to unseen data in a zero-shot manner remains challenging. Existing foundation models for TSAD often rely on reconstruction-error scoring at inference time, which can miss subtle anomalies that are well reconstructed and can falsely flag complex but normal patterns in unseen domains. We introduce TimeRCD, a foundation model for TSAD built on Relative Context Discrepancy (RCD), a pre-training paradigm that trains the model to detect anomalies by comparing a query pattern with its surrounding context. This relational formulation, implemented with a standard Transformer architecture, enables the model to infer normality from the input context rather than relying on fixed global normal patterns. We further construct a large-scale synthetic corpus with context-dependent anomaly labels to provide supervised pre-training signals for RCD. Experiments across diverse benchmarks show that TimeRCD outperforms existing general-purpose and anomaly-specific foundation models in most zero-shot TSAD settings, while remaining competitive with dataset-specific full-shot baselines. These results provide empirical evidence that RCD is an effective direction for building robust and generalizable TSAD models.

Figures & tables

Appendix figures & tables23 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. ChronosAD: Leveraging Time Series Foundation Models for Accurate Anomaly Detection

    May 31, 2026Uzair Khan, Luigi Capogrosso, Francesco Biondani +4Industrial Anomaly DetectionTime-Series Anomaly Detection

  2. TimeRadar: A Domain-Rotatable Foundation Model for Time Series Anomaly Detection

    Feb 22, 2026Hui He, Hezhe Qiao, Yutong Chen +2Time-Series Anomaly DetectionUnsupervised Anomaly Detection

  3. VETime: Vision Enhanced Zero-Shot Time Series Anomaly Detection

    Feb 18, 2026Yingyuan Yang, Tian Lan, Yifei Gao +6Time-Series Anomaly DetectionZero-Shot Anomaly Detection