🤖 AI Summary
This study addresses the issue in time series anomaly detection where models frequently overlook contextual references, leading to erroneous predictions. To mitigate this, we propose a context-aware detection method based on counterfactual supervision. The approach freezes a pretrained time series foundation model and introduces a reference memory module alongside a zero-initialized gated adapter. Through a counterfactual supervision mechanism, the model is compelled to leverage contextual information to distinguish normal patterns across varying operational states, effectively overcoming the limitations of relying solely on query-sample fitting. Evaluated on the TSB-AD-U benchmark, our method significantly improves the mean VUS-PR from 0.542 to 0.607. These results validate the critical role of integrating contextual references in enhancing the accuracy of time series anomaly detection.
📝 Abstract
Whether a time-series pattern is anomalous often depends on the operating regime of the monitored process. A missing event can signal a fault in one regime and be routine in another, and the query alone may not reveal which regime applies. We study in-context learning (ICL) for time series anomaly detection (TSAD) through reference-conditioned detection, where a reference record provides evidence about expected behavior and model parameters remain fixed at inference. Supplying the reference is not enough: when training anomalies are recognizable from the query alone, the detector can fit its targets while ignoring the reference. We therefore introduce counterfactual supervision, which pairs one query with two references that support different normal rules and labels the query under each. At positions where the two labels disagree, no detector that ignores the reference can fit both targets. Anlu learns from this supervision by adding a reference memory and zero-initialized gated adapters to a frozen time-series foundation model (TSFM) pretrained for anomaly detection. On the 350 TSB-AD-U evaluation sequences, Anlu raises the mean VUS-PR of the frozen TSFM from 0.542 to 0.607. Replacing the reference with zeros lowers Anlu's score to 0.499.