arXiv:2610.20243cs.LGOct 2026

Manuscript Offprint

arXiv:2610.20243

Retrieval Over Training: Similarity search-based Model Selection for Time Series Anomaly Detection

Christos Panourgias, Roberto Stanzione, Adrien Petralia, Themis Palpanas, Paul Boniol

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Anomaly detection is a fundamental task for time-series analytics, with important implications for the downstream performance of many applications. Despite the large number of anomaly detection methods proposed in the literature, recent benchmark studies have shown that no single detector performs best across highly heterogeneous time series. Therefore, a practical and scalable solution is to develop a model-selection method that, for a given time series, selects the anomaly detector most likely to perform well. Nevertheless, the model selection approaches proposed in the literature suffer from a significant drop in accuracy when applied in Out-of-Distribution (OOD) settings. In this paper, we tackle the aforementioned limitation and propose RAMSAD, a retrieval-based framework for model selection in time-series anomaly detection. Given a new time series, our method queries a knowledge base of previously observed instances, retrieves the top-k most similar series, and transfers detector recommendations from their performance profiles. The framework can operate with standard similarity measures as well as embedding-based representations. Our results show that RAMSAD outperforms existing baselines in In-Distribution (ID) settings and is the most robust selector in OOD, where, when selecting a small subset of detectors, it matches or exceeds ensembles that run the entire detector pool, at a fraction of their cost. Overall, we demonstrate that similarity-based retrieval constitutes a strong and efficient foundation for model selection in time-series anomaly detection.

1 Introduction

Time-series anomaly detection is a fundamental problem in machine learning, with applications in healthcare, manufacturing, finance, energy, cybersecurity, and scientific monitoring. Its goal is to identify observations or subsequences that deviate from expected temporal behavior. Because the utility of downstream monitoring systems depends directly on the quality of anomaly detection, selecting an appropriate detector is a critical practical challenge [11,54][11, 54].

Despite substantial progress in the literature, time-series anomaly detection remains far from solved. A central difficulty is the extreme heterogeneity of time series encountered in practice. Real-world datasets differ widely in sampling rate, scale, length, noise characteristics, seasonality, dimensionality, and anomaly type. Recent benchmark studies have reinforced this observation, showing that there is no universally best anomaly detector across heterogeneous collections of datasets [46, 34]. This variability makes model selection a key problem in its own right.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Existing work has increasingly approached model selection with trainable strategies [58, 59]. These methods learn, from benchmark results or dataset representations, which detector to apply to a new series. While appealing, they add another layer of learning on top of an already difficult task, requiring additional supervision, tuning, and assumptions about generalization across domains. This complexity is not always justified, especially in heterogeneous settings where benchmark coverage is limited and domain shift is common. We therefore ask a simpler question: can anomaly-detector selection be solved without training a selector at all?

In this paper, we answer this question affirmatively. We propose RAMSAD (Retrieval-Augmented Model Selection for Anomaly Detection), a retrieval-based framework for time-series anomaly detection based on a training-free, non-parametric selector, i.e., it does not require fitting a separate

Figure

Figure 1: Comparison of RAMSAD with all automatic TSAD approaches (ID and OOD).

meta-learner; instead, it ranks candidate detectors directly from the performance of detectors on retrieved similar time series. The idea is simple: similar time series are likely to favor the same anomaly detector. We maintain a knowledge base of previously observed time series, together with the performance profiles of anomaly detectors when applied to these series; as for trained selectors, computing these profiles requires labels for the knowledge-base series, but never for the query. Given a new query series, we retrieve its top-k nearest neighbors and use their outcomes to rank candidate detectors. This turns model selection into a similarity-search problem, eliminating the need for a dedicated trained selector.

Our framework is flexible with respect to the representation used for retrieval. In particular, it supports multimodal embeddings obtained by contrastive alignment of time series with textual dataset descriptions. We evaluate the proposed approach in both in-distribution (ID) and out-of-distribution (OOD) settings. In addition, as illustrated in Figure 1, selecting an ensemble of N = 10 detectors improves robustness and achieves SOTA in ID and OOD performance while remaining substantially faster than competing train-dependent selectors. Training-free refers to the selector only: (i) like any supervised selector, RAMSAD needs a labeled knowledge base, but no labels for the query; (ii) the optional alignment module is trained offline without detector identities or performance, and queries need no description; and (iii) a frozen, off-the-shelf TSFM already outperforms all trained selectors. Our main contributions are as follows:

• We introduce a retrieval-based formulation of anomaly-detector selection for time series, casting the problem as non-parametric inference over a knowledge base of prior instances.

• We introduce a segment-to-series aggregation pipeline where we effectively translate segment-level similarity matches into a robust, series-level ranking.

• We propose RAMSAD 1^{1} for both classical similarity measures and learned embedding spaces, including multimodal time-series–text representations. We experimentally show that aligning TSFM embeddings with simple dataset descriptions provides a useful semantic signal that mainly improves retrieval in OOD.

• We empirically demonstrate that RAMSAD is a strong alternative to trainable selectors, delivering higher accuracy in ID and greater robustness in OOD, while incurring substantially lower cost.

References (69)