betaFeedback

WorksComputer Science

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

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.

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].

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.

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 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-kk 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=10N = 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:

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

  • 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 RAMSAD1 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.

Foundations and Related Work

Notations. A dataset is denoted by D={T1,…,T∣D∣}\mathcal{D} = \{T_1, \ldots, T_{|\mathcal{D}|}\}, where each TiT_i is a univariate time series. Specifically, the ii-th series is written as Ti=[xi,1,xi,2,…,xi,Li]∈RLiT_i = [x_{i,1}, x_{i,2}, \ldots, x_{i,L_i}] \in\mathbb{R}^{L_i}, where Li=∣Ti∣L_i = |T_i| is the length of TiT_i, and xi,t∈Rx_{i,t} \in\mathbb{R} denotes the value of TiT_i at time index tt. A subsequence of length ℓ\ell extracted from TiT_i and starting at position tt is denoted by Ti(t,ℓ)=[xi,t,xi,t+1,…,xi,t+ℓ−1]∈RℓT_i^{(t,\ell)} = [x_{i,t}, x_{i,t+1}, \ldots, x_{i,t+\ell-1}] \in\mathbb{R}^{\ell}. The anomaly score of a detector DD applied on TiT_i is denoted as Si=[si,1,si,2,…,si,Li]∈RLiS_i = [s_{i,1}, s_{i,2}, \ldots, s_{i,L_i}] \in\mathbb{R}^{L_i}.

Time-Series Anomaly Detection. The latter can be grouped according to the underlying detection principle [11]. Distance-based methods identify anomalous subsequences by comparing them against their nearest neighbors in the series or in a reference set [28, 35, 72, 31]. Density-based methods instead detect anomalous behaviors by estimating how isolated observations or subsequences are in a representation space. This family includes distribution-based [5], graph-based [9, 61], tree-based [32, 37], and encoding-based [21]. Finally, prediction-based methods estimate expected temporal behavior and use prediction error as the anomaly proxy. These approaches can be divided into forecasting-based [64] and reconstruction-based [57]. A detailed review is provided in Appendix § 8.

Automatic Solutions

Recent benchmark studies for time-series anomaly detection [54, 33] have motivated automated strategies. Existing approaches can be grouped into three main categories illustrated in Figure 2: model selection, model ensembling, and model generation [34].

Figure 2. Automatic solutions for time series anomaly detection discussed in § 2.

Model Selection. Model selection methods aim to choose the best detector for a given time series. A large subset of this literature follows the meta-learning paradigm, where historical knowledge about detector performance is used to guide future choices. Simple meta-learners such as ARGOSMART [43] and ISAC [27] rely on similarity search over meta-features. Other approaches formulate selection through, (i) collaborative filtering [73], (ii) as a classification problem [58, 59], or (iii) as a regression problem that predicts expected detector performance scores [68, 41]. A different line of work, denoted as Internal in [34], estimates detector quality directly on the target series without labeled historical data, using (i) unsupervised surrogate metrics computed from anomaly scores [22], (ii) clustering-based internal validation criteria [42], (iii) synthetic anomaly injection [15], or (iv) the Model Centrality [30]. Building on multiple surrogate criteria, TSADAMS [24] aggregates detector rankings to obtain more robust recommendations.

Model Ensembling. Model ensembling combines the outputs of multiple detectors in order to improve robustness and detection quality. Outlier Ensemble (OE) [2] aggregates detector scores using simple operators such as the average, the maximum, or the average of maxima. More selective variants first identify a subset of reliable detectors before aggregation [50, 38]. Finally, AutoTSAD [55] provides a fully automated pipeline that generates synthetic data, optimizes detector configurations, and ensembles the most effective detectors into a final anomaly score.

Model Generation. Model generation typically relies on pseudo-labels that identify likely inliers and candidate outliers, and uses them to guide the combination of multiple detectors. For example, AutoOD-A [14] starts from a small set of pseudo-labels and iteratively expands it while pruning less effective detectors. Conversely, AutoOD-C [14] starts from a larger pseudo-labeled set and progressively removes labels. Finally, UADB [71] combines information from multiple detectors into a single booster model that iteratively refines anomaly predictions.

Limitations of Current Strategies: The scalability and OOD trade-off

Existing automatic solutions for time-series anomaly detection involve a trade-off between robustness, flexibility, and computational efficiency. Model ensembling and model generation can improve robustness by combining information from multiple detectors, but they typically require running a large part—or the entirety—of the detector pool before producing a final anomaly score, which can be prohibitively expensive for long time series or large detector collections (L1). Model selection addresses this issue more directly by aiming to choose a single detector for each series, but most existing approaches rely on train-dependent classification or regression models. As a result, they are often tied to a fixed detector pool, require retraining when the pool changes (L2), and may generalize poorly under domain shift (L3). These limitations motivate the search for a simpler and more flexible alternative without requiring a dedicated training phase for model selection.

Problem Definition

Let B={D1,…,DM}\mathcal{B} = \{D_1, \ldots, D_M\} be a finite pool of candidate anomaly detectors, and let D={T1,…,T∣D∣}\mathcal{D} = \{T_1, \ldots, T_{|\mathcal{D}|}\} be a collection of time series. For a given series Ti∈DT_i \in\mathcal{D} with ground-truth anomaly labels YiY_i, each detector Dj∈BD_j \in\mathcal{B} produces an anomaly score sequence Si,j=Dj(Ti)S_{i,j} = D_j(T_i), whose quality is evaluated through a performance measure Acc⁡(Si,j,Yi)\operatorname{Acc}(S_{i,j}, Y_i) (e.g., AUC-PR, F1, or VUS). The model selection problem is to construct a selector ΦK:D→2B\Phi_K : \mathcal{D} \to2^{\mathcal{B}}, which maps each time series TiT_i to a subset of KK detectors, ΦK(Ti)⊆B\Phi_K(T_i) \subseteq\mathcal{B}. The case K=1K = 1 recovers standard single-detector selection, while K>1K > 1 corresponds to selecting an ensemble. Let g(ΦK(Ti),Ti)g(\Phi_K(T_i), T_i) denote the score sequence obtained by applying the selected detector set to TiT_i, using the ensemble aggregation rule when K>1K > 1. The goal is for this selector to match, as closely as possible, the oracle choice ΦK⋆(Ti)=arg max⁡S⊆B, ∣S∣=KAcc⁡(g(S,Ti),Yi)\Phi_K^\star(T_i) = \operatorname*{arg\,max}_{S \subseteq\mathcal{B},\, |S|=K} \operatorname{Acc}(g(S,T_i), Y_i). Equivalently, model selection can be formulated as minimizing the expected regret: E(Ti,Yi)[Acc⁡(g(ΦK⋆(Ti),Ti),Yi)−Acc⁡(g(ΦK(Ti),Ti),Yi)]\mathbb{E}_{(T_i,Y_i)}[\operatorname{Acc}(g(\Phi_K^\star(T_i),T_i),Y_i) - \operatorname{Acc}(g(\Phi_K(T_i),T_i),Y_i)]. Under this formulation, the objective is to predict which detector or detector subset from B\mathcal{B} to select for a given series.

In this paper, we aim to address effectively model selection (addressing L1) using a framework based on a knowledge base and similarity search, and thus using a train-free selector (addressing L2). The main challenge remaining is on the definition of the similarity space and the retrieval process that minimize the effect of domain drift (i.e., OOD) on accuracy (addressing L3).

Scope. Throughout this paper, we consider static univariate time series, and OOD refers to domain shift: the query series comes from a domain that is entirely absent from the knowledge base. Temporal concept drift within a domain, streaming settings, and non-stationarity within a single long series (e.g., an anomalous pattern becoming normal over time) are outside the scope of our evaluation; we discuss them in Appendix F.1.

RAMSAD: Proposed Approach

To address the limitations mentioned above, we propose RAMSAD, a retrieval-based framework for selecting anomaly detectors for time series (cf. Figure 3). Our approach relies on the following two core principles.

Figure 3. Overview of RAMSAD.

Similarity Space & Alignment. From a time series database, we first partition each series into fixed-length segments and pair every segment with the textual description of its source dataset. We then encode the time-series segments with a TSFM to capture temporal structure, and encode the dataset descriptions with a sentence transformer to capture domain-level semantic information. While we demonstrate in Section 4 that our TSFM-based embedding is sufficient for in-distribution, the latter faces issues in OOD (i.e., Limitation L3). To cope with L3, we align the two modalities (i.e., text and time series) with lightweight MLP module that learns a shared vector space in which temporally and semantically related items are mapped close to one another. The aligned segment representations are then stored in a knowledge base together with the known accuracy scores across the candidate detectors. This semantically informed space is particularly useful in anomaly detection, where the interpretation of anomalous behavior depends strongly on context. For example, a sudden spike may indicate a fault in one domain but correspond to normal peak activity in another. By incorporating semantic information, the framework can better capture such differences and thus provide more reliable neighbors for model selection, especially in OOD settings. Alignment is an optional, offline refinement: the textual descriptions only shape the time-series space during training, so neither the knowledge base nor the query requires a description at inference time.

Detector Retrieval. At inference time, a query series is processed through the same segmentation and encoding pipeline and projected into the shared space using only the time-series projection head. Retrieval is first performed at the segment level, where the nearest neighbors of the query segments are identified. They are then aggregated into the top-kk retrieved series. For these retrieved series, we access the precomputed VUS matrix and compute, for each candidate detector, the average VUS over the retrieved neighbors. The detector with the highest average VUS is then selected.

The Core Retrieval Pipeline

We now describe the core retrieval mechanism of RAMSAD. The same pipeline can operate on the original space, TSFM embeddings, or our aligned representations presented in § 3.2.

Similarity Space Creation. RAMSAD is agnostic to the underlying similarity space. In the simplest setting, retrieval may be performed directly in the original time-series space, in which case segmentation is not necessary. For instance, Euclidean similarity can be computed on full series after truncating or padding them to a common length. We study such original space and distance alternatives in Appendix § 10.

Our main instantiation instead relies on embeddings produced by a TSFM [4]. We use TSFMs because they capture temporal structure more effectively than raw pointwise distances and standardize heterogeneous time series into fixed-dimensional representations. To build this embedding space, we partition each series into fixed-length segments of size min⁡(Li,8192)\min(L_i,8192), where 8192 is the maximum input size supported by Chronos2 [4] in one of our instantiations. Each segment is encoded as

zi,tts=fts(Ti(t,ℓ)), with zi,tts∈Rd,z_{i,t}^{\mathrm{ts}} = f_{\mathrm{ts}}\left(T_i^{(t,\ell)}\right), \text{ with } z_{i,t}^{\mathrm{ts}} \in\mathbb{R}^{d},

where ftsf_{\mathrm{ts}} may be instantiated with any TSFM or other time-series embedding backbone. Segmentation is therefore required by the bounded context of the encoder: it maps series of very different lengths to fixed-dimensional vectors that can be compared directly, and the aggregation step rewards candidate series that match the query consistently and accurately. We do not resample series and therefore make no claim of invariance to the sampling rate; segmentation may also discard dependencies longer than the encoder context (Appendix § 13.§ 1).

From Segment-to-Series Aggregation. Retrieval in RAMSAD is performed at the segment level, whereas model selection is defined at the series level. We therefore introduce an aggregation step that converts segment-level matches into a ranked list of candidate series. For simplicity, we use kk throughout to denote the retrieval size; because different query segments may retrieve segments originating from the same series, the final number of distinct candidate series may be smaller than kk.

Let TqT_q denote a query time series, and let {Tq(tq,ℓ)}ℓ=1m\left\{T_q^{(t_q,\ell)}\right\}_{\ell=1}^{m} be the mm extracted segments. For each segment Tq(tq,ℓ)T_q^{(t_q,\ell)}, we retrieve its top-kk nearest segments, {Tju,r(tu,r,ℓu,r)}r=1k\left\{T_{j_{u,r}}^{(t_{u,r},\ell_{u,r})}\right\}_{r=1}^{k}, together with their corresponding distances du,r=d(Tq(tu,ℓ),Tju,r(tu,r,ℓ))d_{u,r} = d(T^{(t_u,\ell)}_q, T^{(t_{u,r},\ell)}_{j_{u,r}}), for r∈{1,…,k}r \in\{1,\ldots,k\}. Each retrieved segment Tju,r(tu,r,ℓ)T^{(t_{u,r},\ell)}_{j_{u,r}} originates from the indexed time series Tju,r∈DT_{j_{u,r}} \in\mathcal{D}. For each candidate series Tj∈DT_j \in\mathcal{D}, we collect all retrieved distances associated with segments originating from TjT_j: A(Tj)={du,r:ju,r=j}A(T_j) = \{d_{u,r}: j_{u,r}=j\}. We then define a base similarity score, where smaller values indicate stronger similarity, as base⁡(Tj)=1∣A(Tj)∣∑d∈A(Tj)d\operatorname{base}(T_j) = \frac{1}{|A(T_j)|}\sum_{d\in A(T_j)}d.

A candidate series may be retrieved by many query segments or only by a few isolated ones. To distinguish consistent support from sporadic matches, we define the frequency of a candidate series TjT_j as the fraction of query segments for which at least one of the top-kk retrieved neighbors originates from TjT_j: freq⁡(Tj)=1m∣{u∈{1,…,m}:∃r∈{1,…,k} s.t. ju,r=j}∣\operatorname{freq}(T_j) = \frac{1}{m}|\{u \in\{1,\ldots,m\}: \exists r \in\{1,\ldots,k\}\ \text{s.t.}\ j_{u,r}=j\}|. We then combine freq⁡\operatorname{freq} with the base similarity score to obtain the final ranking score: score⁡(Tj)=1max⁡(ϵ,freq⁡(Tj))⋅base⁡(Tj)\operatorname{score}(T_j) = \frac{1}{\max(\epsilon,\operatorname{freq}(T_j))}\cdot\operatorname{base}(T_j), where ϵ>0\epsilon> 0 is a small constant. Candidate series are ranked in ascending order of score⁡(Tj)\operatorname{score}(T_j), and the top-kk retrieved series for query TqT_q are given by top⁡k(Tq)=arg⁡min⁡Tj∈Dkscore⁡(Tj)\operatorname{top}_k(T_q) = \arg\min_{T_j\in\mathcal{D}}^k \operatorname{score}(T_j).

Averaging distances across retrieved segments reduces sensitivity to isolated mismatches, while the frequency-aware term favors candidate series that receive consistent support across multiple query segments. The intuition of this approach is shown in Figure 4.

Segment-to-series aggregation in RAMSAD

Figure 4. Segment-to-series aggregation in RAMSAD.

Model Selection. Once the top-kk most similar series are retrieved, RAMSAD transfers detector recommendations from their stored performance profiles. We assume access to a precomputed performance table V∈R∣D∣×∣B∣\mathbf{V} \in\mathbb{R}^{|\mathcal{D}|\times|\mathcal{B}|}, where V(T,D)\mathbf{V}(T,D) denotes the accuracy (e.g., VUS-PR) of detector D∈BD \in\mathcal{B} on series T∈DT \in\mathcal{D}. Computing V\mathbf{V} requires a labeled knowledge base on which every candidate detector has been evaluated; this is the same supervision consumed by trained meta-learning selectors, whereas no label is needed for the query. For each detector we aggregate its performance over the retrieved neighbors: V‾D(Tq)=1∣top⁡k(Tq)∣∑T∈top⁡k(Tq)V(T,D)\overline{V}_D(T_q) = \frac{1}{|\operatorname{top}_k(T_q)|}\sum_{T\in\operatorname{top}_k(T_q)}\mathbf{V}(T,D). The selected detector for query TqT_q is then D^(Tq)=arg⁡max⁡D∈BV‾D(Tq)\hat{D}(T_q) = \arg\max_{D\in\mathcal{B}}\overline{V}_D(T_q). When selecting an ensemble of N>1N>1 detectors, the NN detectors with the highest V‾D(Tq)\overline{V}_D(T_q) are selected. Because the full performance profile of all candidate detectors is averaged over the neighborhood, a detector is selected only if it is broadly strong across the retrieved series. Similar series may favor different detectors, and the retrieved neighbors therefore need not agree on their individual best detector.

Enhancing the Similarity Space: Multimodal Semantic Alignment

We now describe the semantic alignment module that incorporates dataset-level context. As illustrated in Figure 5, semantic alignment structures TSFM embeddings using dataset-level context. This motivates aligning each segment with both its paired description and related descriptions.

Figure 5. Before alignment (top), TSFM embeddings lack semantic structure; semantic alignment injects dataset-level description information (bottom).

Integrating Dataset Descriptions. Each segment Ti(t,ℓ)T_i^{(t,\ell)} inherits the textual description of the dataset from which it is drawn. Let cic_i denote the description associated with the dataset of series TiT_i, and let zidesc=ftext(ci)z_i^{\mathrm{desc}} = f_{\mathrm{text}}(c_i) be its text embedding, where zidesc∈Rdz_i^{\mathrm{desc}} \in\mathbb{R}^d. In practice, ftextf_{\mathrm{text}} is instantiated with the all-mpnet-base-v2 Sentence Transformer. Since different datasets may belong to related domains, their descriptions can be similar even when the corresponding time-series segments are not identical.

Description Consistency and Multi-Positive Matching. A one-to-one alignment between time-series segments and dataset descriptions is overly restrictive, since different datasets often carry highly similar textual descriptions. In standard contrastive training, each segment has exactly one positive description, and every other description in the batch is treated as a negative and pushed away. When two datasets have near-synonymous descriptions then the description of the other dataset is wrongly declared a negative, which injects label noise in proportion to the number of near-duplicate descriptions in the benchmark. To account for this, we compute a description-similarity matrix from pairwise dot products between text embeddings. We then threshold this matrix at γ=0.95\gamma= 0.95 and treat any pair of descriptions with similarity ≥γ\geq\gamma as semantically compatible.

This yields a binary multi-positive matching matrix P∈{0,1}B×BP \in\{0,1\}^{B \times B} over a batch of BB time-series-segment–description pairs. An entry Pij=1P_{ij}=1 indicates that the jj-th text description is considered a valid positive for the ii-th segment, i.e., the segment may plausibly originate from the domain or context described by that text. This matrix can therefore contain multiple positive entries per row. We additionally mask out in-batch pairs coming from the same time series, so that valid positives must originate from a different series than the anchor.

Symmetric Alignment Objective. Because one description may match multiple segments and one segment may be compatible with multiple descriptions, we optimize a symmetric multi-positive contrastive objective. The objective is symmetric because it is applied in both directions: from time-series segments to descriptions and from descriptions to time-series segments. The exact formulation of the loss is given in Appendix § 9.§ 2.

Using the Aligned Space at Inference. The alignment module has two projection heads, one per modality (Appendix § 9.§ 2), and the text head is only used inside the training objective. At knowledge-base construction and at query time, all series follow the same path and retrieval is entirely time-series-to-time-series: text embeddings are neither stored in the index nor computed for a query, so a query never requires a description. Moreover, the alignment objective only uses the correspondence between segments and descriptions; it never uses detector identities or detector-performance values, so it is independent of the selection task, and the selector itself remains training-free. In our OOD experiments, the alignment module is trained without the target domain and is applied to that domain without any retraining: a query from an unseen domain is mapped close to the semantically closest domains covered by the knowledge base.

System Complexity

In RAMSAD, the dominant cost arises from segment retrieval. With exact search, processing a batch of bb query segments requires computing similarities against all nn indexed segments, leading to O(bnd)O(bnd) query time and O(nd+∣D∣M)O(nd + |\mathcal{D}|M) persistent storage for the embedding database and the performance matrix. An HNSW index avoids exhaustive comparisons at a small extra storage cost, making retrieval sublinear. A detailed analysis is deferred to Appendix § 9.§ 6.

Experimental Evaluation

We first compare our proposed approach with SOTA automated solutions both in terms of accuracy and efficiency. We then evaluate it when using different similarity spaces. We provide additional analysis for scalability (Appendix § 9.§ 6) and parameter sensitivity (Appendix § 10).

Experimental Setup: We evaluate on TSB-AD [33], which includes 870 univariate time series from 9 domains, using the same train/test splits as recent model selection benchmarks [34] (details in Appendix § 11.§ 1). We compare against 25 automated solutions, including model selection, ensemble, model generation, and simple reference strategies such as Oracle, SS, GB, Random, and FM; all methods are described in Appendix § 11.§ 3. Among these, Oracle and Supervised Selectors (SS) are not deployable methods but oracle-style upper-bound references: Oracle picks the best detector of each test series, while SS selects the detector using the labels of a portion of the target series itself, which are unavailable to RAMSAD and to all other selectors. The candidate pool contains 32 univariate time-series anomaly detectors from TSB-AD [46], listed in Appendix § 11.§ 2 where 19 of them are also applicable to multivariate series [34]. We evaluate accuracy using VUS-PR [45, 12]. For RAMSAD, we test k∈[1,10]k \in[1,10], and use k=6k=6 as default. In ID, the knowledge base holds the 619 training series as 3,264 segments, and the 251 test series give 1,383 query segments. In OOD, we hold out each of the 9 domains in turn, removing its series from the knowledge base and from alignment training such that no query has a same-domain neighbor, and no retraining is performed for the target domain.

In-Distribution Evaluation (ID). Figure 6 (a) shows the overall VUS-PR score on the in-distribution test split (i.e., 251 series) for all approaches, which are categorized according to the underlying methodology. RAMSAD outperforms all other baselines, achieving an average VUS-PR score of 0.74. This shows that a retrieval-based selector, without any trained meta-learner, can outperform trained meta-learning selectors. Among other baselines, the best model selector is SATZilla, with an average VUS-PR of 0.69; the best ensemble approach is OE, with an average VUS-PR of 0.64; the best model generation is UADB with an average VUS-PR of 0.62. Unsupervised model selection methods lag significantly behind; the best performer, Synthetic [15], achieves only 0.40, highlighting the difficulty of unsupervised selection. In the critical difference diagram (Figure 6(b)), RAMSAD stands out as the best overall approach with an average rank of 6.97, ahead of the best baseline, SATZilla, which recorded an average rank of 8.90.

Figure 6. VUS-PR comparison for in-distribution (panel a) and out-of-distribution settings (panel c), with the associated Critical Difference Diagrams (panels b and d, resp.).

Out-of-Distribution Evaluation (OOD)

We now consider the out-of-distribution scenario, in which for a time series of a given domain, model selectors can only consider a training set composed of time series from other domains. This can be noticed in Figure 6(c): all model selection approaches are affected by OOD, which is expected since every selector must generalize to a domain that is absent from its training data. For example, SATZilla has an average VUS-PR of 0.50 (−0.19-0.19 w.r.t. the ID setting), and in general all selection approaches showed VUS-PR drops of around 0.19–0.20. RAMSAD is also challenged by OOD, achieving an average VUS-PR of 0.59. However, RAMSAD is less affected than other selectors, with a drop of −0.16-0.16, showing better robustness and even managing to outperform some of ensembles and model generation approaches such as AutoTSAD and AutoOD-A. The CD plot in Figure 6(d) summarizes the average ranking of each approach, with OE achieving the best ranking (7.5), followed by UADB (8.7). Notably, the performance of RAMSAD (avg. rank of 9.9) is not statistically different from OE and UADB, widening the gap with other model selectors that were closer in the ID scenario. RAMSAD therefore attains comparable robustness at a fraction of the cost, matching these methods while running a single detector. Despite being the best approaches in the OOD setting,

OE and UADB need to run all the 32 detectors. However, we will show in the following section that RAMSAD can outperform these approaches by selecting a much smaller subset of detectors.

Selecting Multiple Detectors. Figure 7(a) shows the average VUS-PR achieved by RAMSAD in ID scenarios when selecting ensembles of 2 to 10 detectors, illustrating the effect of different values of kk and comparing against the best ID and OOD baselines, SATZilla and OE, respectively, while also reporting the execution time required to run the selected detector(s). Already with a single detector (N=1N = 1), RAMSAD outperforms SATZilla by 4%. As a further benefit, selecting ensembles increases the average VUS-PR up to 0.77, widening the gap to SATZilla to 8% and achieving a 12% accuracy improvement over OE. In OOD (Figure 7(b)), RAMSAD outperforms SATZilla by 9% with N=1N = 1, and accuracy keeps improving as NN increases: with N=10N = 10 the gap to SATZilla grows to 17%, and RAMSAD exceeds OE by 2% while being ×4.7\times4.7 faster. The latter is further supported by the boxplots and CD diagrams in Figure 6. The ensemble version of RAMSAD outperforms all baselines in ID and OOD, while being one order of magnitude faster than the second best in OOD. Most notably, RAMSAD ensemble has no statistically significant difference from the oracle.

Figure 7. RAMSAD anomaly detection Runtime vs Accuracy by varying kk and NN.

Parameter Sensitivity. Figure 7 shows the behaviour of RAMSAD for different values of kk and NN in both ID and OOD. Overall, RAMSAD is stable across values of kk: in the ID setting, VUS-PR varies only marginally, with a maximum difference of about 0.04, while in the OOD setting the variation is slightly larger, up to 0.07 for N=1N = 1, but decreases as the ensemble size increases; in all cases, RAMSAD consistently outperforms the best model selector, SATZilla.

Selection Latency. Beyond the cost of running the selected detectors, Table 1 isolates the cost of the selection itself, from a raw query series to a recommendation. RAMSAD is the fastest selector (20 ms), where its TSFM forward pass is cheaper than the catch22 extraction used by the meta-learners, which alone takes 38 ms. RAMSAD is also the most predictable as its latency varies by 0.4 ms across queries. End-to-end, single-detector selectors cost one detector run plus 39–490 ms, RAMSAD one run plus 20 ms (N=1N = 1) or ten runs plus 20 ms (N=10N = 10), and full-pool methods 32 runs. As OE is the cheapest of the latter, the ×4.7\times4.7 speed-up of RAMSAD (N=10N = 10) over OE lower-bounds its speed-up over UADB, AutoTSAD, AutoOD-A, and HITS.

RAMSADARGOSMARTISACMSADSATZillaURegMetaODCFact
Features19.637.6 (catch22, shared)
Inference0.051.125.625.839.7221.8426.7453.4
Median19.638.863.363.677.1258.0463.4489.6
Std0.47.87.88.312.225.128.632.2

Table 1. Latency from query series to detector recommendation, for single-detector selectors

Knowledge-Base Coverage and Detector-Pool Size. Since RAMSAD relies on a labeled knowledge base, we study how its coverage affects selection (Figure 8; details in Appendix § 12). Reducing the knowledge base, RAMSAD still outperforms SATZilla in OOD with 10% of the training set, and in ID is comparable from 20% and better from 80%. Reducing the detector pool, it matches or outperforms SATZilla with half of it. With the leave-one-domain-out protocol this indicates that what matters is proximity in the representation space rather than shared domain membership.

Figure 8. RAMSAD VUS-PR when randomly reducing the knowledge base (left) and the detector pool (right).

Similarity Spaces Comparison. We compare three retrieval spaces for RAMSAD: (1) original time-series, (2) TSFM embedding, and (3) semantically aligned.

Figure 9 summarizes the main trends (full evaluation in Appendix § 10). First, DTW, the strongest original-space baseline, reaching VUS-PR of 0.69 in ID and 0.44 in OOD, remains below the best TSFM and aligned-TSFM spaces. By comparison, retrieval in the plain TSFM, such as Chronos2, reaches 0.75 in ID and 0.59 in OOD. Second, the strongest overall behavior is obtained in the aligned TSFM space. Figure 9 shows that the aligned-TSFM performances are similar to the plain TSFM space in ID, and improve on them in OOD. In OOD, the domain of the query is unknown, and temporal patterns alone may be insufficient to identify the most informative source series. In this case, incorporating semantic information becomes more important, which explains why the aligned space yields a clearer advantage in OOD. Dataset-level descriptions inject a coarse domain prior that, for some backbones, slightly lowers ID accuracy while improving cross-domain transfer (Appendix § 10.§ 2). Alignment is thus an OOD-oriented refinement rather than a prerequisite.

Figure 9. Comparison between original space (Euclidean and DTW), TSFM (light color), and aligned TSFM embedding spaces (darker color).

Implication in Modern LLM-based Systems. RAMSAD can also serve as the retrieval component (RAG) of LLM-based anomaly-detection pipelines. To support this claim, Figure 10 reports the average VUS-PR achieved when using a high-capacity LLM (mistral-large-3, 675B) as model selector, to which we provided different types of TS representations, including features (Catch 22 [36] and TSFresh [16]), images (full, spectral, and subsequence image), and LLM-generated summaries describing the latter (denoted as txt in the figure). As we can see, the VUS-PR performance is rather low (between 0.28 and 0.42). Applying RAMSAD, we retrieved 5 similar training examples and provided their detectors’ VUS-PR scores to the LLM. This drastically increased performances, with scores ranging from 0.66 to 0.72. While some of these results exceed the previous SOTA (0.69), they are still slightly lower than RAMSAD. RAMSAD supports post-hoc explainability, since retrieved neighbors and their detector-performance profiles can be given to ChatTS [65] to generate a rationale for the selected model.

Figure 10. LLM-based model selection with and without RAG support (+RAMSAD).

Conclusion

We presented RAMSAD, a retrieval-based framework for model selection in time-series anomaly detection. By selecting detectors through similarity to previously observed series, RAMSAD avoids training a dedicated selector while remaining flexible and efficient; its optional semantic alignment is trained offline, independently of the selection task. Our key takeaways are as follows:

Takeaway 1: RAMSAD is the strongest overall method: it achieves the best single-model performance in ID and, when used to select small ensembles, reaches SOTA results in both ID and OOD while selecting substantially fewer detectors than full-pool ensemble methods.

Takeaway 2: TSFM-based retrieval spaces are preferable for RAMSAD; among them, semantically aligned TSFM spaces deliver the strongest overall performance, mainly through improved OOD transfer, while unaligned TSFM spaces already outperform trained selectors.

These findings establish retrieval as a competitive foundation for anomaly-detector selection in heterogeneous time series. We also observe (in preliminary experiments) that even when neighbours disagree, the averaged profile in RAMSAD still picks the right detector; we defer a detailed study to future work. Extending RAMSAD to multivariate series, temporal concept drift, and queries far from every covered domain are also interesting directions for future work (Appendix § 13.§ 1).

Acknowledgments and Disclosure of Funding

Supported by EU Horizon project DataGEMS (101188416). This work was granted access to the HPC resources of IDRIS under the allocations 2025-A0191012641 and 2025-AD011016632 by GENCI. We thank Azedine Mani, Head of the IT team (UFR Mathématiques et Informatique, Université Paris Cité), for his pivotal role in creating and making available computational resources essential to this work. The authors declare no competing interests.

Literature Review

Time-series anomaly detection (TSAD) has been studied extensively in recent years because of its importance in monitoring, diagnosis, and decision support across domains such as healthcare, manufacturing, finance, energy, and cybersecurity [8, 54]. A central challenge in TSAD is that anomalies may take very different forms, and the statistical properties of time series vary widely across datasets. As a result, the literature has produced a large variety of detectors, each relying on different assumptions about temporal structure, recurrence, noise, and anomaly manifestation. Recent surveys and benchmark studies consistently show that this diversity prevents the emergence of a single universally best detector across heterogeneous benchmark collections [46, 54, 34, 59].

Taxonomy of TSAD methods. A common organization of the TSAD literature distinguishes three broad families: distance-based, density-based, and prediction-based methods [8, 54, 59]. Distance-based approaches identify anomalous observations or subsequences by measuring dissimilarity with respect to previously observed patterns. This family includes nearest-neighbor and discord-style methods, as well as matrix-profile-based approaches that search for subsequences with unusually large distances to their closest matches [28, 35, 72, 31]. These methods are often effective when anomalies correspond to rare subsequences that clearly depart from the dominant motifs of the series.

Density-based methods instead assess how isolated an observation or subsequence is in an induced representation space. Rather than relying only on raw temporal distances, they estimate local or global concentration patterns and flag sparse or weakly supported regions as anomalous. This category spans several subfamilies, including distribution-based approaches, graph-based methods, tree-based methods, and encoding-based methods [5, 9, 61, 32, 37, 21, 59]. Such methods are attractive when the notion of anomaly is better captured through structural relations or learned representations than through direct pointwise comparison.

Prediction-based methods model expected temporal behavior and use prediction error as the anomaly signal. They are commonly divided into forecasting-based and reconstruction-based approaches [64, 57, 59]. Forecasting-based detectors predict future values from the past and treat large residuals as indicators of anomalous behavior, whereas reconstruction-based methods learn a compact representation of normal temporal patterns and detect anomalies via reconstruction error. These approaches are particularly appealing when normal dynamics are regular enough to be predicted or reconstructed reliably.

Why detector performance varies across datasets. The lack of a universally dominant detector is now a well-established empirical finding in TSAD benchmarks [46, 54, 34]. A key reason is the heterogeneity of anomaly types. Following prior work, anomalies are often categorized as point, contextual, or collective anomalies [59]. Point anomalies correspond to isolated values that strongly deviate from the bulk of the series, contextual anomalies are abnormal relative to a local temporal context, and collective anomalies arise when a subsequence is abnormal as a whole even if individual points are not. Different detector families are naturally better suited to different anomaly types, which already makes detector performance highly dataset dependent.

A second source of variability comes from the structure of the time series itself. Even within the same anomaly category, datasets may differ in length, periodicity, stationarity, noise level, sampling characteristics, and the number and diversity of normal regimes [54, 59]. For example, a detector that works well on time series with a single stable normal pattern may degrade substantially when applied to non-stationary data or to series containing multiple normalities. Similarly, methods that are effective for isolated rare events may behave differently when anomalies are frequent, repeated, or highly heterogeneous. These observations explain why benchmark studies repeatedly conclude that detector rankings are unstable across domains and that model choice should depend on the target series rather than on a single globally best detector [46, 34].

Automatic detector selection. These benchmark findings have motivated a growing literature on automatic approaches for choosing or combining detectors [34], which is summarized in Figure 2. The first line of work is model selection, where the objective is to choose the detector expected to perform best on a given time series. Many of these methods follow a meta-learning perspective: they use benchmark results together with representations of datasets or time series to learn how detector performance varies across problems. Classical algorithm-selection approaches such as ARGOSMART and ISAC rely on similarity in a meta-feature space, selecting either the best detector on the nearest training instance or the best detector inside a nearest cluster [43, 27]. Other approaches formulate selection through collaborative filtering, regression, or classification, predicting detector identity or detector performance from dataset characteristics [73, 68, 41, 58, 59].

A complementary group of methods avoids supervised meta-learning and instead evaluates candidate detectors directly on the target time series using internal criteria. These approaches include unsupervised score-evaluation techniques, clustering-based validation criteria, and detector-assessment schemes based on synthetic perturbations or rank aggregation [22, 42, 15, 24]. Their main appeal is that they do not require labeled historical performance data. However, they generally still require executing multiple detectors on the target series, which can substantially reduce their practical advantage when the candidate pool is large.

Model ensembling and model generation. A second major line of work is model ensembling, where multiple detectors are executed and their scores are aggregated to improve robustness [2]. Simple averaging or max-based ensembles often provide a strong baseline because they hedge against detector-specific failures. More selective ensembling methods attempt to identify a subset of reliable detectors before aggregation [50, 38]. At a larger systems level, AutoTSAD automates detector configuration, synthetic data generation, and final ensembling within a unified pipeline [55]. Although ensembles can be effective, their main limitation is computational: they typically require running many or all detectors before producing a final anomaly score.

A third direction is model generation, where multiple detector outputs are used to build a new detector, usually through pseudo-labeling or boosting. Examples include AutoOD-A and AutoOD-C, which iteratively refine pseudo-labels and detector subsets, and UADB, which learns a booster from the outputs of several detectors [14, 71]. These approaches can improve robustness and adaptivity, but they are also more complex, and like ensembling methods they often require evaluating a substantial fraction of the detector pool.

Position of our work. Our work is most closely related to the model selection line, but it departs from most recent TSAD selectors in an important way. Whereas much of the recent literature formulates detector selection as a trainable classification or regression problem [58, 59], we revisit a simpler non-parametric principle: similar time series should tend to prefer similar detectors. This intuition is related to earlier similarity-based algorithm selection methods such as ARGOSMART and ISAC [43, 27], but our framework is tailored to TSAD and is explicitly designed to operate directly on time-series similarity spaces, including raw-distance retrieval and embedding-based retrieval. In contrast to trainable selectors, retrieval-based model selection does not require fitting a separate predictive selector, can adapt naturally when the detector pool changes, and offers a simple way to leverage rich pretraining time-series representations.

Overall, the literature suggests two conclusions that motivate our approach. First, detector performance in TSAD is fundamentally heterogeneous, so automatic adaptation is necessary [46, 34]. Second, while many existing automatic solutions are effective, they often rely either on heavy training pipelines or on the execution of many detectors at inference time [59, 55]. This leaves room for lightweight alternatives that exploit similarity structure in previously observed benchmark instances. Our proposed framework addresses this gap by casting detector selection as retrieval over a knowledge base of time series and detector-performance profiles.

RAMSAD Method Details

Notation

Table 2 summarizes the main notation used throughout the paper and appendix. We group the symbols into two parts. The first part introduces the general time-series anomaly-detection setting, including the collection of time series, candidate detectors, detector scores, labels, and performance measures. The second part defines the notation specific to RAMSAD, including the time-series and text encoders, segment and description embeddings, retrieval scores, the detector-performance matrix, and the semantic-alignment objective.

SymbolDescription
D\mathcal{D}Collection of time series
Ti,LiT_i, L_iThe ii-th univariate time series and its length
Ti(t,ℓ)T_i^{(t,\ell)}A subsequence of length ℓ\ell extracted from TiT_i starting at index tt
B\mathcal{B}Finite pool of candidate anomaly detectors
DjD_jThe jj-th candidate anomaly detector
Si,j,YiS_{i,j}, Y_iAnomaly score sequence produced by DjD_j on TiT_i, and ground-truth labels
Acc⁡(⋅)\operatorname{Acc}(\cdot)A performance measure (e.g., AUC-PR, F1, VUS)
Φ,Φ⋆\Phi, \Phi^{\star}The model selector function, and the oracle choice
MMThe number of all detectors
NNThe number of detectors selected for an ensemble
RAMSAD Core Retrieval & Alignment
fts,ftextf_{ts}, f_{text}Time-series foundation model (encoder) and Text encoder
zits,zidescz_i^{ts}, z_i^{desc}Encoded representations of time-series segment and text description
Tq,mT_q, mA query time series, and the number of segments extracted from it
kkNumber of retrieved neighbors
A(Tj)A(T_j)Set of retrieved distances associated with segments from series TjT_j
base(Tj),freq(Tj)base(T_j), freq(T_j)Base similarity score and frequency score of candidate series TjT_j
score(Tj)score(T_j)Final ranking score of candidate series TjT_j
π(⋅)\pi(\cdot)Function mapping a segment to its originating time series
topk(Tq)top_k(T_q)The final top-kk retrieved series for query TqT_q
VVPrecomputed performance matrix of detectors over the database
V‾D(Tq)\overline{V}_D(T_q)Aggregated performance of detector DD over retrieved neighbors
D^(Tq)\widehat{D}(T_q)The final selected detector for query TqT_q
γ\gammaSimilarity threshold for multi-positive matching
τ\tauTemperature used in the contrastive alignment loss
P,L\mathcal{P}, \mathcal{L}Binary multi-positive matching matrix, and symmetric alignment loss
Ri,QjR_i, Q_jPositive sets for time-series segment ii and description jj in the symmetric alignment loss

Table 2. Table of main symbols used in RAMSAD.

Semantic Alignment Training

Trainable parameters. The time-series and text embeddings are precomputed using Chronos2 and all-mpnet-base-v2, respectively. During alignment training, these backbone embeddings remain frozen, and only the projection heads are optimized. Each projection head is implemented as a lightweight multilayer perceptron of the architecture illustrated in Figure 11 with hidden width equal to 2×2 \times the projection dimension. The outputs are ℓ2\ell_2-normalized before computing similarities in the shared space.

Figure 11. Semantic Alignment Architecture

Optimization. Semantic alignment is trained with AdamW using learning rate 10−510^{-5}, weight decay 10−410^{-4}, and β=(0.9,0.999)\beta= (0.9, 0.999). Training runs for 300 epochs with gradient clipping at norm 1.0. We use a warmup-cosine learning-rate schedule, consisting of a linear warmup for the first 10 epochs followed by cosine decay to zero. The default batch size is 8192. The training split is capped at 100,000 samples, and examples are sampled using a stratified-uniform procedure so as to approximately balance the chosen stratification labels.

Validation split and batching. The default train/validation split is 0.8/0.2, applied independently within each stratification group whenever possible. Stratification is based on the dataset-description column by default, with fallback to raw description text when needed.

Loss configuration. The default alignment objective is the multi-positive loss described in the main paper. We use temperature 0.1 and define positive matches through description-embedding similarity, using a cosine-similarity threshold of 0.95. In addition, we mask same-series pairs so that positives must come from different time series within the batch. The framework also supports alternative loss functions such as contrastive, cosine, and distance-based objectives, though the reported experiments use the multi-positive setting.

Why multi-positive targets. Contrastive alignment is trained in batches, where each segment is paired with exactly one description, its positive. The model computes the similarity between each segment and every description in the batch, normalizes each row into a probability distribution, and minimizes the negative log-probability of the correct entry. Because each row must sum to one, raising the probability of the positive necessarily lowers that of every other entry (i.e. every other description in the batch is implicitly treated as a negative and pushed away). This assumption breaks in our setting. For a segment from dataset AA, the description of dataset BB is declared a negative even when AA and BB have near-synonymous descriptions (e.g., two distinct server-monitoring datasets). The objective then pushes the segment away from a semantically valid description, injecting label noise in proportion to the number of near-duplicate descriptions in the benchmark. We therefore treat pairs of descriptions whose frozen sentence-transformer embeddings have cosine similarity of at least γ=0.95\gamma= 0.95 as positives, which replaces the single correct answer per row by a multi-positive target matrix where a segment is no longer penalized for scoring highly against a description whose meaning matches its own. Note that this target matrix is computed from the frozen text embeddings only and it does not depend on the time-series embeddings or on the trainable projections, which only enter the predicted cross-modal similarities that the loss pushes toward the targets.

Use of the trained heads at inference. Only the time-series projection head is used after training: knowledge-base segments and query segments are both encoded by the frozen TSFM, projected by the time-series head, and ℓ2\ell_2-normalized, and retrieval compares them by cosine similarity. The text head and the text embeddings are neither stored in the index nor computed for a query. The alignment objective never uses detector identities or detector-performance values.

Symmetric Alignment Loss. The symmetric multi-positive objective can be understood as a batchwise extension of standard contrastive learning. For each time-series segment ii, the denominator ∑j=1Bexp⁡(sij)\sum_{j=1}^{B} \exp(s_{ij}) normalizes the similarities to all descriptions in the batch, thereby defining a softmax distribution over candidate text matches. The numerator ∑j∈Riexp⁡(sij)\sum_{j\in R_i} \exp(s_{ij}) collects the probability mass assigned to the subset of descriptions regarded as valid positives for that segment. The first summation term therefore encourages each segment embedding to assign high total probability to all compatible descriptions, rather than forcing the mass onto a single one-hot target.

The second term plays the same role in the reverse direction. For each description jj, the denominator ∑i=1Bexp⁡(sij)\sum_{i=1}^{B} \exp(s_{ij}) defines a softmax distribution over all time-series segments in the batch, while the numerator ∑i∈Qjexp⁡(sij)\sum_{i\in Q_j} \exp(s_{ij}) aggregates the mass assigned to the set of compatible segments. This enforces alignment both from segment to description and from description to segment, making the objective symmetric across modalities.

This multi-positive formulation is important in our setting because the supervision is inherently many-to-many. Different datasets may have highly similar descriptions, so several descriptions can be valid semantic matches for the same segment. Likewise, one description may be compatible with many segments from related time series. By summing over all positives in the numerator, the objective rewards the model whenever it concentrates probability mass on any semantically valid match, instead of penalizing it for not selecting one arbitrarily designated target. Since the softmax normalization couples positives and negatives, assigning more mass to valid matches necessarily reduces the mass assigned to incompatible pairs, so the loss remains contrastive.

Formally, letting sij=(zits)Tzjdesc/τs_{ij} = (\boldsymbol{z}^{\mathrm{ts}}_i)^{\mathsf{T}}\boldsymbol{z}^{\mathrm{desc}}_j/\tau denote the temperature-scaled similarity between normalized projected embeddings, and letting RiR_i and QjQ_j denote the positive sets for segment ii and description jj, respectively, the loss is

L=−12B[∑i=1Blog⁡∑j∈Riexp⁡(sij)∑j=1Bexp⁡(sij)+∑j=1Blog⁡∑i∈Qjexp⁡(sij)∑i=1Bexp⁡(sij)].\mathcal{L} = -\frac{1}{2B}\left[\sum_{i=1}^{B}\log\frac{\sum_{j\in R_i}\exp(s_{ij})}{\sum_{j=1}^{B}\exp(s_{ij})}+\sum_{j=1}^{B}\log\frac{\sum_{i\in Q_j}\exp(s_{ij})}{\sum_{i=1}^{B}\exp(s_{ij})}\right].

Training loop and model selection. At each epoch, the model is trained on all mini-batches, evaluated on the validation set, and then updated by the scheduler. Validation performance is measured not only by loss but also by retrieval-style top-1 and top-5 accuracy in the shared space. More precisely, projected time-series and text embeddings are compared through matrix similarity, and retrieval is considered correct when the matched item belongs to the valid multi-positive set. Figure 12 reports the evolution of retrieval performance during training. The consistent increase in top-1 and top-5 accuracy across epochs indicates that the semantic alignment objective successfully improves cross-modal matching between time-series segments and dataset descriptions. The checkpoint with the lowest validation loss is stored.

Figure 12. As training evolves, the true series–description matches are found more effectively in their batch multi-positive similarity matrices.

The full semantic-alignment training procedure is given in Algorithm 1. For each mini-batch, RAMSAD first encodes time-series segments and their associated textual descriptions using frozen pretrained encoders, and then maps both embeddings into a shared space through trainable projection heads. The algorithm constructs a multi-positive target matrix from in-batch description similarities, allowing semantically similar descriptions to act as valid positives rather than enforcing a single one-to-one match. After masking same-series pairs, the model optimizes the symmetric alignment loss described above, thereby learning a cross-modal space in which time-series segments and compatible descriptions are brought closer together.

Segment-to-Series Aggregation

Segment-level retrieval returns nearest neighbors for each query segment independently. However, detector selection in RAMSAD is performed at the level of full time series, since detector-performance profiles are stored for each training series rather than for individual segments. We therefore aggregate the segment-level neighbors into a ranked list of candidate series. The aggregation procedure counts how consistently a training series is retrieved across different query segments and combines this frequency information with the average retrieval distance of its matched segments. This favors training series that are both close to the query in representation space and repeatedly retrieved across multiple parts of the query series.

Algorithm 2 describes this aggregation step. For each retrieved segment neighbor, we record its source time series and associated retrieval distance. For every candidate source series, RAMSAD computes a base distance score by averaging all distances assigned to that series, and a frequency score measuring the fraction of query segments for which the series appears among the retrieved neighbors. The final aggregation score rescales the average distance by the inverse of the frequency score, so that series retrieved more consistently across the query receive a better rank. The top-ranked series are then passed to the detector-selection step.

Algorithm 1 Semantic Alignment Training for RAMSAD

Input: dataset D={T1,…,T∣D∣}\mathcal{D} = \{T_1,\ldots,T_{|\mathcal{D}|}\}, dataset descriptions {ci}i=1∣D∣\{c_i\}_{i=1}^{|\mathcal{D}|}, time-series encoder ftsf_{\mathrm{ts}}, text encoder ftextf_{\mathrm{text}}, projection heads gθtsg_{\theta^{\mathrm{ts}}} and gθdescg_{\theta^{\mathrm{desc}}}, segment length ℓ\ell, similarity threshold γ\gamma, maximum number of epochs Emax⁡E_{\max}, batch size bb, learning rate η\eta

Output: learned projection parameters θts,θdesc\theta^{\mathrm{ts}}, \theta^{\mathrm{desc}}

  1. construct the set of segment–description pairs

P={(Ti(t,ℓ),ci):Ti∈D, Ti(t,ℓ) is a segment extracted from Ti}\mathcal{P} = \left\{\left(T_i^{(t,\ell)},c_i\right): T_i \in\mathcal{D},\ T_i^{(t,\ell)}\text{ is a segment extracted from }T_i\right\}
  1. for epoch =1,…,Emax⁡= 1,\ldots,E_{\max} do

  2.  for each mini-batch B={(Tiu(tu,ℓ),ciu)}u=1b⊂PB = \left\{\left(T_{i_u}^{(t_u,\ell)},c_{i_u}\right)\right\}_{u=1}^{b} \subset\mathcal{P} do

  3.   encode time-series segments

zuts=fts(Tiu(tu,ℓ)),u=1,…,bz_u^{\mathrm{ts}} = f_{\mathrm{ts}}\left(T_{i_u}^{(t_u,\ell)}\right),\qquad u=1,\ldots,b
  1.   encode descriptions using the frozen text encoder

zudesc=ftext(ciu),u=1,…,bz_u^{\mathrm{desc}} = f_{\mathrm{text}}\left(c_{i_u}\right),\qquad u=1,\ldots,b
  1.   project both modalities into the shared space

z~uts=gθts(zuts),z~udesc=gθdesc(zudesc)\widetilde{z}_u^{\mathrm{ts}} = g_{\theta^{\mathrm{ts}}}\left(z_u^{\mathrm{ts}}\right),\qquad\widetilde{z}_u^{\mathrm{desc}} = g_{\theta^{\mathrm{desc}}}\left(z_u^{\mathrm{desc}}\right)
  1.   compute the in-batch description similarity matrix

Auv=⟨zudesc,zvdesc⟩A_{uv} = \left\langle z_u^{\mathrm{desc}},z_v^{\mathrm{desc}}\right\rangle
  1.   build the multi-positive target matrix P∈{0,1}b×bP \in\{0,1\}^{b \times b}

Puv=1[Auv≥γ]P_{uv} = \mathbb{1}[A_{uv} \ge\gamma]
  1.   mask pairs coming from the same source series

  2.   compute the cross-modal similarity matrix

Suv=⟨z~uts,z~vdesc⟩S_{uv} = \left\langle\widetilde{z}_u^{\mathrm{ts}},\widetilde{z}_v^{\mathrm{desc}}\right\rangle
  1.   compute the symmetric cross-modal alignment loss L(S,P)\mathcal{L}(S,P)

  2.   update θts,θdesc\theta^{\mathrm{ts}},\theta^{\mathrm{desc}} using ∇L\nabla\mathcal{L}

  3.  return θts,θdesc\theta^{\mathrm{ts}},\theta^{\mathrm{desc}}

RAMSAD Model Selection

After aggregating segment-level retrieval results into a ranked list of similar training series, RAMSAD uses the retrieved neighborhood to select a detector for the query series. The key assumption is that time series that are similar in the chosen representation space are likely to favor the same anomaly detector. Rather than training a separate classifier or regressor to predict the best detector, RAMSAD directly reuses the precomputed detector-performance profiles of the retrieved training series.

Algorithm 3 summarizes the full model-selection procedure. The query series is first segmented, encoded, and used to retrieve nearest-neighbor segments from the knowledge base. These segment-level neighbors are then aggregated into a ranked list of candidate training series using Algorithm 2. For each detector in the candidate pool, RAMSAD averages its stored performance values over the retrieved series and selects the detector with the highest aggregated score. This produces a non-parametric detector recommendation that can adapt to changes in the knowledge base or detector pool without retraining a selector model.

Algorithm 2 Segment-to-Series Aggregation

Input: query series TqT_q; retrieved segment neighbors {Tju,r(tu,r,ℓ)}r=1k\{T_{j_{u,r}}^{(t_{u,r},\ell)}\}_{r=1}^{k} and distances {du,r}r=1k\{d_{u,r}\}_{r=1}^{k} for each query segment Tq(tu,ℓ)T_q^{(t_u,\ell)}, u=1,…,mu=1,\ldots,m; small constant ϵ>0\epsilon> 0; retrieval size kk

Output: ranked candidate series set top⁡k(Tq)\operatorname{top}_k(T_q)

  1. for all query segments Tq(tu,ℓ)T_q^{(t_u,\ell)}, u=1,…,mu=1,\ldots,m do

  2.     for all retrieved neighbors Tju,r(tu,r,ℓ)T_{j_{u,r}}^{(t_{u,r},\ell)}, r=1,…,kr=1,\ldots,k do

  3.         append du,rd_{u,r} to A(Tju,r)A(T_{j_{u,r}})

  4.     for all candidate series TjT_j such that A(Tj)≠∅A(T_j) \ne\varnothing do

  5.         compute base⁡(Tj)=1∣A(Tj)∣∑d∈A(Tj)d\operatorname{base}(T_j)=\frac{1}{|A(T_j)|}\sum_{d\in A(T_j)}d

  6.         compute freq⁡(Tj)=1m∣{u∈{1,…,m}:∃r∈{1,…,k} s.t. ju,r=j}∣\operatorname{freq}(T_j)=\frac{1}{m}\left|\left\{u\in\{1,\ldots,m\}:\exists r\in\{1,\ldots,k\}\ \text{s.t.}\ j_{u,r}=j\right\}\right|

  7.         compute score⁡(Tj)=1max⁡(ϵ,freq⁡(Tj))⋅base⁡(Tj)\operatorname{score}(T_j)=\frac{1}{\max(\epsilon,\operatorname{freq}(T_j))}\cdot\operatorname{base}(T_j)

  8.         rank candidate series Tj∈DT_j\in\mathcal{D} in ascending order of score⁡(Tj)\operatorname{score}(T_j)

  9.         return the top-kk ranked series, denoted by top⁡k(Tq)\operatorname{top}_k(T_q)

Algorithm 3 RAMSAD Model Selection

Input: query series TqT_q, retrieval index I\mathcal{I}, encoder ftsf_{\mathrm{ts}}, segment length ℓ\ell, retrieval size kk, detector pool B\mathcal{B}, performance table V\mathbf{V}

Output: selected detector D^(Tq)\widehat{D}(T_q)

  1. segment TqT_q into {Tq(tu,ℓ)}u=1m\{T_q^{(t_u,\ell)}\}_{u=1}^{m}

  2. zero-pad the last segment if needed

  3. for all segments Tq(tu,ℓ)T_q^{(t_u,\ell)} do

  4.     encode Tq(tu,ℓ)T_q^{(t_u,\ell)} with ftsf_{\mathrm{ts}}

  5.     retrieve its top-kk nearest database segments and their distances from I\mathcal{I}

  6.     aggregate the retrieved segments into a ranked series list top⁡k(Tq)\operatorname{top}_k(T_q) using Algorithm 2

  7.     for all D∈BD\in\mathcal{B} do

  8.         V‾D(Tq)=1∣top⁡k(Tq)∣∑T∈top⁡k(Tq)V(T,D)\overline{V}_D(T_q)=\frac{1}{|\operatorname{top}_k(T_q)|}\sum_{T\in\operatorname{top}_k(T_q)}V(T,D)

  9.         D^(Tq)=arg⁡max⁡D∈BV‾D(Tq)\widehat{D}(T_q)=\arg\max_{D\in\mathcal{B}}\overline{V}_D(T_q)

  10.     return D^(Tq)\widehat{D}(T_q)

System Complexity and Scalability

Asymptotic retrieval cost. We analyze the computational cost of RAMSAD by comparing exact segment retrieval with an HNSW-based implementation. Let nn denote the number of indexed knowledge-base segments, dd the embedding dimensionality, bb the number of query segments processed jointly, ksegk_{\mathrm{seg}} the number of retrieved segment neighbors per query segment, and kk the number of final retrieved series.2 For HNSW, we use deg⁡\operatorname{deg} for the maximum graph degree, ef⁡\operatorname{ef} for the search candidate list size, ef⁡c\operatorname{ef}_c for the construction candidate list size, and L≈log⁡deg⁡nL\approx\log_{\operatorname{deg}}n for the number of graph layers. The dominant cost in RAMSAD comes from segment retrieval. With exact search, the index consists of the segment embedding matrix, requiring O(nd)O(nd) memory, together with the detector-performance matrix, which requires O(∣D∣M)O(|\mathcal{D}|M) memory. Querying a batch of bb segments requires computing all pairwise similarities against the indexed segments, followed by top-ksegk_{\mathrm{seg}} selection, for a cost dominated by O(bnd)O(bnd). By contrast, HNSW adds an offline indexing stage and a small graph-memory overhead, but avoids scanning all nn indexed segments at query time by performing graph traversal over a bounded candidate set.

Cost of aggregation and recommendation. The remaining stages of RAMSAD are comparatively lightweight. After retrieval, the segment-to-series aggregation step processes at most bksegbk_{\mathrm{seg}} retrieved items, maps them to source series, and computes the score introduced in Section 3. Its complexity is therefore linear in the size of the retrieval output and negligible relative to nearest-neighbor search. The final detector recommendation step is smaller still, since it only averages precomputed detector-performance values over the top-kk retrieved series. Overall, the computational complexity of RAMSAD is governed by the retrieval backend rather than by aggregation or detector selection. The theoretical complexities are shown in Table 3.

MetricExactHNSW
TimeBuild—O(nd(efc+deg L))\mathcal{O}(nd(\mathrm{ef}_c + \mathrm{deg}\,L))
QueryO(bnd+bn+bkseglog⁡kseg)\mathcal{O}(bnd + bn + bk_{seg}\log k_{seg})O(b(efs d+efslog⁡efs))\mathcal{O}(b(\mathrm{efs}\,d + \mathrm{efs}\log\mathrm{efs}))
SpacePersistentO(nd+∣D∣ M)\mathcal{O}(nd + |\mathcal{D}|\,M)O(nd+n deg (L+1)+∣D∣ M)\mathcal{O}(nd + n\,\mathrm{deg}\,(L + 1) + |\mathcal{D}|\,M)
QueryO(bd+bn+bkseg)\mathcal{O}(bd + bn + bk_{seg})O(bd+b ef+bkseg)\mathcal{O}(bd + b\,\mathrm{ef} + bk_{seg})

Table 3. Asymptotic complexity of exact retrieval and HNSW within RAMSAD. Here, nn is the number of indexed training segments, ∣D∣|\mathcal{D}| the number of indexed training series, MM the number of candidate detectors, dd the embedding dimensionality, bb the number of query segments processed jointly, and ksegk_{seg} the segment-level retrieval size.

Similarity Spaces: Performance and Runtime Analysis

Parameter Sensitivity with Respect to kk

Figure 14 provides the main visual summary of how performance varies with kk across the different similarity spaces and TSFM backbones. Overall, the results show that RAMSAD is relatively stable with respect to the choice of kk, although the magnitude of this sensitivity differs across backbones and between ID and OOD settings. In the ID setting, performance varies only moderately across kk, with a maximum difference of roughly 0.04 across the tested configurations. This variability tends to decrease as the number of selected models increases, indicating that larger ensembles reduce the sensitivity to the retrieval size. A common pattern is that intermediate values of kk yield the strongest results, whereas very small or very large values are slightly less effective.

Figure 14. Sensitivity analysis with respect to parameter kk across eight forecasting models. Each panel reports the model-specific response under identical evaluation conditions, allowing direct visual comparison of trend, variability, and stability.

In the OOD setting, the variation across kk is somewhat larger, reaching about 0.07 in the single-model case, but this difference also shrinks as the number of selected models increases. In contrast to the ID case, larger values of kk tend to be consistently more favorable in OOD, suggesting that broader neighborhoods help stabilize model recommendation under domain shift. This behavior is particularly visible for the aligned representations, which generally exhibit clearer gains in OOD than in ID.

Among the evaluated backbones, Chronos2 [4] and Chronos2_aligned provide the strongest overall behavior, with alignment yielding the clearest gains in the OOD case. The other backbones—Flowstate [26], Mantis [20], Moirai [62], Moment [25], TimesFM [18], Tirex [7], and Toto [17]—follow the same broad pattern, but with different levels of sensitivity to kk and different benefits from alignment. We therefore conclude that RAMSAD is robust to the choice of kk, while still benefiting from moderate-to-larger neighborhoods, especially in OOD settings, and that it consistently remains stronger than the best trainable selector baseline across this parameter range.

ID and OOD Performance Tables

Tables 4 and 5 report the complete numerical results corresponding to the parameter-sensitivity analysis Figure 14. For each similarity space, we report the mean, median, and standard deviation of the evaluation scores across different values of kk. The tables are organized so that raw and aligned variants of the same backbone are grouped together and separated from other backbones by double horizontal lines. This grouping makes it possible to compare, for each backbone, the effect of semantic alignment under the same retrieval setting.

Within each raw/aligned backbone group, bold values indicate the better result for a given statistic and value of kk. For the mean and median rows, larger values are better, whereas for the standard-deviation row, smaller values are better. Underlined values indicate the best overall value in the entire table for each statistic: the highest mean, the highest median, and the lowest standard deviation.

Retrieval Runtime Across TSFM Similarity Spaces

MethodStatk=1k=2k=3k=4k=5k=6k=7k=8k=9k=10
Chronos2Mean0.71120.71170.71820.73290.73500.74630.74220.72530.72160.7147
Chronos2Median0.85650.85520.85990.88540.87800.89250.89250.88910.87680.8565
Chronos2Std0.33150.33290.32910.31980.31880.31050.31770.32950.32740.3270
Chronos2_alignedMean0.72340.72330.74310.74570.73380.73840.73740.72600.72000.7285
Chronos2_alignedMedian0.88540.89590.90240.89250.87500.88540.89470.88670.87500.8867
Chronos2_alignedStd0.33000.33240.31780.31260.31990.31730.32060.32780.32940.3269
FlowstateMean0.62630.65510.67240.69160.69110.69610.70320.69810.69830.6953
FlowstateMedian0.73680.80430.83590.83340.82700.84100.85090.84530.84720.8410
FlowstateStd0.36400.36590.36120.34110.33690.34040.34040.34170.34050.3382
Flowstate_alignedMean0.64080.67250.68880.70490.70990.71290.71180.71250.70930.7083
Flowstate_alignedMedian0.79050.81740.84420.84450.84420.84960.85090.85800.85550.8552
Flowstate_alignedStd0.36300.35360.35070.33250.33070.33270.33150.33620.33330.3321
MantisMean0.64450.67180.68170.68960.66060.68060.67790.67590.66690.6700
MantisMedian0.79820.80960.83350.82120.80170.82390.82700.82700.81690.8174
MantisStd0.36770.34810.34560.33930.35390.34330.34640.35070.35390.3485
Mantis_alignedMean0.66010.67010.67320.68090.65920.67800.68240.67490.66550.6602
Mantis_alignedMedian0.81210.81360.82120.80920.80070.81690.82120.82700.81690.8096
Mantis_alignedStd0.36320.34980.34750.33710.34730.33780.33970.34890.35280.3521
MoiraiMean0.65880.68450.69600.71160.68950.68670.67430.66970.67690.6834
MoiraiMedian0.80920.84660.85520.85280.84660.84190.84190.82270.83200.8410
MoiraiStd0.36160.35090.34810.32880.34580.33930.34990.35250.34600.3442
Moirai_alignedMean0.64860.67010.69250.69320.69450.68230.69610.68230.68270.6833
Moirai_alignedMedian0.79300.80430.84530.84190.84530.84180.85590.84380.84190.8320
Moirai_alignedStd0.36550.34690.34520.34190.34090.34410.34190.34780.34480.3457
MomentMean0.71570.71800.70840.72900.71710.71010.71030.71520.70870.7100
MomentMedian0.85900.85840.87680.87650.85890.85820.85890.86370.85840.8580
MomentStd0.34010.33450.34920.33090.32980.33290.33730.33440.34050.3381
Moment_alignedMean0.70640.73150.71600.72470.71090.70330.70420.70790.70500.6976
Moment_alignedMedian0.85430.86370.87500.85900.85900.85430.85430.85650.85550.8509
Moment_alignedStd0.34670.32760.33920.32820.33850.33780.33870.34120.34070.3437
TimesFMMean0.68090.68460.69040.69070.70840.71180.71430.69830.68550.6969
TimesFMMedian0.81420.81420.84200.82950.84660.84960.85650.84530.84530.8466
TimesFMStd0.34560.34240.34030.33800.32720.32320.32770.33540.34230.3355
TimesFM_alignedMean0.69610.70530.70750.70960.71180.71240.71460.71660.70830.7047
TimesFM_alignedMedian0.84200.83220.85550.84310.84960.84660.84960.84960.84380.8463
TimesFM_alignedStd0.34380.32930.33310.32530.32520.32230.32180.32080.32450.3287
TirexMean0.65120.65880.66810.67530.67140.66520.65860.65730.66490.6701
TirexMedian0.80950.81360.82950.82700.82120.80010.80010.80170.82490.8332
TirexStd0.36520.35640.35630.34720.34330.34390.35080.35410.34970.3494
Tirex_alignedMean0.63370.66000.64530.67820.68120.66210.65180.66160.67700.6707
Tirex_alignedMedian0.79890.80920.80160.82950.84420.82860.79890.81740.83220.8249
Tirex_alignedStd0.37260.35760.36330.34790.35310.35660.35470.35130.34670.3481
TotoMean0.67860.71390.70870.72660.71590.72330.71300.70670.69730.6908
TotoMedian0.84200.85550.87090.86370.87090.87190.87090.85840.85280.8528
TotoStd0.35500.33620.33910.32250.32990.31900.32770.33510.33830.3433
Toto_alignedMean0.67190.71160.70500.72520.72820.73010.72710.71080.69960.7039
Toto_alignedMedian0.84010.84660.85280.85990.88540.87190.88540.85990.85520.8552
Toto_alignedStd0.36390.32950.33820.32210.32530.31940.32460.33240.33800.3351
Original (Euc.-seg.)Mean0.65790.66940.65540.65650.67520.65320.64600.61230.63130.6148
Original (Euc.-seg.)Median0.80920.80960.79030.79910.82820.79050.77330.73610.75020.7003
Original (Euc.-seg.)Std0.35980.35010.35170.34670.34230.34740.34720.36590.35360.3542
Original (Euc.-full)Mean0.58530.59130.59370.57750.55000.55820.55470.55280.54540.5173
Original (Euc.-full)Median0.69360.74270.71480.65730.60550.61850.60640.60550.61610.5615
Original (Euc.-full)Std0.38080.38530.38230.37800.38310.38490.38290.39020.38550.3865
Original (DTW-MESSI)Mean0.67650.68800.68840.68610.68120.67750.67500.66430.66260.6506
Original (DTW-MESSI)Median0.83330.80920.83330.83330.83730.83510.82860.82120.82860.8096
Original (DTW-MESSI)Std0.35540.33350.33500.33680.34400.34810.34350.34800.35320.3539

Table 4. In-distribution. Bold per kk within each raw/aligned pair: higher mean and median, lower std. Underline marks the best value in the full table for each stat (max mean, max median, min std) across all methods and kk.

MethodStatk=1k=2k=3k=4k=5k=6k=7k=8k=9k=10
Chronos2Mean0.48190.48470.49000.51780.54270.55680.57210.56950.59170.5927
Chronos2Median0.44530.44770.45830.58370.64340.64350.67640.67640.72200.6852
Chronos2Std0.38440.37020.38340.38840.38090.37560.36830.37210.37040.3655
Chronos2_alignedMean0.53900.51620.57450.57680.56490.58220.57920.58990.59340.5906
Chronos2_alignedMedian0.60730.52910.67940.65780.65780.72200.68520.71240.72200.6932
Chronos2_alignedStd0.38190.37710.38170.37840.38440.38050.38030.37640.37500.3757
FlowstateMean0.49320.48760.52370.50880.53110.52600.53800.51600.52170.5383
FlowstateMedian0.52280.53070.60320.57070.60640.61850.64350.58500.60000.6360
FlowstateStd0.38720.38600.39180.38740.38520.38610.38790.38460.38650.3835
Flowstate_alignedMean0.49620.49750.50580.49610.51570.51380.53350.53600.53860.5374
Flowstate_alignedMedian0.53920.54090.54090.53000.59560.58500.62360.63660.64520.6236
Flowstate_alignedStd0.38560.39220.39320.38730.38650.39140.39300.39220.38920.3848
MantisMean0.37510.40010.42080.40580.38800.39010.39600.41310.40460.3846
MantisMedian0.20320.29480.35590.32450.28890.28890.29620.33080.30050.2671
MantisStd0.37010.37090.36520.36100.35440.35140.35370.35790.35690.3542
Mantis_alignedMean0.37790.41710.39900.39400.38860.38550.41110.39030.39850.4041
Mantis_alignedMedian0.28080.33330.29530.30530.27790.28350.33600.28920.29360.3005
Mantis_alignedStd0.36120.36830.36100.35710.35540.35130.35370.34990.35660.3561
MoiraiMean0.46760.49230.50700.51360.52570.53630.53830.52560.49380.4956
MoiraiMedian0.40910.43020.50920.54660.61580.62580.62580.59560.47650.5092
MoiraiStd0.37980.38000.38430.39000.38950.38800.38720.39350.39730.3951
Moirai_alignedMean0.49520.49750.51320.51610.51760.53770.53000.53050.50600.5198
Moirai_alignedMedian0.44770.44530.53340.55450.56970.63530.59560.61580.54120.5778
Moirai_alignedStd0.38610.37880.38230.39280.39010.38880.38840.38850.39110.3859
MomentMean0.47110.45780.44340.45040.44190.44430.45290.45370.45920.4453
MomentMedian0.43990.43580.40420.40910.36870.37570.40010.40420.42150.3761
MomentStd0.37600.36530.36350.35510.35490.34910.35390.35160.35090.3489
Moment_alignedMean0.45810.45750.46780.45230.45200.45590.45810.46110.46020.4582
Moment_alignedMedian0.40230.39460.40730.39830.40070.40230.40270.40270.40270.4027
Moment_alignedStd0.37520.37250.36170.35250.35270.35150.35110.35130.35310.3498
TimesFMMean0.47720.45410.47380.46600.47310.46520.46930.46540.48300.4916
TimesFMMedian0.37570.36870.39770.37550.39460.37770.39100.39100.43410.4219
TimesFMStd0.37370.36970.36340.37140.36020.35550.35510.35920.36140.3609
TimesFM_alignedMean0.45250.46360.48760.48980.49220.48790.48540.48830.49940.4965
TimesFM_alignedMedian0.37610.40410.44370.50920.50920.49030.50630.52560.53070.5269
TimesFM_alignedStd0.37020.35560.36760.36620.36080.36910.36310.36560.36650.3723
TirexMean0.49850.49610.47050.48740.49410.49600.48710.49210.49660.5068
TirexMedian0.48520.49040.40230.45580.45510.51980.41540.46590.48540.5258
TirexStd0.37310.36990.36780.37050.37280.37190.37400.37610.37020.3671
Tirex_alignedMean0.46980.47050.47940.47840.45120.49060.48150.47510.47900.4826
Tirex_alignedMedian0.40110.39830.41090.45680.45680.46630.41880.41090.43900.4185
Tirex_alignedStd0.37760.38130.38050.38350.38280.38140.38630.38640.38360.3835
TotoMean0.44470.44550.44590.43600.41960.44560.44950.45270.45780.4545
TotoMedian0.33760.38260.40230.34770.31030.37770.37900.38260.42070.3983
TotoStd0.38660.37680.37430.37680.37250.37020.37420.37470.37130.3778
Toto_alignedMean0.43830.45420.43310.44640.46470.43320.44980.44290.45480.4517
Toto_alignedMedian0.34400.41040.35120.37380.40410.31680.35330.34020.37380.3738
Toto_alignedStd0.37910.37590.37720.37100.37920.38210.38410.37690.38210.3848
Original (Euc.-seg.)Mean0.38620.39520.38110.39130.39600.40980.41410.41330.42320.4218
Original (Euc.-seg.)Median0.27440.29530.28400.29430.31680.33030.33330.34000.36940.3482
Original (Euc.-seg.)Std0.36370.35230.34730.34520.34740.35110.35340.35380.36020.3610
Original (Euc.-full)Mean0.37070.43920.41780.41510.39900.42560.41400.39710.40390.3941
Original (Euc.-full)Median0.20460.35100.30060.29830.28920.35610.33330.31150.32450.3035
Original (Euc.-full)Std0.36450.37890.37050.37390.36250.36930.36290.35670.36280.3594
Original (DTW-MESSI)Mean0.42290.43960.42760.43040.42200.41970.42150.42950.43650.4354
Original (DTW-MESSI)Median0.34820.35790.36060.40230.33850.31280.31920.34820.35880.3651
Original (DTW-MESSI)Std0.36960.37760.36680.36700.37020.37800.37620.37690.37820.3786

Table 5. Out-of-distribution. Bold per kk within each raw/aligned pair: higher mean and median, lower std. Underline marks the best value in the full table for each stat (max mean, max median, min std) across all methods and kk.

Retrieval Runtime Across TSFM Similarity Spaces

Tables 6 and 7 compare the wall-clock time of the RAMSAD retrieval pipeline across the similarity spaces considered in this work. The goal here is to isolate the computational cost induced by the choice of representation. All methods are therefore evaluated on a common query–database pool, and the reported times should be interpreted as single-run retrieval costs.

Table 6 reports the runtime decomposition for TSFM-based and aligned TSFM-based similarity spaces. A substantial part of the variation across backbones is explained by the dimensionality of the embeddings they produce, since both loading and nearest-neighbor search scale with the size of the representation. In particular, backbones with smaller native embedding dimensions tend to be faster: Tirex is the fastest (99.9 ms), followed by Mantis (110.8 ms), which uses the lowest-dimensional representation among the tested TSFMs, whereas TimesFM, which produces the largest embeddings, is the slowest (144.9 ms). The aligned variants introduce an additional projection step to a shared 768-dimensional space, which costs between 17 and 25 ms depending on the backbone. Despite this overhead, all aligned variants remain well below one second, showing that semantic alignment improves the representation space at only moderate additional cost. In particular, Chronos-2_aligned, which provides the strongest retrieval quality in our experiments, requires 129.1 ms and therefore remains practical.

MethodLoadProj.SearchAgg.Total
Mantis10.0–44.656.2110.8
Tirex12.3–47.440.299.9
Flowstate14.1–44.860.8119.7
Moirai14.6–56.053.0123.6
Toto14.8–61.050.7126.5
Moment17.7–53.954.1125.7
Chronos-216.4–69.052.6138.0
TimesFM25.2–64.355.4144.9
Mantis_aligned10.018.744.656.2129.5
Tirex_aligned12.318.150.357.6138.3
Flowstate_aligned14.117.051.556.4139.0
Moirai_aligned14.621.349.556.2141.6
Toto_aligned16.820.551.655.9144.8
Moment_aligned17.723.256.854.0151.7
Chronos-2_aligned14.825.348.940.1129.1
TimesFM_aligned25.623.249.855.9154.5

Table 6. Retrieval-pipeline wall-clock time (ms) across TSFM-based similarity spaces. All methods are evaluated on the same query and database pool (Ntest=1383N_{\mathrm{test}} = 1383, Ntrain=3264N_{\mathrm{train}} = 3264, Npairs=4,514,112N_{\mathrm{pairs}} = 4{,}514{,}112). Aligned variants apply the learned 768-dimensional semantic projection before retrieval.

MethodTotal time
Segment Euclidean + aggregation549.2 ms
Full-series Euclidean (truncated)1.20 s
DTW via MESSI (w=10%w = 10\%)11 h 43 m

Table 7. Retrieval-pipeline wall-clock time of original similarity spaces on the same query and database pool.

DomainSeg. Eucl.Full-series Eucl.DTW (MESSI)
Environment189.1 ms106.0 ms30 m 46 s
Facility575.0 ms1.19 s14 h 42 m
Finance189.2 ms126.3 ms37 m 18 s
Human Activity292.0 ms557.0 ms5 h 29 m
Medical616.6 ms1.24 s12 h 29 m
Sensor211.9 ms235.2 ms2 h 20 m
Synthetic218.2 ms467.1 ms2 h 12 m
Traffic184.0 ms24.7 ms1 m 56 s
Web Service425.3 ms1.05 s6 h 08 m
Total2.90 s5.00 s44 h 32 m

Table 8. OOD retrieval wall-clock time per domain for the three raw-distance similarity spaces.

Retrieval Runtime of Original Similarity Space

Table 7 places these results in the context of the original similarity spaces. Segment-level Euclidean retrieval with aggregation requires 549.2 ms, while full-series Euclidean retrieval requires 1.20 s. By contrast, DTW retrieval via MESSI [47, 19]3 using a warping window of 10% is several orders of magnitude slower, requiring 11 h 43 m on the same pool. This confirms that, although DTW can be competitive in accuracy among original-space distances, its computational cost makes it impractical as a retrieval backend for RAMSAD.

Overall, these results reinforce the main conclusion of this section: embedding-based similarity spaces, and especially aligned TSFM spaces, provide the best practical accuracy–efficiency trade-off for RAMSAD.

Experimental Setup and Benchmark Details

Dataset Details

For the evaluation of RAMSAD, we considered the TSB-AD [33] benchmark, which includes a comprehensive set of 870 curated univariate time series from 9 domains, which are summarized in Table 9. To ensure a fair comparison, we used the same train/test splits as recent model selection benchmarks [34]. The splits are the same for both ID and OOD scenarios. However, in the latter, for a given time series, automated solutions can only consider training series that do not belong to its domain. For example, for a test series belonging to the Medical category, automated solutions can only consider training series that belongs to the other 8 domains (e.g., a meta-learning approach can be trained only on this reduced training subset).

DomainTotalTrainingTest
Environment20146
Facility14310241
Finance20146
Human Activity584117
Medical14710542
Sensor443212
Synthetic1228735
Traffic642
WebService31022090
Total870619251

Table 9. Dataset Domains.

List of Candidate Detectors

Table 10 lists all the 32 anomaly detection approaches considered in our experimental evaluation. As it can be seen, the pool of available models covers all the different categories described in the literature review, and aligns with the one used in recent model selection benchmarks [34].

Automated TSAD Baselines

Automated TSAD Baselines

Table 11 lists the 25 automated solutions that we compared as baselines. More specifically, we include 2 theoretical baselines, i.e., selecting always the best detector (Oracle) and selecting the best detector basing on a labeled portion of the target series. We also include 3 simple baselines (i.e., Random selection, Global best, and Foundation model). In addition to these baselines, we included a comprehensive set of state-of-the-art automated solutions, including 8 model selection approaches, 4 internal selection methods, 5 ensembles strategies and 3 model generation approaches.

Hardware Details

All experiments were performed on a machine running Linux kernel 5.4.0-212-generic. The node is equipped with two Intel(R) Xeon(R) Gold 6242R CPUs, providing 80 logical CPU cores across 2 sockets with 2 threads per core. The system has 503 GiB of main memory and an 8 GiB swap partition. GPU-accelerated experiments used a single NVIDIA Quadro RTX 6000 with 23 GiB of onboard memory.

Additional Ablation Studies

Effect of Reducing the Training Size

In this part, we evaluate the performance of RAMSAD when reducing the size of the training set. Figure 13 shows the average VUS-PR achieved by RAMSAD with training size varying from 5% to 100% of the original set, comparing it with the performance of the best model selector (i.e., SATZilla) in ID and OOD scenarios. By considering the former scenario, we can see that RAMSAD can outperform SATZilla even with just the 80% of the training set, and that it achieves comparable scores even with sizes of 20%, 40%, and 60%. These results underscore the ability of RAMSAD of retrieving meaningful examples from the knowledge base, enabling effective model selection. This aspect is even more evident in the OOD scenario. As we can see, RAMSAD outperforms SATZilla even when using just the 10% of the original training set (i.e.,62 series).

Figure 13. Average VUS-PR achieved by RAMSAD when randomly reducing the size of the training set (left) and detector pool (right) in ID (top) and OOD (bottom) scenarios.

Effect of Reducing the Pool Size of Detectors

Figure 13 also reports the performance of RAMSAD when randomly varying the pool of available detectors in ID and OOD scenarios. Each value reported represents the average across 10 repetitions to take into account the variability due to the random sampling. In both scenarios, we can see that RAMSAD is able to match or outperform SATZilla even when considering only half of the original pool (i.e., 16 detectors); note that SATZilla is shown with its performance on the full detector pool, so this comparison is conservative for RAMSAD, highlighting that, by retrieving meaningful examples, it allows to select an effective detector even in this more challenging scenario.

Additional Discussions

Limitations

Although RAMSAD achieves strong performance for time-series anomaly detector selection, it still has several limitations.

Segmentation-induced information loss. To take advantage of TSFM representations, RAMSAD partitions each time series into fixed-length segments before retrieval. While this makes heterogeneous series compatible with the encoder, it may also discard information carried by longer-range temporal dependencies and by the global structure of the original series. As a result, similarity computed from segment-level representations may not fully reflect similarity at the full-series level. More generally, the segmentation strategy itself is fixed rather than optimized, and we do not yet study how to choose segment boundaries or segment lengths so as to minimize retrieval distortion. Adaptive segmentation and encoders with longer contexts are natural directions to reduce this loss. Relatedly, we do not resample series, and therefore make no claim of invariance to the sampling rate.

ApproachCategoryDescription
Sub-LOF [13]Distance-basedIdentifies density-based local outliers.
LOF [13]Distance-based
MatrixProfile [72]Distance-basedComputes the distance between all subsequences.
KShapeAD [44]Distance-basedIdentifies the normal pattern based on the k-Shape clustering algorithm and computes distance-based anomaly scores.
SAND [10]Distance-basedIncrementally updates a summary of normal patterns using subsequences from batches and evaluates anomaly scores based on distance.
Series2Graph [9]Density-basedTransforms subsequences into nodes and their transition patterns into edges. Anomalies are identified based on irregular transition patterns.
SR [51]Distance-basedComputes anomaly scores as the relative difference between saliency map values and their moving averages.
Sub-KNN [48]Distance-basedLeverages the distance to the k-th nearest neighbor.
KMeansAD [70]Distance-basedMeasures the distance to the centroid of assigned cluster.
Sub-IForest [32]Density-basedIsolates anomalies using random partitioning of the data space.
IForest [32]Density-based
Sub-PCA [1]Density-basedProjects data to a lower-dimensional hyperplane, with significant deviation from this plane indicating anomalies.
Sub-HBOS [23]Density-basedConstructs a histogram for the data and uses the inverse of the height of the bin as the anomaly score of the data point.
Sub-OCSVM [56]Density-basedFits the dataset to find the normal data’s boundary by maximizing the margin between the origin and the normal samples.
Sub-MCD [52]Density-basedLeverages minimum covariance determinant
POLY [29]Density-basedUses local polynomial approximation.
AutoEncoder [53]Prediction-basedLeverages reconstruction errors through encoding-decoding.
CNN [40]Prediction-basedLeverages prediction errors through CNN.
LSTMAD [39]Prediction-basedLeverages prediction errors through LSTM.
TranAD [60]Prediction-basedLeverages self-conditioning and adversarial training.
AnomalyTransformer [67]Prediction-basedLeverages Anomaly-Attention mechanism to compute association discrepancies.
OmniAnomaly [57]Prediction-basedLeverages a Stochastic recurrent neural network.
USAD [6]Prediction-basedLeverages adversely trained autoencoders.
Donut [66]Prediction-basedBased on Variational Auto-Encoders (VAE).
TimesNet [63]Prediction-basedBased on temporal 2D-variation modeling.
FITS [69]Prediction-basedInterpolates time series in the frequency domain.
TimesFM [18]Prediction-basedPre-trains a decoder-only attention model with input patching.
MOMENT (ZS) [25]Prediction-basedUses a Zero Shot, pre-trained transformer model.
MOMENT (FT) [25]Prediction-basedUses a Fine-Tuned, pre-trained transformer model.
OFA [74]Foundation modelBased on fine-tuned GPT-2 model.
Lag-Llama [49]Foundation modelLeverages a decoder-only transformer architecture.
Chronos [3]Foundation modelTokenizes time series values using scaling and quantization.

Table 10. List of anomaly detection approaches included in our experimental evaluation.

Remaining gap to the oracle. RAMSAD provides a strong non-parametric baseline, but it does not fully close the gap to the theoretical oracle in either the ID or the OOD setting. As shown in Figure 1, there is still room for improvement in how retrieved neighbors are identified and how detector recommendations are transferred from them. Reducing this gap remains an important direction for future work.

ApproachCategoryDescription
OracleTheoretical baselineSelects the single best anomaly detector for each series
Supervised Selection (SS)Theoretical baselineOracle-style upper bound: selects the best detector using labels of a portion of the target series, unavailable to the other methods
Global Best (GB)BaselineGlobal best: selects the detector with the best overall accuracy on the entire benchmark.
RandomBaselineRandomly selects one of the detectors for each series.
Foundation model (FM) [18]BaselineFoundation model pre-trained on large scale datasets.
SATZilla [68]Model SelectionBuilds per-instance algorithm portfolios using empirical hardness models to predict performance and select the best SAT solver for each instance.
ARGOSMART [43]Model SelectionUses 1NN on dataset meta-features to select the model that performed best on the most similar training dataset.
ISAC [27]Model SelectionClusters datasets via meta-features and selects the best-performing model from the nearest cluster to the new dataset.
MetaOD [73]Model SelectionLeverages collaborative filtering and matrix factorization on dataset meta-features to predict and rank candidate models for a new dataset.
MSAD [58]Model SelectionUses classification to map datasets to the best-performing anomaly detection model among a set of candidates.
UReg [41]Model SelectionLearns a regression from dataset meta-features to latent SVD factors to predict model performance for novel datasets.
CFact [41]Model SelectionClusters configurations in latent space and trains cluster-specific regressors to predict performance and select the best model for known datasets.
Model Centrality (MC) [30]Model SelectionComputes model centrality via Kendall’s distances between anomaly score rankings to select models closest to their nearest neighbors.
Clustering Quality (CQ) [42]InternalApplies cluster validation metrics on thresholded anomaly scores to select models with better separation between normal/anomalous traces.
Unsupervised evaluation curves (UEC) [22]InternalEvaluates anomaly detectors using unsupervised mass-volume and excess-mass curves instead of labeled ROC/PR-based metrics.
Synthetic [15]InternalInjects artificial anomalies into simulated time series and selects the model with the best detection performance.
TSAdams [24]InternalAggregates surrogate metric rankings of anomaly detectors using Kemeny/Borda methods to produce a more robust final model ranking.
AutoTSAD [55]EnsembleGenerates synthetic anomalous time series to optimize detector configurations and ensemble their ranked anomaly scores into a final prediction.
Outlier Ensemble (OE) [2]EnsembleUses an ensemble of all available detectors.
SELECT [50]EnsembleApplies unsupervised ensemble selection to choose a subset of detectors using vertical and horizontal consensus strategies for final aggregation.
Iterative Outlier Ensemble (IOE) [38]EnsembleIteratively builds a pseudo-ground truth by selecting and refining anomaly score consensus to produce a final aggregated ensemble score.
HITS [38]EnsembleRecursively computes hub and centralities over anomaly score relations to rank and select more reliable models.
AutoOD-A [14]Model GenerationIteratively refines pseudo-labels via voting and learns to prune weak detectors using logistic regression and multi-view updates.
AutoOD-C [14]Model GenerationIteratively cleans noisy pseudo-labels by tracking early training losses to remove likely mislabeled instances and refine anomaly detection.
UADB [71]Model GenerationApplies knowledge distillation to transfer multiple anomaly detectors’ knowledge into a booster model that adapts and improves detection across datasets.

Table 11. List of automated solutions compared with RAMSAD.

Restriction to univariate time series. Our current study focuses only on univariate time series. Although the overall retrieval-based framework could be extended to multivariate settings, such an extension is not explored here. Adapting RAMSAD to multivariate anomaly detection, including the design of suitable segment representations and similarity spaces, is therefore left for future work.

Temporal concept drift and streaming. Our experiments concern domain shift between static series: the query comes from a domain that is absent from the knowledge base. We do not evaluate temporal concept drift within a domain or a stream, nor non-stationarity within a single long series, such as an anomalous pattern that becomes normal over time. Nothing in the method precludes these cases, since RAMSAD retrieves per segment and aggregates segment matches into a series ranking, so later segments of an evolving series are embedded and retrieved afresh and the recommendation can change as they accumulate. We present this as a direction for future work, together with a streaming evaluation protocol, and not as a claim supported by our experiments.

Labeled knowledge base and queries far from every covered domain. RAMSAD requires a labeled knowledge base on which every candidate detector has been evaluated, the same supervision used by trained meta-learning selectors, and it does not apply where no labels exist at all. Our leave-one-domain-out protocol evaluates entirely unseen domains: no series, performance profile or description from the target domain enters the knowledge base or the alignment training. Missing descriptions are not a failure mode either, since a query never supplies one. What our experiments do not isolate is a query that is far from every indexed domain in representation space. Since what matters for selection is proximity in that space rather than shared domain membership, such a query may retrieve weakly related neighbors, and characterizing when the knowledge-base coverage is insufficient, and how to build a knowledge base that avoids it, is left for future work.

Broader Impacts

Improved model selection for time-series anomaly detection can support more reliable monitoring systems in domains such as healthcare, manufacturing, finance, energy, cybersecurity, and scientific monitoring. By reducing the need to run large detector pools, RAMSAD may also improve the efficiency and accessibility of anomaly-detection pipelines. At the same time, anomaly-detection systems can produce false alarms or missed detections, which may have negative consequences in high-stakes deployments if used without appropriate human oversight. The method could also be applied in monitoring or surveillance contexts, where privacy and governance considerations depend on the deployment setting. We therefore view RAMSAD as a decision-support component rather than a replacement for domain-specific validation and responsible deployment practices.

References

  1. [1]C. C. Aggarwal. An introduction to outlier analysis. In Outlier Analysis, pages 1–34. Springer International Publishing, Cham, 2017. doi: 10.1007/978-3-319-47578-3_1.DOI
  2. [2]C. C. Aggarwal and S. Sathe. Theoretical foundations and algorithms for outlier ensembles. Acm sigkdd explorations newsletter, 17(1):24–47, 2015.DOI
  3. [3]A. F. Ansari, L. Stella, C. Turkmen, X. Zhang, P. Mercado, H. Shen, O. Schür, S. S. Rangapuram, S. P. Arango, S. Kapoor, et al. Chronos: Learning the language of time series. arXiv preprint arXiv:2403.07815, 2024.arxiv.org/abs/2403.07815
  4. [4]A. F. Ansari, O. Schür, J. Küken, A. Auer, B. Han, P. Mercado, S. S. Rangapuram, H. Shen, L. Stella, X. Zhang, M. Goswami, S. Kapoor, D. C. Maddix, P. Guerron, T. Hu, J. Yin, N. Erickson, P. M. Desai, H. Wang, H. Rangwala, G. Karypis, Y. Wang, and M. Bohlke-Schneider. Chronos-2: From univariate to universal forecasting, 2025. URL https://arxiv.org/abs/2510.15821.
  5. [5]J. Antoni and P. Borghesani. A statistical methodology for the design of condition indicators. Mechanical Systems and Signal Processing, 114:290–327, 2019. doi: 10.1016/j.ymssp.2018.05.012.DOI
  6. [6]J. Audibert, P. Michiardi, F. Guyard, S. Marti, and M. A. Zuluaga. Usad: Unsupervised anomaly detection on multivariate time series. In Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining, pages 3395–3404, 2020.
  7. [7]A. Auer, P. Podest, D. Klotz, S. Böck, G. Klambauer, and S. Hochreiter. Tirex: Zero-shot forecasting across long and short horizons with enhanced in-context learning. arXiv preprint arXiv:2505.23719, 2025.arxiv.org/abs/2505.23719
  8. [8]A. Blázquez-García, A. Conde, U. Mori, and J. A. Lozano. A review on outlier/anomaly detection in time series data. ACM Computing Surveys, 54(3):56:1–56:33, 2022. doi: 10.1145/3444690.
  9. [9]P. Boniol and T. Palpanas. Series2graph: Graph-based subsequence anomaly detection for time series. Proc. VLDB Endow., 13(12):1921–1934, 2020.
  10. [10]P. Boniol, J. Paparrizos, T. Palpanas, and M. J. Franklin. Sand: Streaming subsequence anomaly detection. Proc. VLDB Endow., 14(10):1717–1729, 2021.
  11. [11]P. Boniol, Q. Liu, M. Huang, T. Palpanas, and J. Paparrizos. Dive into time-series anomaly detection: A decade review, 2024. URL https://arxiv.org/abs/2412.20512.
  12. [12]P. Boniol, A. K. Krishna, M. Bruel, Q. Liu, M. Huang, T. Palpanas, R. S. Tsay, A. Elmore, M. J. Franklin, and J. Paparrizos. Vus: effective and efficient accuracy measures for time-series anomaly detection. The VLDB Journal, 34(3):32, 2025.
  13. [13]M. M. Breunig, H.-P. Kriegel, R. T. Ng, and J. Sander. Lof: identifying density-based local outliers. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pages 93–104, 2000.
  14. [14]L. Cao, Y. Yan, Y. Wang, S. Madden, and E. A. Rundensteiner. Autood: Automatic outlier detection. Proceedings of the ACM on Management of Data, 1(1):1–27, 2023.DOI
  15. [15]S. Chatterjee, R. Bopardikar, M. Guerard, U. Thakore, and X. Jiang. Mospat: Automl based model selection and parameter tuning for time series anomaly detection. arXiv preprint arXiv:2205.11755, 2022.arxiv.org/abs/2205.11755
  16. [16]M. Christ, N. Braun, J. Neuffer, and A. W. Kempa-Liehr. Time series feature extraction on basis of scalable hypothesis tests (tsfresh–a python package). Neurocomputing, 307:72–77, 2018.DOI
  17. [17]B. Cohen, E. Khwaja, Y. Doubli, S. Lemaachi, C. Lettieri, C. Masson, H. Miccinilli, E. Ramé, Q. Ren, A. Rostamizadeh, et al. This time is different: An observability perspective on time series foundation models. arXiv preprint arXiv:2505.14766, 2025.arxiv.org/abs/2505.14766
  18. [18]A. Das, W. Kong, R. Sen, and Y. Zhou. A decoder-only foundation model for time-series forecasting. arXiv preprint arXiv:2310.10688, 2023.arxiv.org/abs/2310.10688
  19. [19]F. Del Gaudio, M. Chatzakis, G. Ravendirane, B. Peng, and T. Palpanas. Daisy: A library for scalable data series similarity search. arXiv preprint arXiv:2603.27719, 2026.arxiv.org/abs/2603.27719
  20. [20]V. Feofanov, S. Wen, M. Alonso, R. Ibert, H. Guo, M. Tiomoko, L. Pan, J. Zhang, and I. Redko. Mantis: Lightweight calibrated foundation model for user-friendly time series classification. arXiv preprint arXiv:2502.15637, 2025.arxiv.org/abs/2502.15637
  21. [21]Y. Gao, J. Lin, and C. Brif. Ensemble grammar induction for detecting anomalies in time series. In Proceedings of the 23rd International Conference on Extending Database Technology, EDBT 2020, Copenhagen, Denmark, March 30 - April 02,2020, pages 85–96, 2020. doi: 10.5441/002/EDBT.2020.09.DOI
  22. [22]N. Goix. How to evaluate the quality of unsupervised anomaly detection algorithms? arXiv preprint arXiv:1607.01152, 2016.arxiv.org/abs/1607.01152
  23. [23]M. Goldstein and A. Dengel. Histogram-based outlier score (hbos): A fast unsupervised anomaly detection algorithm. KI-2012: poster and demo track, 1:59–63, 2012.
  24. [24]M. Goswami, C. Challu, L. Callot, L. Minorics, and A. Kan. Unsupervised model selection for time-series anomaly detection. arXiv preprint arXiv:2210.01078, 2022.arxiv.org/abs/2210.01078
  25. [25]M. Goswami, K. Szafer, A. Choudhry, Y. Cai, S. Li, and A. Dubrawski. Moment: A family of open time-series foundation models. arXiv preprint arXiv:2402.03885, 2024.arxiv.org/abs/2402.03885
  26. [26]L. Graf, T. Ortner, S. Woźniak, A. Pantazi, et al. Flowstate: Sampling rate invariant time series forecasting. arXiv preprint arXiv:2508.05287, 2025.arxiv.org/abs/2508.05287
  27. [27]S. Kadioglu, Y. Malitsky, M. Sellmann, K. Tierney, et al. Isac-instance-specific algorithm configuration. In ECAI, volume 215, pages 751–756, 2010.
  28. [28]E. Keogh, S. Lonardi, C. A. Ratanamahatana, L. Wei, S.-H. Lee, and J. Handley. Compression-based data mining of sequential data. Data Mining and Knowledge Discovery, 14(1):99–129, 2007.DOI
  29. [29]Z. Li, H. Ma, and Y. Mei. A unifying method for outlier and change detection from data streams based on local polynomial fitting. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pages 150–161. Springer, 2007.DOI
  30. [30]Z. Lin, K. Thekumparampil, G. Fanti, and S. Oh. Infogan-cr and modelcentrality: Self-supervised model training and selection for disentangling gans. In international conference on machine learning, pages 6127–6139. PMLR, 2020.arxiv.org/abs/1906.06034
  31. [31]M. Linardi, Y. Zhu, T. Palpanas, and E. Keogh. Matrix profile goes mad: variable-length motif and discord discovery in data series. arXiv preprint arXiv:2008.13447, 2020.arxiv.org/abs/2008.13447
  32. [32]F. T. Liu, K. M. Ting, and Z.-H. Zhou. Isolation forest. In 2008 eighth ieee international conference on data mining, pages 413–422. IEEE, 2008.
  33. [33]Q. Liu and J. Paparrizos. The elephant in the room: Towards a reliable time-series anomaly detection benchmark. Advances in Neural Information Processing Systems, 37:108231–108261, 2024.DOI
  34. [34]Q. Liu, S. Lee, and J. Paparrizos. Tsb-autoad: Towards automated solutions for time-series anomaly detection. Proceedings of the VLDB Endowment, 18(11):4364–4379, 2025.DOI
  35. [35]Y. Liu, X. Chen, F. Wang, and J. Yin. Efficient detection of discords for time series stream. In Asia-Pacific Web Conference, pages 629–634. Springer, 2009.DOI
  36. [36]C. H. Lubba, S. S. Sethi, P. Knaute, S. R. Schultz, B. D. Fulcher, and N. S. Jones. catch22: Canonical time-series characteristics. arXiv preprint arXiv:1901.10200, 2019.arxiv.org/abs/1901.10200
  37. [37]H. Ma, B. Ghojogh, M. N. Samad, D. Zheng, and M. Crowley. Isolation mondrian forest for batch and online anomaly detection. In 2020 IEEE International Conference on Systems, Man, and Cybernetics (SMC), pages 3051–3058. IEEE, 2020.DOI
  38. [38]M. Q. Ma, Y. Zhao, X. Zhang, and L. Akoglu. The need for unsupervised outlier model selection: A review and evaluation of internal evaluation strategies. ACM SIGKDD Explorations Newsletter, 25(1):19–35, 2023.
  39. [39]P. Malhotra, L. Vig, G. M. Shroff, and P. Agarwal. Long short term memory networks for anomaly detection in time series. In The European Symposium on Artificial Neural Networks, 2015. URL https://api.semanticscholar.org/CorpusID:43680425.
  40. [40]M. Munir, S. A. Siddiqui, A. Dengel, and S. Ahmed. Deepant: A deep learning approach for unsupervised anomaly detection in time series. IEEE access, 7:1991–2005, 2018.
  41. [41]J. M. Navarro, A. Huet, and D. Rossi. Meta-learning for fast model recommendation in unsupervised multivariate time series anomaly detection. In International Conference on Automated Machine Learning, pages 24–1. PMLR, 2023.
  42. [42]T. T. Nguyen, U. Q. Nguyen, et al. An evaluation method for unsupervised anomaly detection algorithms. Journal of Computer Science and Cybernetics, 32(3):259–272, 2016.
  43. [43]M. Nikolić, F. Marić, and P. Janičić. Simple algorithm portfolio for sat. Artificial Intelligence Review, 40(4):457–465, 2013.
  44. [44]J. Paparrizos and L. Gravano. k-shape: Efficient and accurate clustering of time series. In Proceedings of the 2015 ACM SIGMOD international conference on management of data, pages 1855–1870, 2015.
  45. [45]J. Paparrizos, P. Boniol, T. Palpanas, R. S. Tsay, A. J. Elmore, and M. J. Franklin. Volume under the surface: A new accuracy evaluation measure for time-series anomaly detection. Proc. VLDB Endow., 15(11):2774–2787, 2022.
  46. [46]J. Paparrizos, Y. Kang, P. Boniol, R. S. Tsay, T. Palpanas, and M. J. Franklin. Tsb-uad: An end-to-end benchmark suite for univariate time-series anomaly detection. Proc. VLDB Endow., 15(8):1697–1711, 2022.
  47. [47]B. Peng, P. Fatourou, and T. Palpanas. Fast data series indexing for in-memory data. The VLDB Journal, 30(6):1041–1067, 2021.
  48. [48]S. Ramaswamy, R. Rastogi, and K. Shim. Efficient algorithms for mining outliers from large data sets. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pages 427–438, 2000.
  49. [49]K. Rasul, A. Ashok, A. R. Williams, H. Ghon ia, R. Bhagwatkar, A. Khorasani, M. J. D. Bayazi, G. Adamopoulos, R. Riachi, N. Hessen, et al. Lag-llama: Towards foundation models for probabilistic time series forecasting. arXiv preprint arXiv:2310.08278, 2023.
  50. [50]S. Ravana and L. Akoglu. Less is more: Building selective anomaly ensembles. Acm transactions on knowledge discovery from data (tkdd), 10(4):1–33, 2016.
  51. [51]H. Ren, B. Xu, Y. Wang, C. Yi, C. Huang, X. Kou, T. Xing, M. Yang, J. Tong, and Q. Zhang. Time-series anomaly detection service at microsoft. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pages 3009–3017, 2019.DOI
  52. [52]P. J. Rousseeuw and K. V. Driessen. A fast algorithm for the minimum covariance determinant estimator. Technometrics, 41(3):212–223, 1999.
  53. [53]M. Sakurada and T. Yairi. Anomaly detection using autoencoders with nonlinear dimensionality reduction. In Proceedings of the MLSDA 2014 2nd workshop on machine learning for sensory data analysis, pages 4–11, 2014.DOI
  54. [54]S. Schmidl, P. Wenig, and T. Papenbrock. Anomaly detection in time series: A comprehensive evaluation. Proceedings of the VLDB Endowment, 15(9):1779–1797, 2022. doi: 10.14778/3538598.3538602.DOI
  55. [55]S. Schmidl, F. Naumann, and T. Papenbrock. Autotsad: unsupervised holistic anomaly detection for time series data. Proceedings of the VLDB Endowment, 17(11):2987–3002, 2024.DOI
  56. [56]B. Schölkopf, R. C. Williamson, A. Smola, J. Shawe-Taylor, and J. Platt. Support vector method for novelty detection. Advances in neural information processing systems, 12, 1999.
  57. [57]Y. Su, Y. Zhao, C. Niu, R. Liu, W. Sun, and D. Pei. Robust anomaly detection for multivariate time series through stochastic recurrent neural network. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pages 2828–2837, 2019.DOI
  58. [58]E. Sylligardos, P. Boniol, J. Paparrizos, P. Trahanias, and T. Palpanas. Choose wisely: An extensive evaluation of model selection for anomaly detection in time series. Proceedings of the VLDB Endowment, 16(11):3418–3432, 2023.DOI
  59. [59]E. Sylligardos, J. Paparrizos, T. Palpanas, P. Senellart, and P. Boniol. MSAD: A deep dive into model selection for time series anomaly detection. The VLDB Journal, 34(6):72, 2025. ISSN 0949-877X. doi: 10.1007/s00778-025-00949-1. URL https://doi.org/10.1007/s00778-025-00949-1.
  60. [60]S. Tuli, G. Casale, and N. R. Jennings. Tranad: Deep transformer networks for anomaly detection in multivariate time series data. arXiv preprint arXiv:2201.07284, 2022.arxiv.org/abs/2201.07284
  61. [61]P. Wenig and T. Papenbrock. Series2graph++: Distributed detection of correlation anomalies in multivariate time series. In International Conference on Big Data Analytics and Knowledge Discovery, pages 225–230. Springer, 2024.DOI
  62. [62]G. Woo, C. Liu, A. Kumar, C. Xiong, S. Savarese, and D. Sahoo. Unified training of universal time series forecasting transformers. In Forty-first International Conference on Machine Learning, 2024.arxiv.org/abs/2402.02592
  63. [63]H. Wu, T. Hu, Y. Liu, H. Zhou, J. Wang, and M. Long. Timesnet: Temporal 2d-variation modeling for general time series analysis. arXiv preprint arXiv:2210.02186, 2022.arxiv.org/abs/2210.02186
  64. [64]W. Wu, L. He, W. Lin, Y. Su, Y. Cui, C. Maple, and S. Jarvis. Developing an unsupervised real-time anomaly detection scheme for time series with multi-seasonality. IEEE Transactions on Knowledge and Data Engineering, 34(9):4147–4160, Sept. 2022. ISSN 2326-3865. doi: 10.1109/tkde.2020.3035685. URL http://dx.doi.org/10.1109/TKDE.2020.3035685.
  65. [65]Z. Xie, Z. Li, X. He, L. Xu, X. Wen, T. Zhang, J. Chen, R. Shi, and D. Pei. Chatts: Aligning time series with llms via synthetic data for enhanced understanding and reasoning. arXiv preprint arXiv:2412.03104, 2024.DOI
  66. [66]H. Xu, W. Chen, N. Zhao, Z. Li, J. Bu, Z. Li, Y. Liu, Y. Zhao, D. Pei, Y. Feng, et al. Unsupervised anomaly detection via variational auto-encoder for seasonal kpis in web applications. In Proceedings of the 2018 world wide web conference, pages 187–196, 2018.DOI
  67. [67]J. Xu, H. Wu, J. Wang, and M. Long. Anomaly transformer: Time series anomaly detection with association discrepancy. arXiv preprint arXiv:2110.02642, 2021.arxiv.org/abs/2110.02642
  68. [68]L. Xu, F. Hutter, H. H. Hoos, and K. Leyton-Brown. Satzilla: portfolio-based algorithm selection for sat. Journal of artificial intelligence research, 32:565–606, 2008.DOI
  69. [69]Z. Xu, A. Zeng, and Q. Xu. Fits: Modeling time series with 10k parameters. arXiv preprint arXiv:2307.03756, 2023.arxiv.org/abs/2307.03756
  70. [70]T. Yairi, Y. Kato, and K. Hori. Fault detection by mining association rules from house-keeping data. In proceedings of the 6th International Symposium on Artificial Intelligence, Robotics and Automation in Space, volume 18, page 21. Citeseer, 2001.
  71. [71]H. Ye, Z. Liu, X. Shen, W. Cao, S. Zheng, X. Gui, H. Zhang, Y. Chang, and J. Bian. Uadb: Unsupervised anomaly detection booster. In 2023 IEEE 39th International Conference on Data Engineering (ICDE), pages 2593–2606. IEEE, 2023.arxiv.org/abs/2306.01997
  72. [72]C.-C. M. Yeh, Y. Zhu, L. Ulanova, N. Begum, Y. Ding, H. A. Dau, D. F. Silva, A. Mueen, and E. Keogh. Matrix profile i: all pairs similarity joins for time series: a unifying view that includes motifs, discords and shapelets. In 2016 IEEE 16th international conference on data mining (ICDM), pages 1317–1322. Ieee, 2016.DOI
  73. [73]Y. Zhao, R. A. Rossi, and L. Akoglu. Automatic unsupervised outlier model selection. In Advances in Neural Information Processing Systems 34 (NeurIPS 2021), pages 4489–4502, 2021.
  74. [74]T. Zhou, P. Niu, L. Sun, R. Jin, et al. One fits all: Power general time series analysis by pretrained lm. Advances in neural information processing systems, 36:43322–43355, 2023.arxiv.org/abs/2302.11939

Paper details

vlnc:W_ncv5yp6k
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 11

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents