Time series anomaly detection (TSAD) is a critical task, but developing models that generalize to unseen data in a zero-shot manner remains a major challenge. Prevailing foundation models for TSAD predominantly rely on reconstruction-based objectives, which suffer from a fundamental objective mismatch: they struggle to identify subtle anomalies while often misinterpreting complex normal patterns, leading to high rates of false negatives and positives. To overcome these limitations, we introduce \texttt{TimeRCD}, a novel foundation model for TSAD built upon a new pre-training paradigm: Relative Context Discrepancy (RCD). Instead of learning to reconstruct inputs, \texttt{TimeRCD} is explicitly trained to identify anomalies by detecting significant discrepancies between adjacent time windows. This relational approach, implemented with a standard Transformer architecture, enables the model to capture contextual shifts indicative of anomalies that reconstruction-based methods often miss. To facilitate this paradigm, we develop a large-scale, diverse synthetic corpus with token-level anomaly labels, providing the rich supervisory signal necessary for effective pre-training. Extensive experiments demonstrate that \texttt{TimeRCD} significantly outperforms existing general-purpose and anomaly-specific foundation models in zero-shot TSAD across diverse datasets. Our results validate the superiority of the RCD paradigm and establish a new, effective path toward building robust and generalizable foundation models for time series anomaly detection.
翻译:时间序列异常检测(TSAD)是一项关键任务,但开发能够以零样本方式泛化至未见数据的模型仍然是一个重大挑战。当前主流的TSAD基础模型主要依赖于基于重构的目标函数,这类方法存在根本性的目标失配问题:它们难以识别细微的异常,同时常常误解复杂的正常模式,导致较高的漏报率和误报率。为克服这些局限,我们提出了\texttt{TimeRCD},这是一种基于新型预训练范式——相对上下文差异(RCD)构建的TSAD基础模型。与学习重构输入不同,\texttt{TimeRCD}通过显式训练来检测相邻时间窗口之间的显著差异,从而识别异常。这种关系型方法采用标准的Transformer架构实现,使模型能够捕捉基于重构的方法常常遗漏的、指示异常的上下文变化。为支持这一范式,我们构建了一个大规模、多样化的合成语料库,其中包含令牌级别的异常标签,为有效的预训练提供了必要的丰富监督信号。大量实验表明,\texttt{TimeRCD}在多种数据集的零样本TSAD任务中,显著优于现有的通用型及异常检测专用基础模型。我们的结果验证了RCD范式的优越性,并为构建鲁棒且可泛化的时间序列异常检测基础模型开辟了一条新的有效路径。