Manuscript Offprint
arXiv:2610.01223Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Time-series anomaly detection trades off predictive accuracy, computational efficiency, and interpretability. We use a large language model not as the detector but as the author of one: an autonomous research loop in which the model repeatedly edits a single short NumPy program under a leakage-free objective, keeping the best-scoring detector it finds. The loop discovers two compact detectors, one for univariate and one for multivariate series, that describe short windows by their local spectral features and compare them with the training-region distribution through a covariance-aware distance. On the TSB-AD benchmark these detectors lead the field across metrics, ahead of the strongest classical, deep, and foundation-model baselines including Time-RCD, yet they train no network and use no GPU, and the multivariate detector is faster than every similarly performing baseline. LLM-driven program search is thus a practical route to accurate, efficient, and transparent detectors.
KEYWORDS
time series anomaly detection, automated algorithm discovery, LLM-driven program search, interpretable models
Classical detectors are cheap and simple but often require dataset-specific preprocessing and threshold tuning to perform well. Deep and foundation models reduce the manual tuning burden but pay for it with training cost, GPU dependence, and opacity.
We take a different angle: rather than designing a detector by hand or training a large model, we use an LLM-driven autonomous research loop as a tool to write the detector for us. A language model repeatedly edits a single short Python and NumPy program. It is given the benchmark harness, a strict leakage-free protocol, and an instruction to find an accurate, elegant, single-principle detector. Each edited program is run through the harness and scored on a held-out validation split; this score, together with the whole trajectory of past attempts (including edits that lowered it), informs the next edit.
Using a language model as an engine for proposing and refining programs, rather than as the final model, underlies a growing line of work in mathematical and algorithmic discovery [3, 15, 23, 31]. Our question is a practical one: is this tool effective for time-series anomaly detection, and what kind of detector does it produce? As ablations we also hold the harness, the seed program (a simple z-score detector), and the single-principle prompt fixed and vary the search by driving the loop with other models (GPT 5.6 Terra and the smaller open MiniMax-2.5) and comparing against an off-the-shelf evolutionary program-search framework, SHINKAEVOLVE [15], which is an open-source alternative to AlphaEvolve [23].
The search does not require existing labels: candidates are scored against synthetic anomalies injected into a slice of the training data, never against real labels, so the approach is also applicable to real-world problems where no ground truth exists. At inference the discovered detector is fit per series without labels, under the same operating assumptions as a classical unsupervised detector such as KMeans. We steer the search toward short, efficient programs, and run it separately for univariate and multivariate series.
Our contributions are as follows.
• An LLM that writes the detector. We show that an LLM-driven autonomous research loop is an effective tool for discovering anomaly detectors. The search is straightforward to set up, demands little anomaly-detection expertise from the practitioner, and produces a detector that is compact, interpretable, and competitive with the state of the art. Each detector emerged from a single one hour session of roughly 100 edit-and-evaluate iterations.
• Interpretable, single-CPU programs. Each detector is a short NumPy program with no GPU, no neural training, and no learned weights, so its inductive biases can be read directly from the source and audited.
• Field-leading accuracy. On the established TSB-AD benchmark the two detectors take the most first-place finishes on every reported metric across both regimes, ahead of classical baselines as well as deep and pretrained detectors including the Time-RCD foundation model [14] (Table 2), and also perform competitively on the recent TAB benchmark (Appendix E).
-
Synthetic label generation
-
Initial dummy program
-
Agentic refinement loop

- Discovered program
multi-scale local windows
spectral-organization signature
full-covariance Gaussian novelty
input time series
At each scale, a window is scored by how unlikely its spectral organization is under normal training windows; the scores are fused.
Figure 1: Autonomous discovery of an unsupervised anomaly detector. Synthetic anomalies are injected and labeled only in a held-out slice of the training region, and these labels are used only for validation; no real labels or official-test-suffix data enter the search. Starting from a simple seed detector, the agent repeatedly proposes program edits and evaluates it with the fixed harness. The best iteration yields a multi-scale spectral-organization detector: each window is compared with a full-covariance Gaussian fit to normal training windows, and its per-scale novelty scores are fused.
2 RELATED WORK
Benchmarks and evaluation for time series anomaly detection. Our primary benchmark is TSB-AD [17], which we evaluate under the 16-family protocol published with Time-RCD [14]. On TSB-AD we compare against detectors spanning pretrained, deep, and classical families: the recent Time-RCD foundation model [14]; the deep reconstruction and forecasting detectors TranAD [38], USAD [2], OmniAnomaly [35], and DCdetector [46], together with the temporal-frequency masked autoencoder TFMAE [7]; and the classical baselines LOF [5], Isolation Forest [16], and subsequence PCA [34]. For a broader picture we additionally report results on the more recent TAB benchmark [26] in Appendix E.
Autonomous research agents and LLM-driven discovery. A growing body of work uses large language models not as the final model but as an engine for proposing and refining code. FunSearch showed that searching over LLM-proposed programs can yield new results in mathematics [31]; AlphaEvolve broadened this into a general coding agent for scientific and algorithmic discovery [23]; and open frameworks such as ShinkaEvolve study how to make such program search sample-efficient [15]. Most directly, Karpathy [12] articulates the idea of an autonomous-research loop in a CLI in which an LLM agent repeatedly proposes an edit to a single artifact, evaluates it against a fixed metric, and iterates without human intervention. Closest in application, EVIL evolves compact, interpretable algorithms for zero-shot inference on event sequences and time series [3]. This program-authoring role is distinct from using a language model as the time-series model: One-Fits-All repurposes a frozen pretrained language-model backbone for downstream tasks including anomaly detection [49], and time-series foundation models score data directly from learned weights [14]. In our setting the language model never sees the data at inference; it only writes the detector program, and the object that scores each series is a few lines of NumPy.
Synthetic data for foundation models. Synthetic simulation is increasingly used to pretrain foundation models for time series and event sequences, where it supplies a broad prior over mechanisms that can be adapted or applied zero-shot to real data. Related time-series foundation-model work uses synthetic anomalies and relative contexts (Time-RCD), causally coherent kernel-generated series (CauKer), or synthetic series paired with symbolic expressions (SymTime) [14, 39, 43].
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
3 DISCOVERING DETECTORS WITH AN AUTONOMOUS RESEARCH LOOP
Detector representation. Each candidate detector is a self-contained Python and NumPy function with a fixed signature: it consumes a training segment and a test segment of a series and returns a per-timestep anomaly score. Restricting candidates to short array programs has two benefits. The programs are cheap to run, so a single evaluation across the validation set takes minutes rather than hours, which is what makes an iterative loop practical; and they remain interpretable, so the design choices that perform well can be read directly from the code.
The loop. We use an autonomous research loop similar to [12]: an LLM-driven agent that edits and re-evaluates a single program with no human intervention. A fixed harness defines the data interface, the validation objective, and the scoring code. The language model is allowed to edit only the detector program. In each iteration it (i) inspects the current detector program and its recent scores, (ii) proposes a concrete modification, ranging from a hyperparameter change to a new scoring component or a structural rewrite, (iii) runs the modified program through the harness on the validation split, and (iv) reads the resulting validation score. Unlike a hill-climbing search, the loop applies no automatic accept/reject step: the full trajectory of attempts, including edits that lower the score, stays in the agent's context and serves as inspiration for later proposals, and the single program returned by the search is the best-scoring one over the whole session (formalized below). We steer the loop toward short, single-principle programs rather than accuracy alone, which keeps the discovered detectors readable instead of letting them grow into opaque ensembles. We run each search independently for the univariate and multivariate settings and with several driving models (Section 5). The strongest loop, driven by Opus 4.8, discovers related spectral-Gaussian novelty patterns in the two regimes, whereas the other loops and the evolutionary baseline arrive at different programs (Section 6.4).
Synthetic validation and leakage control. The search uses no real anomaly labels. Candidates are scored by detecting synthetic anomalies injected only into a held-out slice of each series' training region. The generator is an explicit prior over what an anomaly can look like. We aim for anomalies that are realistic in the mechanism that produces them, like a sensor that freezes, a valid shape appearing out of context, a cycle at the wrong period or phase. Its types are taken from the established GutenTAG taxonomy [40], and its mix spans both the magnitude and the in-range shape/contextual families, so that a candidate cannot score well by handling only one of them. The univariate mix emphasizes the in-range families, which cannot be caught from magnitude alone, while the multivariate mix also includes joint cross-channel perturbations. Appendix B gives the complete generator and leakage-control protocol.
4 METHODS DISCOVERED BY THE SEARCHES
Table 1 summarizes the programs selected by all four searches. The strongest search, the Opus 4.8 loop, found two spectral-Gaussian novelty methods and performed best overall; we therefore describe those two methods below. The other loops produced simpler local-feature methods, while the Shinka evolutions produced ensembles of standard signals. The evaluations can be found in Section 6; constants and complete executable implementations of the Opus methods are in Appendices C and D. The complete, runnable source code of every discovered detector (all four searches, in both the univariate and multivariate regimes) is available in an anonymized repository.
The Opus methods. The Opus loop was run once for each regime, and both times it arrived at a detector built on the same idea. Each one slides a short window along the series, describes the rhythms inside that window, and then asks how unusual that description looks next to normal stretches of the training data. Windows that stand out get a high anomaly score, which is turned back into a per-timestamp score. Both detectors are fast, with a running time that grows roughly in proportion to the length of the series. Where they differ is the description they use: the univariate detector captures how a window's energy is spread across its rhythms, while the multivariate detector captures the combined rhythms of all channels at once.
The univariate detector. Rather than looking at the raw values in a window, this detector looks at how the window's energy is split between fast and slow rhythms, and at the overall shape of that split. It turns each window into a short list of descriptive numbers, for example how peaked or how flat the spectrum is, where its energy sits, and how much of it falls in slow versus fast rhythms, together with a term that reacts when part of the window suddenly goes quiet or freezes. Earlier frequency-based detectors compare a spectrum against a smoothed baseline [30], score windows by their distance to a nearest neighbour [47], or learn a frequency-domain reconstruction [7, 45]; what is different here is that the description is fixed, easy to read, and judged as a whole rather than one number at a time. The score therefore rises not just when a single number is unusual, but when the normal relationship between them breaks. Because the description is mostly about shape and rhythm rather than the raw size of the values, the detector also catches anomalies whose values stay in the normal range and that value-based detectors tend to miss, such as cycles running at the wrong period or phase, out-of-context subsequences, and frozen segments. It repeats this at several window sizes and blends the results, giving extra weight to the windows that look genuinely improbable. To our knowledge this particular construction has not previously been used for anomaly detection, and we verify empirically that it outperforms the closest existing frequency-domain and feature-based detectors (Section 6.2).
Formally, a window is Hann-tapered and mean-removed, , with power spectrum , ( ), normalized to ( a standard deviation, a small constant). Its spectral-organization signature stacks eight scalars,
https://anonymous.4open.science/r/TS-AD_submission-7E42/README.md
Table 1: Methods selected by each search. Entries summarize the final program in each regime; full accuracy results appear in Section 6.
| Search | Univariate method | Multivariate method |
|---|---|---|
| Opus 4.8 Loop | Multi-scale spectral-organization signature scored by Gaussian novelty | Joint per-channel band-powers scored by Gaussian novelty |
| GPT 5.6 Terra Loop | Local total variation in training-percentile coordinates | Local distribution-shape field |
| MiniMax-2.5 Loop | Local derivative and higher-moment feature fusion | Z-score, interpolation-error, and local-variance fusion |
| MiniMax-2.5 ShinkaEvolve | Ensemble of autocorrelation, entropy, divergence, rank, and z-score signals | Ensemble of Mahalanobis, autoregressive-residual, z-score, and derivative signals |
namely the entropy , peak concentration , centroid , log-energy , log flatness SF, low/high band ratio , log–log spectral slope (), and a complexity-collapse term over four sub-blocks . Appending a bank of log-spaced band-powers gives the descriptor . This descriptor is scored by a shrunk full-covariance Mahalanobis distance to the Gaussian of normal windows and fused across a dyadic scale space with a tail-emphasized weighting. The exact score and fusion, and all constants, are given in Appendix C (Eqs. 3–4).
The multivariate detector. For series with many channels, the detector describes the rhythms of all channels together. It slides a window across the channels, removes each window's level so that only its shape matters, and measures how much energy each channel carries in a few frequency bands. Stacking these across all channels gives one description of the window's joint rhythm. It then builds a single statistical model of what normal windows look like and scores each window by how far it lies from that model. Because all channels share one model, the score reacts not only when a single channel's rhythm changes, but when the usual relationship between the channels breaks, even if every channel on its own still looks perfectly normal. To stay fast, the detector samples windows at regular strides and caps how many it uses, so its cost grows roughly in proportion to the length of the series even for very long, high-dimensional data. And because the model has a fixed size rather than growing with the data, one fit on a short training segment carries over to much longer test series. The full description and all constants are given in Appendix C (Eqs. 5–6).
5 EXPERIMENTAL SETUP
Benchmarks and datasets. Our primary evaluation is the established TSB-AD [17], using the 16-family protocol of Time-RCD [14]: eleven univariate families (IOPS, MGAB, NAB, NEK, Power, SED, Stock, TODS, UCR, WSD, Yahoo) and five multivariate families (MSL, PSM, SMAP, SMD, SWaT), all listed in Table 2. For completeness we additionally evaluate on TAB [26], a more recent benchmark that assembles a larger and differently curated field, both univariate (14 dataset families, 816 series) and multivariate (25 families, 214 series), under a single evaluation pipeline and reports a wider panel of range- and volume-aware metrics. We report its full fields in Appendix E.
Metrics. On TSB-AD we follow the Time-RCD protocol and report the affiliation F-measure [11], a tolerance-aware temporal F1 (F1-T), the point-wise standard F1, and VUS-PR [24]. On TAB we report the panel it standardizes: the volume-under-the-surface pair (VUS-PR, VUS-ROC), the two range-aware areas under the curve (R-AUC-PR, R-AUC-ROC) [24], and the affiliation F-measure [11]. Precise definitions are in Appendix A.
Baselines and protocol. On TSB-AD we adopt the published 16-family protocol of Time-RCD [14] and place our detectors, scored under that protocol, against the baseline results reported for it: the Time-RCD foundation model [14], the deep detectors TranAD [38], USAD [2], OmniAnomaly [35], DCdetector [46], and TFMAE [7], and the classical baselines LOF [5], Isolation Forest [16], and subsequence PCA [34]. Time-RCD is the strongest non-classical baseline in this field. On TAB (Appendix E) we compare against the full field of detectors bundled with the benchmark, spanning non-learning, classical, and deep methods (for example HBOS [8], EIF [9], KMeans, DWT-MLEAD [37], and deep models such as TimesNet [41], ModernTCN [20], PatchTST [22], iTransformer [18], CATCH [42], DUET [27], and the Anomaly Transformer [44]), together with the foundation models Time-RCD [14], TSPulse [6], and Chronos [1] (the last scored by its one-step forecast residuals, univariate only), all run from their released checkpoints without tuning. We verified that our evaluation scripts reproduced the numbers reported in the paper, confirming the wrappers are faithful and that the comparison is one-to-one.
The searches we compare. As ablations we ask how much the discovered detector depends on the driving model and on the search procedure, rather than on the harness alone. We compare four searches that hold the harness, the seed program, the synthetic-validation objective, and the single-principle prompt fixed, varying only the model and the search procedure. Three are instances of the agentic loop above, driven by various language models (Claude Opus 4.8, GPT 5.6 Terra, and the smaller open MiniMax-2.5), each run at the model's default reasoning-effort setting for a single one-hour session of roughly 100 evolutions per regime. The fourth swaps the agentic loop for SHINKAEVOLVE [15], an off-the-shelf evolutionary program-search framework (island populations with an elite archive) in the style of AlphaEvolve [23], driven by the same open MiniMax-2.5 model for a matched budget of 100 generations per regime. For every search we select the program with the best synthetic-validation score and evaluate it on both benchmarks exactly as we evaluate the baselines.
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
6 RESULTS
6.1 Accuracy on TSB-AD
Table 2 reports accuracy on TSB-AD under the Time-RCD protocol, across the eleven univariate and five multivariate dataset families and the four protocol metrics (affiliation F-measure, temporal F1-T, standard F1, and VUS-PR). The Opus 4.8 Loop row applies the univariate detector to the univariate families and the multivariate detector to the multivariate families; within each metric the best value per family is marked with a podium medal (1 2 3 for first, second, and third), and the final three columns count how often each method places first, second, or third across the sixteen families.
The Opus loop leads the field. The detector discovered by the Opus 4.8 loop takes the most first-place finishes on every one of the four metrics, and its advantage is widest on the precision-oriented metrics (standard F1 and VUS-PR). Its closest competitor is Time-RCD, a foundation model pretrained for zero-shot anomaly detection. The remaining deep detectors and the classical baselines trail further back and top only isolated families. Among our own searches the one exception is the multivariate side of TSB-AD, where the GPT 5.6 Terra loop's detector is marginally ahead of the Opus one (Section 6.4, Table 7). The Opus detector remains clearly in front on the univariate families and on both halves of TAB (Appendix E, Tables 5 and 6).
Corroboration on TAB. The larger TAB field (Appendix E, Tables 5 and 6) points the same way, with some nuance. On multivariate TAB the Opus loop's detector is first on all four range-aware metrics, ahead of every classical and deep baseline. On univariate TAB it leads the ranking-oriented ROC metrics, while KMeans is strongest on the precision metrics, so the two share the top of that field. On the region-based affiliation F-measure the detector is only mid-field on TAB, a consequence of emitting sharp novelty peaks rather than the broad predicted regions that this measure rewards (Section 7).
6.2 Did the loop rediscover an existing detector?
The discovered detectors describe each window by a fixed feature vector and score it by its distance to a model of normal windows, a design that overlaps with two established families: frequency-domain detectors and feature-based subsequence detectors. It is therefore fair to ask whether the loop merely rediscovered a method that already exists. To test this directly, we compare against the published methods closest to this design under the identical protocol, each run from its released implementation (Table 3). Two are canonical frequency-domain detectors: spectral-residual saliency [30] and a Fourier-reconstruction detector [29]. The others build on catch22 [19], the canonical interpretable time-series feature set, which we use in two forms. The first is C22MP [36], which scores catch22 features by a matrix profile. The second, our sharpest control, pairs the catch22 features with our own novelty framework: they are scored by the same Mahalanobis distance to a Gaussian of normal windows (“catch22 + Mahalanobis”).
The discovered detector leads all four metrics, and by a wide margin on the precision-oriented VUS-PR (53.9 versus at most 35.0). The “catch22 + Mahalanobis” control is the most telling: holding our novelty framework fixed and substituting the canonical catch22 features for the loop’s spectral-organization signature drops

Figure 2: Qualitative score comparison on four representative TAB univariate held-out test suffixes: two point anomalies (left) and two contextual anomalies (right). Each column shows the observed signal and the scores from the Opus Loop's discovered detector, Time-RCD [14], HBOS [8], and Isolation Forest [16]; orange bands mark the labeled anomaly range. The Opus Loop produces a sustained high score over each labeled event, while the comparators either miss the event or also respond strongly to normal cycles. For display, each score trace is independently normalized to [0, 1], preserving its within-series ordering.
VUS-PR from 53.9 to 28.4. The advantage therefore comes from the particular descriptor the loop assembled, not from the feature-based-novelty framework alone; and the discovered detector also clearly outperforms both canonical frequency-domain detectors and the published catch22-based C22MP. Extending these univariate methods to the multivariate families by scoring each channel independently leaves the ordering unchanged, with the discovered multivariate detector ahead on VUS-PR (Appendix F).
Every ingredient the loop used is individually well established: sliding-window spectral features, a Mahalanobis distance to a Gaussian of normal windows, and multi-scale fusion. Each of the methods above draws on some of them. Yet none combines them as the discovered detector does, and the discovered combination measurably outperforms each of the closest existing methods. We read this as evidence that the loop did not simply rediscover an existing detector, but instead composed known concepts into a new, and better, one.
6.3 Efficiency
Because each detector uses no GPU and trains no neural network, its cost is predictable and modest. Table 4 reports prediction-only wall-clock under the Time-RCD TSB-AD protocol: we time only
Berghaus Table 2: Evaluation on TSB-AD [17] using the setup of Time-RCD [14]. The Opus 4.8 Loop row combines its two separately discovered, regime-specific algorithms: the univariate algorithm in the univariate columns and the multivariate algorithm in the multivariate columns. Gold, silver, and bronze markers denote first, second, and third place; the final three columns report their respective counts. Metric Model Univariate Datasets Multivariate Datasets Total Total Total IOPS MGAB NAB NEK Power SED Stock TODS UCR WSD YAHOO MSL PSM SMAP SMD SWaT 1st 2nd 3rd Affiliation-F Opus 4.8 Loop (ours) 1 89.04 1 77.36 85.73 76.57 2 84.60 1 99.00 67.91 2 79.66 1 87.55 1 94.36 2 92.02 1 89.51 2 79.45 1 93.89 3 88.22 1 77.87 08 04 01 Time-RCD 2 86.98 2 74.54 1 93.81 83.95 1 85.02 2 88.99 41.31 1 84.86 2 84.34 2 91.00 1 95.94 2 84.66 1 82.31 86.01 2 91.75 69.43 05 07 00 TranAD 3 83.19 67.28 90.28 3 85.02 71.56 61.03 57.94 52.76 73.31 3 84.34 76.08 79.91 3 73.83 87.39 1 92.20 75.37 01 00 04 USAD 71.08 67.81 3 91.54 71.13 76.48 55.60 35.92 47.90 76.00 65.10 53.05 81.86 57.86 87.25 85.09 75.06 00 00 01 OmniAnomaly 80.32 67.35 2 92.35 2 86.30 3 78.16 61.26 1 75.24 50.73 73.53 78.02 71.31 83.15 58.17 2 91.38 85.82 73.39 01 03 01 LOF 81.06 68.44 75.75 84.74 66.76 63.85 3 69.74 60.58 73.53 81.29 75.63 3 84.35 61.98 63.32 64.13 56.34 00 00 02 IForest 52.81 3 68.82 39.84 71.15 0.00 70.09 0.06 44.17 50.56 41.24 33.30 63.36 63.78 59.96 69.71 0.00 00 00 01 Sub-PCA 75.39 66.90 89.29 1 97.10 71.37 67.14 2 70.63 3 72.75 3 76.66 76.45 75.85 84.25 71.49 3 90.08 85.80 2 76.29 01 02 03 DCdetector 71.83 67.91 72.21 62.31 69.75 3 72.20 55.79 57.81 70.18 72.79 67.77 67.74 67.32 67.10 69.55 71.07 00 00 01 TFMAE 78.25 67.50 75.99 76.91 70.30 68.17 56.39 62.83 70.60 80.25 3 76.87 75.70 70.07 75.36 70.85 3 75.72 00 00 02 F1-T Opus 4.8 Loop (ours) 2 50.86 1 29.08 3 53.59 58.00 1 29.61 1 83.71 15.48 2 46.59 1 41.36 1 64.25 3 54.27 1 60.71 2 39.20 1 57.49 2 52.41 39.82 07 04 02 Time-RCD 3 45.39 2 9.05 50.49 3 76.91 23.05 2 60.59 18.38 1 68.46 2 41.18 2 44.13 1 79.14 43.67 1 43.86 35.82 1 55.96 35.47 04 04 02 TranAD 22.63 1.65 37.28 69.97 22.36 9.57 16.73 13.51 7.75 20.94 8.41 39.42 25.49 29.12 37.98 2 49.58 00 01 00 USAD 20.99 3 4.07 1 61.46 70.64 2 28.23 9.54 16.86 20.85 14.63 14.18 9.35 48.71 28.96 43.94 50.41 1 50.41 02 01 01 OmniAnomaly 1 51.17 1.61 40.09 2 82.20 3 23.48 9.68 2 36.22 14.33 8.47 3 34.79 24.16 2 49.36 3 30.42 2 46.63 51.84 46.64 01 04 03 LOF 27.97 1.15 35.76 63.57 19.80 9.60 1 66.14 3 31.63 8.31 24.38 2 55.93 38.97 25.58 21.81 10.13 30.62 01 01 01 IForest 7.64 0.84 21.44 65.56 0.00 9.54 1.10 11.06 6.36 4.28 4.90 20.73 25.39 14.32 16.20 0.00 00 00 00 Sub-PCA 32.75 0.98 2 54.15 1 84.18 20.30 9.54 20.10 18.40 3 18.90 24.62 11.57 3 49.02 30.38 3 44.31 3 51.87 3 46.65 01 01 05 DCdetector 6.61 1.32 32.72 29.21 21.13 10.53 16.07 16.40 6.62 7.32 6.81 23.24 25.34 15.73 9.47 28.64 00 00 00 TFMAE 19.41 1.07 33.04 31.11 20.18 3 11.82 3 22.15 16.48 5.90 19.11 23.85 25.28 25.36 19.39 10.13 28.46 00 00 02 Standard-F1 Opus 4.8 Loop (ours) 1 47.97 1 28.96 3 45.09 47.43 1 29.64 1 83.74 16.91 2 54.26 1 36.56 1 60.54 2 52.33 1 49.01 1 31.01 1 53.10 50.79 49.19 09 02 01 Time-RCD 2 47.28 2 8.63 42.66 3 68.64 23.12 2 60.85 19.56 1 70.02 2 33.47 2 41.04 1 89.05 34.48 28.25 25.36 3 53.82 34.44 02 05 02 TranAD 34.85 1.46 27.33 60.36 22.36 2.63 16.23 11.94 4.40 20.23 5.70 29.60 25.63 25.11 43.99 2 61.86 00 01 00 USAD 30.66 3 3.89 1 56.15 62.91 2 28.24 3.41 17.99 23.87 10.74 13.20 7.21 3 38.71 28.41 38.66 53.06 1 62.82 02 01 02 OmniAnomaly 3 47.05 1.44 28.81 2 74.03 3 23.50 0.43 2 38.59 12.65 5.11 3 29.57 21.40 2 39.10 2 30.43 2 40.50 2 57.06 55.93 00 06 03 LOF 30.28 1.05 24.04 56.92 12.18 4.11 1 66.20 3 25.77 4.70 22.62 3 48.95 30.65 18.80 18.70 8.41 29.08 01 00 02 IForest 8.37 0.73 29.41 58.10 19.77 3.81 16.91 13.35 4.09 2.07 3.20 14.68 24.15 13.61 16.89 26.76 00 00 00 Sub-PCA 33.96 0.83 2 46.71 1 85.43 16.05 9.56 21.77 18.72 3 15.12 24.74 11.06 38.29 3 30.26 3 38.90 1 57.22 3 55.98 02 01 04 DCdetector 5.19 1.21 24.02 17.37 21.10 10.54 16.97 17.85 3.18 4.64 4.14 14.08 25.33 10.67 8.99 27.02 00 00 00 TFMAE 9.48 0.97 23.78 19.74 20.14 3 11.87 3 23.32 14.88 2.83 15.53 20.50 15.68 25.39 12.58 9.16 27.08 00 00 02 VUS-PR Opus 4.8 Loop (ours) 1 49.52 1 14.99 41.45 46.88 1 21.47 1 97.46 66.70 2 84.71 1 33.09 1 60.93 2 75.20 1 40.51 1 22.15 1 47.06 36.01 30.08 09 02 00 Time-RCD 2 42.98 2 3.09 3 44.65 3 71.13 3 14.63 2 69.86 72.73 1 91.67 2 27.48 2 29.95 1 87.88 23.41 2 21.69 19.68 1 46.70 18.47 03 06 03 TranAD 21.61 0.64 24.82 61.63 13.04 5.75 78.08 47.33 2.25 12.20 25.78 14.78 16.49 13.37 28.34 1 47.37 01 00 00 USAD 16.58 3 0.75 1 55.03 58.53 2 18.68 4.37 74.53 3 56.36 8.85 10.00 14.15 29.95 17.59 26.37 34.53 2 44.73 01 02 02 OmniAnomaly 3 25.35 0.64 27.17 2 74.51 14.32 6.20 1 91.29 45.55 2.40 16.37 29.26 2 31.57 3 18.58 2 28.07 3 37.44 42.97 01 03 03 LOF 19.43 0.57 21.18 58.52 9.31 6.81 2 83.07 49.14 2.39 12.85 3 41.37 24.67 13.58 10.59 4.40 14.50 00 01 01 IForest 8.59 0.62 23.57 56.50 11.56 7.71 70.99 46.62 2.88 2.06 10.47 11.29 15.85 7.55 8.88 15.49 00 00 00 Sub-PCA 23.02 0.60 2 46.08 1 88.91 10.49 3.72 3 80.86 54.16 3 12.92 3 16.41 21.57 3 31.43 18.52 3 26.42 2 37.50 3 43.02 01 02 06 DCdetector 5.83 0.59 16.60 14.03 12.32 9.37 74.16 46.66 1.53 3.23 10.17 7.01 14.49 4.21 4.66 15.04 00 00 00 TFMAE 5.32 0.64 15.68 17.81 11.90 3 9.55 73.54 48.79 2.57 5.36 25.93 8.25 14.22 5.76 4.77 15.38 00 00 01 Table 3: Comparison with the closest published methods on the TSB-AD univariate families (Time-RCD protocol; datasetmean, higher is better ↑). Each baseline is run from its released implementation and rows are ordered by VUS-PR; “catch22 + Mahalanobis” keeps our novelty framework and only substitutes the catch22 feature set for the discovered spectral signature. Best per column in bold. Method Aff-F ↑ F1-T ↑ Std-F1 ↑ VUS-PR ↑ Opus 4.8 Loop (ours) 84.89 47.89 45.77 53.86 FFT detector [29] 78.34 27.01 26.95 35.00 Spectral Residual [30] 83.52 41.01 36.44 34.75 C22MP [36] 77.88 26.32 24.32 32.01 catch22 + Mahalanobis [19] 75.40 22.96 21.34 28.36 each detector’s scoring call, excluding data loading and metric computation. Our detectors and the classical baselines run on a single CPU core. The foundation model Time-RCD and the deep detectors, marked ∗ , run on a V100 GPU and are timed as deployed: Time-RCD at inference from its pretrained checkpoint, the deep detectors including their per-series fit. Our detector is the fastest CPU method in both regimes and the fastest method overall on multivariate. On the univariate families it scores about 5 𝜇s per step, on par with LOF and 3–16× faster than the other classical baselines. Only Time-RCD is faster, and only because a pretrained transformer runs a single batched GPU forward pass, whereas every per-series-trained deep detector is 40–120× slower than our detector even on the GPU. On the multivariate families our detector leads every method: Time-RCD costs about 1.9 s per series and the deep detectors 2.5–7 s, all on a GPU and all one to two orders of magnitude slower than our CPU-only program, whose classical subsequence competitors also slow steeply on the 25–66-channel series. In short, the discovered detectors combine their accuracy with runtime and memory that are easy to reason about, as short auditable programs rather than models with GPU-scale cost. 6.4 Ablation: the model and the search procedure Holding the harness, the seed program, and the single-principle prompt fixed, the four searches differ only in the driving model and the search procedure, which lets us gauge how much each contributes. Table 7 compares the four discovered variants on TSBAD, and Appendix E reports the same four in the full TAB field. The driving model matters most. The Opus 4.8 loop is the strongest search overall, and by a wide margin in the univariate regime, where it leads the other three on every metric while the other loops (GPT 5.6 Terra and MiniMax-2.5) and the evolutionary baseline cluster well below it. On the multivariate families the strongest searches sit closer together: the GPT loop edges the Opus
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
Table 4: Efficiency on TSB-AD (Time-RCD protocol). Prediction-only wall-clock (lower is better, ↓), timing only each detector's scoring call over a representative subset of series (up to five per family, ≤50k steps); s/series is the per-series mean, μs/step normalizes by series length. Rows marked * run on a V100 GPU; all others use a single CPU core and train no network.
| Method | s/series ↓ | μs/step ↓ |
|---|---|---|
| Univariate (44 series) | ||
| Time-RCD [14]* | 0.011 | 0.9 |
| Opus 4.8 Loop (ours) | 0.059 | 5.1 |
| LOF [5] | 0.068 | 5.9 |
| PCA (subseq.) [34] | 0.183 | 16.0 |
| Isolation Forest [16] | 0.575 | 50.2 |
| KMeans | 0.926 | 80.8 |
| USAD [2]* | 2.2 | 188 |
| TranAD [38]* | 6.8 | 596 |
| OmniAnomaly [35]* | 6.8 | 597 |
| Multivariate (16 series) | ||
| Opus 4.8 Loop (ours) | 0.054 | 4.4 |
| LOF [5] | 1.3 | 104 |
| Time-RCD [14]* | 1.9 | 152 |
| USAD [2]* | 2.5 | 209 |
| KMeans | 4.0 | 332 |
| OmniAnomaly [35]* | 4.1 | 336 |
| TranAD [38]* | 7.3 | 604 |
| PCA [34] | 29.8 | 2453 |
| Isolation Forest [16] | 44.8 | 3694 |
loop on TSB-AD, while the Opus loop is clearly ahead on TAB, so across benchmarks neither is consistently in front.
The search procedure matters less, but shapes what gets built. Fixing the model to MiniMax-2.5 and varying only the search procedure (the agentic loop versus the SHINKAEVOLVE evolutionary search) gives no consistent winner on accuracy: neither is reliably ahead of the other across the two benchmarks and the two regimes (Table 7 and Appendix E), so the search structure looks like a smaller factor than the driving model. Where the two procedures pull apart is in the kind of program they return. The agentic loops stayed close to the single-principle steer and produced shorter programs built mainly around one idea: the Opus loop returned two compact, genuinely novel single-principle detectors (Section 4), and even the other loops kept to a single idea, as with the GPT loop's univariate detector that scores the local total variation of a window in training-percentile coordinates, though those programs transferred to the held-out field far less well, most starkly on univariate. The SHINKAEVOLVE search, under the identical prompt asking for one novel principle and explicitly discouraging the fusion of standard methods, instead converged in both regimes on a hacky weighted ensemble of standard methods: several standard signals in the univariate program (autocorrelation structure, gradient-direction entropy, a local distribution-divergence statistic, a local-rank score, and the original z-score signal) and, in the multivariate one, a mix that includes a Mahalanobis distance, per-channel residuals from predicting each channel from the others, the z-score, and velocity and acceleration terms. We suspect this might be caused by how the framework works: the evolutionary framework often asks to merge different ideas together, and (by construction) it also presents diverse programs as context at each evolution step, so incremental additions to an already competitive program tend to be kept even when they grow a larger, less coherent ensemble rather than a fresh single principle. A single run per regime cannot pin down that mechanism, but it is a plausible reason the shared prompt did not prevent this kind of heuristic accretion. The evolutionary programs also end up markedly longer and more heavily hand-tuned than the loops', the evolutionary search is much slower to run at several hours per regime against the loops' roughly one-hour sessions, and its multivariate ensemble is comparatively slow at inference on the longest series, unlike the tight runtime budget the loop's detectors respect.
7 DISCUSSION AND LIMITATIONS
The appeal of letting an agent discover detectors lies not only in the measured numbers but in the resulting artifact: each detector is a short, readable program, so its inductive biases are inspectable and its cost is predictable. This contrasts with opaque trained models and makes the method easy to audit and to port. It also changes where human effort goes, from designing the detector to designing the harness, the synthetic-anomaly generator, and the objective that the agent optimizes against.
Several caveats apply. First, the detector's standing depends on the metric family and the benchmark. On TSB-AD it leads across the reported metrics. On TAB it dominates the multivariate side but shares the top of the univariate side with KMeans, which is ahead on the precision metrics there, and it is only mid-field on the region-based affiliation measure because it is a sharp scorer rather than a region predictor. Second, although we evaluate on two independently curated benchmarks, a still broader study across more benchmarks and dataset families (and potentially real-world deployment) would be needed to confirm the generality of the discovered detectors. Third, the synthetic generator is where prior knowledge about anomalies enters. We tried to keep it broad and realistic but certain types of anomalies that are not captured well by the prior might be missed by the discovered detectors. The generator is also a design choice that could be varied, and we do not claim that the discovered detectors are optimal for every conceivable anomaly type. Finally, the discovery has a one-time cost in language-model queries and compute; our efficiency claims concern the discovered detector at inference time, not the search that produced it. Though we do report that the searches could be performed within the 20 USD subscription plans and should therefore be accessible to many researchers and practitioners.
8 CONCLUSION
We asked whether an LLM-driven autonomous research loop is an effective tool for writing time-series anomaly detectors. Driven by frontier models and steered toward short, single-principle programs, the loop discovered related spectral-Gaussian novelty detectors in the two regimes: a rich, multi-scale spectral-organization signature for univariate series, and a joint per-channel band-power model for multivariate series. On the TSB-AD benchmark these detectors lead the reported metrics and remain near the top of the broader TAB field. Both are fully unsupervised, run on a single CPU core with no GPU and no neural training, and consist of short, readable code that keeps them cheap and auditable.
GENERATIVE AI USAGE
The research idea, experimental design, and overall structure of this paper were conceived and developed by the human authors. LLM agents performed the implementation of the code with human oversight. Generative AI tools additionally assisted with drafting and editing the manuscript text, in every case under human oversight, with all claims, results, and conclusions verified by the authors. Figure 1 was produced with a generative image model.
FUNDING
This research has been funded by the Federal Ministry of Education and Research of Germany and the state of North-Rhine Westphalia as part of the Lamarr Institute for Machine Learning and Artificial Intelligence.
REFERENCES
[1] Abdul Fatir Ansari, Lorenzo Stella, Caner Turkmen, Xiyuan Zhang, Pedro Mercado, Huibin Shen, Oleksandr Shchur, Syama Sundar Rangapuram, Sebastian Pineda Arango, Shubham Kapoor, Jasper Zschiegner, Danielle C. Maddix, Hao Wang, Michael W. Mahoney, Kari Torkkola, Andrew Gordon Wilson, Michael Bohlke-Schneider, and Yuyang Wang. 2024. Chronos: Learning the Language of Time Series. Transactions on Machine Learning Research (TMLR) (2024).
[2] Julien Audibert, Pietro Michiardi, Frédéric Guyard, Sébastien Marti, and Maria A. Zuluaga. 2020. USAD: Unsupervised Anomaly Detection on Multivariate Time Series. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 3395–3404.
[3] David Berghaus. 2026. EVIL: Evolving Interpretable Algorithms for Zero-Shot Inference on Event Sequences and Time Series with LLMs. arXiv:2604.15787 [cs.LG] https://arxiv.org/abs/2604.15787
[4] Paul Boniol and Themis Palpanas. 2020. Series2Graph: Graph-Based Subsequence Anomaly Detection for Time Series. Proc. VLDB Endow. 13, 11 (2020), 1821–1834.
[5] Markus M. Breunig, Hans-Peter Kriegel, Raymond T. Ng, and Jörg Sander. 2000. LOF: Identifying Density-Based Local Outliers. In ACM SIGMOD International Conference on Management of Data. 93–104.
[6] Vijay Ekambaram, Subodh Kumar, Arindam Jati, Sumanta Mukherjee, Tomoya Sakai, Pankaj Dayama, Wesley M. Gifford, and Jayant Kalagnanam. 2026. TSPulse: Tiny Pre-Trained Models with Disentangled Representations for Rapid Time-Series Analysis. In The Fourteenth International Conference on Learning Representations. https://openreview.net/forum?id=Kw2mvnzCoc
[7] Yuchen Fang, Jiandong Xie, Yan Zhao, Lu Chen, Yunjun Gao, and Kai Zheng. 2024. Temporal-Frequency Masked Autoencoders for Time Series Anomaly Detection. In IEEE 40th International Conference on Data Engineering (ICDE). 1228–1241.
[8] Markus Goldstein and Andreas Dengel. 2012. Histogram-Based Outlier Score (HBOS): A Fast Unsupervised Anomaly Detection Algorithm. KI-2012: Poster and Demo Track (2012), 59–63.
[9] Sahand Hariri, Matias Carrasco Kind, and Robert J. Brunner. 2021. Extended Isolation Forest. IEEE Transactions on Knowledge and Data Engineering 33, 4 (April 2021), 1479–1489. https://doi.org/10.1109/tkde.2019.2947676
[10] Zengyou He, Xiaofei Xu, and Shengchun Deng. 2003. Discovering Cluster-Based Local Outliers. Pattern Recognition Letters 24, 9-10 (2003), 1641–1650.
[11] Alexis Huet, Jose Manuel Navarro, and Dario Rossi. 2022. Local Evaluation of Time Series Anomaly Detection Algorithms. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 635–645.
[12] Andrej Karpathy. 2026. Autoresearch: Autonomous Machine Learning Research with LLM Agents. https://github.com/karpathy/autoresearch. GitHub repository.
[13] Diederik P. Kingma and Max Welling. 2013. Auto-Encoding Variational Bayes. arXiv preprint arXiv:1312.6114 (2013).
[14] Tian Lan, Hao Duong Le, Jinbo Li, Wenjun He, Meng Wang, Chenghao Liu, and Chen Zhang. 2026. Towards Foundation Models for Zero-Shot Time Series Anomaly Detection: Leveraging Synthetic Data and Relative Context Discrepancy. In International Conference on Machine Learning (ICML).
[15] Robert Tjarko Lange, Yuki Imajuku, and Edoardo Cetin. 2025. Shinka-Evolve: Towards Open-Ended and Sample-Efficient Program Evolution. arXiv:2509.19349 [cs.NE] https://arxiv.org/abs/2509.19349
[16] Fei Tony Liu, Kai Ming Ting, and Zhi-Hua Zhou. 2008. Isolation Forest. In 2008 Eighth IEEE International Conference on Data Mining. IEEE, 413–422.
[17] Qinghua Liu and John Paparrizos. 2024. The Elephant in the Room: Towards a Reliable Time-Series Anomaly Detection Benchmark. In Advances in Neural Information Processing Systems (NeurIPS) Datasets and Benchmarks Track.
[18] Yong Liu, Tengge Hu, Haoran Zhang, Haixu Wu, Shiyu Wang, Lintao Ma, and Mingsheng Long. 2024. iTransformer: Inverted Transformers Are Effective for
Time Series Forecasting. In International Conference on Learning Representations (ICLR).
[19] Carl H. Lubba, Sarab S. Sethi, Philip Knaute, Simon R. Schultz, Ben D. Fulcher, and Nick S. Jones. 2019. catch22: A Cononical Time-series CHaracteristics: Selected through highly comparative time-series analysis. Data Mining and Knowledge Discovery 33, 6 (2019), 1821–1852.
[20] Donghao Luo and Xue Wang. 2024. ModernTCN: A Modern Pure Convolution Structure for General Time Series Analysis. In International Conference on Learning Representations (ICLR).
[21] Pankaj Malhotra, Anusha Ramakrishnan, Gaurangi Anand, Lovekesh Vig, Puneet Agarwal, and Gautam Shroff. 2016. LSTM-Based Encoder-Decoder for Multi-Sensor Anomaly Detection. In ICML Anomaly Detection Workshop.
[22] Yuqi Nie, Nam H. Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. 2023. A Time Series is Worth 64 Words: Long-Term Forecasting with Transformers. In International Conference on Learning Representations (ICLR).
[23] Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco J. R. Ruiz, Abbas Mehrabian, M. Pawan Kumar, Abigail See, Swarat Chaudhuri, George Holland, Alex Davies, Sebastian Nowozin, Pushmeet Kohli, and Matej Balog. 2025. AlphaEvolve: A Coding Agent for Scientific and Algorithmic Discovery. arXiv:2506.13131 [cs.AI] https://arxiv.org/abs/2506.13131
[24] John Paparrizos, Paul Boniol, Themis Palpanas, Ruey S. Tsay, Aaron Elmore, and Michael J. Franklin. 2022. Volume Under the Surface: A New Accuracy Evaluation Measure for Time-Series Anomaly Detection. Proc. VLDB Endow. 15, 11 (2022), 2774–2787.
[25] Tomáš Pevný. 2016. LODA: Lightweight On-line Detector of Anomalies. Machine Learning 102 (2016), 275–304.
[26] Xiangfei Qiu, Zhe Li, Wanghui Qiu, Shiyan Hu, Lekui Zhou, Xingjian Wu, Zhengyu Li, Chenjuan Guo, Aoying Zhou, Zhenli Sheng, Jilin Hu, Christian S. Jensen, and Bin Yang. 2025. TAB: Unified Benchmarking of Time Series Anomaly Detection Methods. Proc. VLDB Endow. 18, 9 (2025), 2775–2788. https://doi.org/10.14778/3746405.3746407
[27] Xiangfei Qiu, Xingjian Wu, Yan Lin, Chenjuan Guo, Jilin Hu, and Bin Yang. 2025. DUET: Dual Clustering Enhanced Multivariate Time Series Forecasting. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 1185–1196.
[28] Sridhar Ramaswamy, Rajeev Rastogi, and Kyuseok Shim. 2000. Efficient algorithms for mining outliers from large data sets. In Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data. 427–438.
[29] Faraz Rasheed, Peter Peng, Reda Alhajj, and Jon Rokne. 2009. Fourier Transform Based Spatial Outlier Mining. In Intelligent Data Engineering and Automated Learning (IDEAL 2009) (Lecture Notes in Computer Science), Vol. 5788. Springer, 317–324.
[30] Hansheng Ren, Bixiong Xu, Yujing Wang, Chao Yi, Congrui Huang, Xiaoyu Kou, Tony Xing, Mao Yang, Jie Tong, and Qi Zhang. 2019. Time-Series Anomaly Detection Service at Microsoft. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. 3009–3017.
[31] Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. Pawan Kumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli, and Alhussein Fawzi. 2024. Mathematical Discoveries from Program Search with Large Language Models. Nature 625, 7995 (2024), 468–475. https://doi.org/10.1038/s41586-023-06924-6
[32] Mayu Sakurada and Takehisa Yairi. 2014. Anomaly Detection Using Autoencoders with Nonlinear Dimensionality Reduction. In Workshop on Machine Learning for Sensory Data Analysis (MLSDA). 4–11.
[33] Bernhard Schölkopf, John C. Platt, John Shawe-Taylor, Alex J. Smola, and Robert C. Williamson. 2001. Estimating the Support of a High-Dimensional Distribution. Neural Computation 13, 7 (2001), 1443–1471.
[34] Mei-Ling Shyu, Shu-Ching Chen, Kanoksri Sarinnapakorn, and LiWu Chang. 2003. A Novel Anomaly Detection Scheme Based on Principal Component Classifier. In Proceedings of the IEEE Foundations and New Directions of Data Mining Workshop. 172–179.
[35] Ya Su, Youjian Zhao, Chenhao Niu, Rong Liu, Wei Sun, and Dan Pei. 2019. 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. 2828–2837.
[36] Sadaf Tafazoli, Yue Lu, Renjie Wu, Thirumalai Vinjamoor Akhil Srinivas, Hannah Dela Cruz, Ryan Mercer, and Eamonn Keogh. 2023. Matrix Profile XXIX: C22MP, Fusing catch22 and the Matrix Profile to Produce an Efficient and Interpretable Anomaly Detector. In 2023 IEEE International Conference on Data Mining (ICDM). IEEE, 568–577.
[37] Markus Thill, Wolfgang Konen, and Thomas Bäck. 2017. Time series anomaly detection with discrete wavelet transforms and maximum likelihood estimation. International Conference on Time Series (ITISE) (2017).
[38] Shreshth Tuli, Giuliano Casale, and Nicholas R. Jennings. 2022. TranAD: Deep Transformer Networks for Anomaly Detection in Multivariate Time Series Data. Proc. VLDB Endow. 15, 6 (2022), 1201–1214.
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
[39] Wenxuan Wang, Kai Wu, Yujian Betterest Li, Dan Wang, and Xiaoyu Zhang. 2025. Synthetic Series-Symbol Data Generation for Time Series Foundation Models. arXiv preprint arXiv:2510.08445 (2025).
[40] Phillip Wenig, Sebastian Schmidl, and Thorsten Papenbrock. 2022. TimeEval: A Benchmarking Toolkit for Time Series Anomaly Detection Algorithms. Proc. VLDB Endow. 15, 12 (2022), 3678–3681.
[41] Haixu Wu, Tengge Hu, Yong Liu, Hang Zhou, Jianmin Wang, and Mingsheng Long. 2023. TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis. In International Conference on Learning Representations (ICLR).
[42] Xingjian Wu, Xiangfei Qiu, Zhengyu Li, Yihang Wang, Jilin Hu, Chenjuan Guo, Hui Xiong, and Bin Yang. 2025. CATCH: Channel-Aware Multivariate Time Series Anomaly Detection via Frequency Patching. In International Conference on Learning Representations (ICLR).
[43] Shifeng Xie, Vasilii Feofanov, Ambroise Odonnat, Lei Zan, Marius Alonso, Jianfeng Zhang, Themis Palpanas, Lujia Pan, Keli Zhang, and Ievgen Redko. 2026. CauKer: Classification Time Series Foundation Models Can Be Pretrained on Synthetic Data. arXiv:2508.02879 [cs.LG] https://arxiv.org/abs/2508.02879
[44] Jiehui Xu, Haixu Wu, Jianmin Wang, and Mingsheng Long. 2022. Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy. In International Conference on Learning Representations (ICLR).
[45] Zhijian Xu, Ailing Zeng, and Qiang Xu. 2024. FITS: Modeling Time Series with 10k Parameters. In International Conference on Learning Representations (ICLR).
[46] Yiyuan Yang, Chaoli Zhang, Tian Zhou, Qingsong Wen, and Liang Sun. 2023. DCdetector: Dual Attention Contrastive Representation Learning for Time Series Anomaly Detection. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 3033–3045.
[47] Chin-Chia Michael Yeh, Yan Zhu, Liudmila Ulanova, Nurjahan Begum, Yifei Ding, Hoang Anh Dau, Diego Furtado Silva, Abdullah Mueen, and Eamonn Keogh. 2016. Matrix Profile I: All Pairs Similarity Joins for Time Series. In IEEE International Conference on Data Mining (ICDM). 1317–1322.
[48] Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. 2023. Are Transformers Effective for Time Series Forecasting?. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 37. 11121–11128.
[49] Tian Zhou, Peisong Niu, Xue Wang, Liang Sun, and Rong Jin. 2023. One Fits All: Power General Time Series Analysis by Pretrained LM. In Advances in Neural Information Processing Systems (NeurIPS).
[50] Zhihao Zhuang, Yingying Zhang, Kai Zhao, Chenjuan Guo, Bin Yang, Qingsong Wen, and Lunting Fan. 2025. Noise Matters: Cross Contrastive Learning for Time Series Anomaly Detection. Proc. VLDB Endow. (2025).
[51] Bo Zong, Qi Song, Martin Renqiang Min, Wei Cheng, Cristian Lumezanu, Daeki Cho, and Haifeng Chen. 2018. Deep Autoencoding Gaussian Mixture Model for Unsupervised Anomaly Detection. In International Conference on Learning Representations (ICLR).
A METRIC DEFINITIONS
We summarize the standardized metrics used in the main text; full definitions are given by the works we cite. All accuracy metrics lie in and are higher-is-better.
Binarization. Our detectors output only raw per-timestamp scores ; we never threshold them ourselves. The region- and point-based measures that need a binary prediction obtain it inside the evaluation harness, identically for every method (ours and the baselines): under the Time-RCD/TSB-AD protocol of the main text the harness reports each threshold-dependent metric at its score-optimal operating point (sweeping the score quantile and keeping the best attainable value), while on TAB the label metrics are averaged over a fixed grid of contamination ratios. Threshold-free measures (the AUC and VUS families) use the raw scores directly.
Range-aware AUCs (R-AUC-PR, R-AUC-ROC). Standard AUC-PR and AUC-ROC treat every timestamp independently and with equal weight, which understates the quality of detectors on extended (subsequence) anomalies. The range-aware variants add a tolerance region around each labeled anomaly so that scores raised near a true event are credited, and then integrate precision-recall or ROC behavior over that construction [24].
Volume under the surface (VUS-PR, VUS-ROC). VUS removes the dependence on a single tolerance width by sweeping the size of the boundary buffer and integrating the resulting family of PR or ROC curves into a volume [24]. This yields a threshold-free and buffer-width-free summary that is well suited to subsequence anomalies, and it is the headline metric on the TSB-AD leaderboard [17]. We order the TAB baseline field by VUS-PR for this reason (listing our discovered detectors first), while reporting the full panel of metrics rather than any composite of them.
Affiliation F-measure (Aff-F). The affiliation metric is a parameter-free, label-based measure that pairs predicted anomaly events with ground-truth events and scores their temporal affiliation, combining an affiliation precision and recall into an F-measure [11]. It applies uniformly to point and subsequence anomalies. Because it scores predicted regions, threshold-free scorers like ours are evaluated on the binary regions the harness derives from the raw scores as described above.
Point-wise and temporal F1 (Standard-F1, F1-T). The standard F1 is the point-wise F-measure between the binarized predictions and the ground-truth labels y, computed timestamp by timestamp. Writing TP, FP, and FN for the timestamp-wise true positives, false positives, and false negatives, it is the harmonic mean of precision and recall,
with Prec = TP/(TP + FP) and Rec = TP/(TP + FN). The temporal F1-T relaxes this with a per-series tolerance around each labeled event, so a prediction close to a true anomaly is credited without requiring exact timestamp overlap. Both are reported under the Time-RCD protocol on TSB-AD [14], with the binary predictions formed inside the harness as described above.
B SEARCH CONFIGURATION
Synthetic anomaly generator. The validation slice is the last 30% of each series' training region (at least 128 steps); synthetic anomalies are injected only into this slice with a fixed seed. Anomalies are placed as non-overlapping windows, sampled until a target fraction of the slice is anomalous (subject to a minimum number of windows and a minimum gap between them), with each window's length drawn uniformly from a fixed range. Each window receives a single anomaly type, drawn uniformly from a mix that deliberately spans both magnitude and in-range shape/contextual families, so that a competitive detector must handle both; the types reimplement those in the GutenTAG generator [40]. Each type is intended to imitate a generic mechanism that occurs in practice: a frozen sensor, a valid shape out of context, a stretched or misaligned cycle, a burst of noise, a drifting level. Magnitudes are expressed in units of the channel's robust standard deviation : a mean shift adds with random sign; a platform sets the window to its median ; a trend adds a linear ramp of total rise up to ; a variance burst adds Gaussian noise of scale ; an extremum is a single-point spike of ; an amplitude anomaly rescales the window's oscillation about its mean by (or its reciprocal) under a smooth bell envelope; a discord splices in a real subsequence copied from a distant part of the same series, level-aligned to the local median (a real but out-of-context shape); a warp resamples a neighboring stretch into the window (a stretched/compressed, wrong-period cycle); a phase shift circularly rotates the window by a large fraction of its length (a misaligned cycle); a flatline freezes the window at its starting value (a frozen sensor); and a scramble randomly permutes the window's samples in time (its value distribution is unchanged but its local temporal structure is destroyed). All types except the point extremum label the entire window; the extremum labels only the spike timestamp. The two regimes use the following generator configurations, which are the ones used for every experiment in the paper.
• Univariate. Anomalous fraction 0.02; window lengths ; minimum gap 32; at least 3 windows; single-channel. Type mix {discord, warp, phase, flatline, scramble, mean, platform, extremum}, weighted toward the in-range shape/contextual families, which cannot be resolved from magnitude alone and therefore keep the objective from being satisfied by a threshold on deviation, with level and point types retained for coverage.
• Multivariate. Anomalous fraction 0.05; window lengths ; minimum gap 16; at least 3 windows; a fraction 0.25 of anomalies are applied jointly to all channels (the rest to a single random channel), which creates cross-channel correlation breaks alongside single-channel events. Type mix {mean, platform, trend, extremum, amplitude, variance, discord, warp}.
C DISCOVERED DETECTOR CONFIGURATIONS
We give the key constants present in the discovered programs; complete executable implementations appear in Appendix D. Both detectors standardize from training-region statistics, slide a window, derive local spectral features, and score their novelty under a Gaussian model of normal training windows. The univariate detector uses robust median/MAD feature scaling and a square-root Mahalanobis score; the multivariate detector uses per-channel mean/std scaling and a squared Mahalanobis score.
Univariate detector. The window is Hann-tapered; its descriptor concatenates the spectral-organization signature (spectral entropy, log spectral flatness, spectral centroid, peak concentration, log energy, log-power/log-frequency slope, low/high band ratio), a within-window complexity-collapse term (least-active sub-block variation vs whole-window variation), and a bank of log-spaced band-powers. The descriptor enters one shrunk full-covariance (0.95 full-covariance weight, shrunk toward a scaled identity) Mahalanobis distance (Eq. 3), so each coordinate is scored conditional on the others. The novelty is evaluated over a dyadic scale space of window lengths spanning short to long, and the per-scale scores are fused by a tail-emphasized rank fusion amplified by a gate on the robust-z of a window's distance above the normal training-distance tail. The per-series pass runs in tens of milliseconds on typical series and at most a few seconds on the longest; the window length adapts to the series, and very long inputs are strided to bound cost. Formally, writing for the robustly scaled (median/MAD) descriptor of Eq. 1, the per-scale novelty is the shrunk full-covariance Mahalanobis distance
with . Per-scale distances are referenced to the training tail as and fused over the dyadic scale space ,
with the training CDF, the logistic, and ; the exponent and the gate concentrate score mass on the extreme tail.
Multivariate detector. Window (shrunk automatically on short series), a small set of frequency bands (6) per channel, all C channels stacked into one descriptor after per-window DC removal and Hann tapering. The normal training-region descriptors are summarized by their mean and one pooled, ridge-regularized covariance (the sample covariance plus a small diagonal ridge ), and the raw score is the squared Mahalanobis distance of each window to that Gaussian (Eq. 6). Windows are strided and their number is hard-capped (a few thousand) so the strided FFT and the Mahalanobis stay near-linear on series up to hundreds of thousands of steps and dozens of channels. Formally, each length-L window ( ) is reduced to per-channel powers aggregated into bands, log-compressed and stacked across channels,
and one Gaussian (mean m, ridged covariance ) fitted to the normal descriptors gives the squared Mahalanobis score
with . Because is a single pooled covariance, its cross-channel off-diagonal blocks encode the normal spectral coupling, so a window that breaks it scores high even when every channel is individually in range.
D DISCOVERED ALGORITHMS
For full transparency we reproduce the complete executable implementations of the two discovered detectors. They are the programs evaluated throughout the paper, with only harness edit markers and nonessential explanatory comments removed. Each is a single self-contained scoring function with a few small helpers; it reads a training segment and a test segment of one series and returns a per-timestamp anomaly score, fitting whatever it needs on the training region without labels. Algorithm 1 is the univariate detector and Algorithm 2 the multivariate detector, both found by the Opus 4.8 loop. The detectors found by the other three searches (the GPT 5.6 Terra and MiniMax-2.5 loops and the MiniMax-2.5 SHINKAEVOLVE baseline, each in both regimes) are provided in full in the anonymized repository linked in Section 4.
from future import annotations
import numpy as np
https://anonymous.4open.science/r/TS-AD_submission-7E42/README.md
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
_NBANDS = 11 # log-spaced frequency bands whose log-powers enter the → signature
_TAIL_P = 6.0 # tail-power sharpening exponent on the per-scale rank curve _GATE_C = 3.0 # train-referenced magnitude gate centre (robust-z of distance) _GATE_L = 8.0 # gate amplification strength (additive 1 + L*gate) _SHRINK = 0.95 # covariance shrinkage toward identity (full-cov weight)
def _as_1d(values: np.ndarray) -> np.ndarray: """Return a 1D float series.""" a = np.asarray(values, dtype=np.float64) if a.ndim == 0: return a.reshape(1) if a.ndim == 1: return a return a.reshape(a.shape[0], -1)[:, 0]
def _strided(x: np.ndarray, w: int, step: int): """Return windows and their start indices.""" n = x.size if n < w: w = n starts = np.arange(0, n - w + 1, step) if starts.size == 0: starts = np.array([0]) idx = starts[:, None] + np.arange(w)[None, :] return x[idx], starts, w
def _interp_to_points(win_scores: np.ndarray, centers: np.ndarray, n: int) -> np → .ndarray: """Interpolate window scores to timestamps.""" if centers.size == 1: return np.full(n, float(win_scores[0])) return np.interp(np.arange(n), centers, win_scores)
def _train_rank(reference: np.ndarray, values: np.ndarray) -> np.ndarray: """Map values to their empirical percentile under a training reference.""" ref = np.sort(np.asarray(reference, dtype=np.float64).reshape(-1)) if ref.size == 0: return np.zeros_like(values, dtype=np.float64) return np.searchsorted(ref, values, side="right") / ref.size
def _spectral_org(win: np.ndarray) -> np.ndarray: """Return spectral-organization features for each window.""" wl = win.shape[1] taper = np.hanning(wl) if wl >= 4 else np.ones(wl) wc = (win - win.mean(axis=1, keepdims=True)) * taper[None, :] power = np.abs(np.fft.rfft(wc, axis=1)) ** 2 power = power[:, 1:] + 1e-12 nb = power.shape[1] if nb == 0: return np.zeros((win.shape[0], 8 + _NBANDS)) pn = power / power.sum(axis=1, keepdims=True)
entropy = -(pn * np.log(pn)).sum(axis=1) geo_mean = np.exp(np.log(power).mean(axis=1)) ari_mean = power.mean(axis=1) flatness = np.log(geo_mean / ari_mean + 1e-12) freqs = np.arange(1, nb + 1, dtype=np.float64) centroid = (pn * freqs[None, :]).sum(axis=1) concentration = pn.max(axis=1) log_energy = np.log(win.std(axis=1) + 1e-8)
log_f = np.log(freqs) log_p = np.log(power) log_f0 = log_f - log_f.mean() slope = (log_p * log_f0[None, :]).sum(axis=1) / (log_f0 @ log_f0 + 1e-12)
half = max(1, nb // 2) low = power[:, :half].sum(axis=1) high = power[:, :half].sum(axis=1) band_ratio = np.log(low / (high + 1e-12) + 1e-12)
Least-active sub-block relative to whole-window variation.
nsub = 4
sub = wl // nsub
if sub >= 2:
blocks = win[:, :sub * nsub].reshape(win.shape[0], nsub, sub)
blk_std = blocks.std(axis=2)
win_std = win.std(axis=1) + 1e-8
collapse = np.log((blk_std.min(axis=1) + 1e-8) / win_std)
else:
collapse = np.zeros(win.shape[0])
Log-spaced normalized AC band powers.
edges = np.unique(np.round(np.geomspace(1, nb, _NBANDS + 1)).astype(int)) - 1
edges = edges[(edges >= 0) & (edges < nb)]
if edges.size < 1: band_feats = np.zeros((win.shape[0], _NBANDS))
else: band = np.add.reduceat(pn, edges, axis=1) band_feats = np.log(band + 1e-6) if band_feats.shape[1] < _NBANDS: pad = np.zeros((win.shape[0], _NBANDS - band_feats.shape[1])) band_feats = np.concatenate([band_feats, pad], axis=1) else: band_feats = band_feats[:, :_NBANDS]
core = np.stack( [entropy, flatness, centroid, concentration, log_energy, slope, band_ratio, collapse], axis=1, )
return np.concatenate([core, band_feats], axis=1)
def _novelty_curve(train: np.ndarray, test: np.ndarray, w: int, n_tr: int, n_te:
→ int):
"""Return train/test spectral-novelty curves at scale w."""
w = int(min(w, n_tr))
if w < 6:
return None, None
# Bound window count at fine scales.
step = max(2, w // 6)
tr_win, tr_starts, w = _strided(train, w, step) # Preserve the training-selected descriptor for short test batches. test_work = test if n_te >= w else np.pad(test, (0, w - n_te), mode="edge") te_win, te_starts, _ = _strided(test_work, w, step) d_tr = _spectral_org(tr_win) d_te = _spectral_org(te_win)
Robust feature scaling.
med = np.median(d_tr, axis=0)
mad = np.median(np.abs(d_tr - med), axis=0) * 1.4826 + 1e-8
z_tr = (d_tr - med) / mad
z_te = (d_te - med) / mad
Shrunk full-covariance Mahalanobis novelty.
if z_tr.shape[0] > z_tr.shape[1]:
cov = np.cov(z_tr.T)
else:
cov = np.eye(z_tr.shape[1])
cov = _SHRINK * cov + (1.0 - _SHRINK) * np.eye(cov.shape[0])
cov_inv = np.linalg.pinv(cov)
s_tr = np.sqrt(np.einsum("ij,jk,ik->i", z_tr, cov_inv, z_tr).clip(0)) s_te = np.sqrt(np.einsum("ij,jk,ik->i", z_te, cov_inv, z_te).clip(0))
Express distance relative to the training-distance distribution.
d_med = np.median(s_tr)
d_mad = np.median(np.abs(s_tr - d_med)) * 1.4826 + 1e-8
e_tr = (s_tr - d_med) / d_mad
e_te = (s_te - d_med) / d_mad
tr_curve = _interp_to_points(e_tr, tr_starts + w // 2, n_tr) te_curve = _interp_to_points(e_te, te_starts + w // 2, n_te) return tr_curve, te_curve
def detect_anomaly_outputs(train_values: np.ndarray, test_values: np.ndarray) -> → dict: train = _as_1d(train_values) test = _as_1d(test_values) n_tr, n_te = train.size, test.size
Tiny-series fallback.
if n_tr < 24 or n_te < 12:
center = np.median(train) if n_tr else 0.0
scale = np.median(np.abs(train - center)) * 1.4826 + 1e-8 if n_tr else
→ 1.0
tr_scores = np.abs((train - center) / scale)
te_scores = np.abs((test - center) / scale)
return {
"train_scores": tr_scores.astype(np.float64),
"test_scores": te_scores.astype(np.float64),
}
Multi-scale window lengths.
base = int(np.clip(n_tr // 10, 24, 96))
base = min(base, n_tr)
scales = sorted({
6,
}
)
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
10, max(16, base // 4), max(16, base // 2), base, min(200, base * 2), min(300, base * 4), })
tr_acc = np.zeros(n_tr) te_acc = np.zeros(n_te) used = 0
for w in scales: tr_curve, te_curve = _novelty_curve(train, test, w, n_tr, n_te) if te_curve is None: continue
Tail-emphasized, train-referenced rank fusion.
tr_g = 1.0 / (1.0 + np.exp(-(tr_curve - _GATE_C)))
te_g = 1.0 / (1.0 + np.exp(-(te_curve - _GATE_C)))
tr_acc += (_train_rank(tr_curve, tr_curve) ** _TAIL_P) * (1.0 + _GATE_L)
← * tr_g)
te_acc += (_train_rank(tr_curve, te_curve) ** _TAIL_P) * (1.0 + _GATE_L)
← * te_g)
used += 1
if used == 0: center = np.median(train) tr_acc = np.abs(train - center) te_acc = np.abs(test - center)
else: tr_acc /= used te_acc /= used
Light temporal smoothing.
span = max(3, base // 8)
kernel = np.ones(span) / span
tr_acc = np.convolve(tr_acc, kernel, mode="same")
te_acc = np.convolve(te_acc, kernel, mode="same")
return { "train_scores": tr_acc.astype(np.float64), "test_scores": te_acc.astype(np.float64), }
Algorithm 1: The Opus loop's univariate detector.
from future import annotations
import numpy as np
Cross-channel spectral-coherence novelty via joint band-power Mahalanobis
→ score.
from numpy.lib.stride_tricks import as_strided
def _as_2d(values: np.ndarray) -> np.ndarray: """Return a float array shaped (time, channels).""" array = np.asarray(values, dtype=np.float64) if array.ndim == 0: return array.reshape(1, 1) if array.ndim == 1: return array[:, None] return array.reshape(array.shape[0], -1)
def detect_anomaly_outputs(train_values: np.ndarray, test_values: np.ndarray) -> dict: train = _as_2d(train_values) test = _as_2d(test_values)
Train-region channel standardization.
mu = train.mean(axis=0)
sd = train.std(axis=0)
sd = np.where(sd > 1e-8, sd, 1.0)
trn = (train - mu) / sd
ten = (test - mu) / sd
C = trn.shape[1]
Window length and band count.
L = 80
L = min(L, max(8, trn.shape[0] // 4))
nb = 6
win = np.hanning(L)[: , None]
edges = np.linspace(0, L // 2 + 1, nb + 1).astype(int)
def bandpower(x: np.ndarray, stride: int): """Return per-window, per-channel log band powers."""
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
T = x.shape[0] s0, s1 = x strides n = (T - L) // stride + 1 if n <= 0: return np.zeros((1, nb * C)), np.array([min(L // 2, T - 1)]) starts = np.arange(n) * stride wins = as_strided(x, shape=(n, L, C), strides=(s0 * stride, s0, s1)). → copy() wins -= wins.mean(axis=1, keepdims=True) wins *= win F = np.fft.rfft(wins, axis=1) P = F.real ** 2 + F.imag ** 2 feats = np.add.reduceat(P, edges[-1], axis=1) feats = np.log1p(feats).reshape(n, nb * C) return feats, starts + L // 2
Bound windows for near-linear runtime.
MAXW = 4000 te_stride = L // 4 tr_stride = max(L // 2, int(np.ceil(trn.shape[0] / MAXW))) Ftr, _ = bandpower(trn, tr_stride) Fte, ctr_te = bandpower(ten, te_stride)
Joint model of normal band-power vectors.
m = Ftr.mean(axis=0) Sig = np.cov(Ftr, rowvar=False) Sig = np.atleast_2d(Sig) + 1e-2 * np.eye(Ftr.shape[1])
def maha(F: np.ndarray) -> np.ndarray: Z = F - m try: Lc = np.linalg.cholesky(Sig) Y = np.linalg.solve(Lc, Z.T).T return np.sum(Y * Y, axis=1) except np.linalg.LinAlgError: return np.einsum('ti,ij,tj->t', Z, np.linalg.pinv(Sig), Z)
d_te = maha(Fte)
test_scores = np.interp(np.arange(ten.shape[0]), ctr_te, d_te, left=d_te[0] if d_te.size else 0.0, right=d_te[-1] if d_te.size else 0.0)
Required by the interface only.
train_scores = np.zeros(trn.shape[0])
return { "train_scores": train_scores.astype(np.float64), "test_scores": test_scores.astype(np.float64), }
Algorithm 2: The Opus loop's multivariate detector.
E COMPLETE RESULT TABLES
The main text reports accuracy on TSB-AD (Table 2). Here we report the full TAB fields as a broader corroboration, listing our discovered detectors first and then the baseline field ordered by VUS-PR. The methods we discovered are marked (ours); the best value in each column is in bold and podium medals mark the top three values per column.
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series
Table 5: Full TAB univariate field (all baselines). Metrics higher is better (↑); dataset-mean; our discovered detectors first, then baselines ordered by VUS-PR. Best in each column is bold; podium medals (① ② ③) mark the top three values per column.
| Method | VUS-PR ↑ | VUS-ROC ↑ | R-AUC-PR ↑ | R-AUC-ROC ↑ | Aff-F ↑ |
|---|---|---|---|---|---|
| Opus 4.8 Loop (ours) | 0.319 | 0.862 | 0.314 | 0.864 | 0.727 |
| GPT 5.6 Terra Loop (ours) | 0.236 | 0.577 | 0.236 | 0.580 | 0.436 |
| MiniMax-2.5 Loop (ours) | 0.253 | 0.767 | 0.255 | 0.767 | 0.666 |
| MiniMax-2.5 ShinkaEvolve (ours) | 0.294 | 0.772 | 0.298 | 0.775 | 0.662 |
| KMeans | 0.362 | 0.784 | 0.366 | 0.786 | 0.792 |
| Time-RCD [14] | 0.315 | 0.796 | 0.317 | 0.801 | 0.664 |
| DWT-MLEAD [37] | 0.312 | 0.699 | 0.318 | 0.704 | 0.716 |
| TSPulse [6] | 0.270 | 0.723 | 0.283 | 0.727 | 0.620 |
| iTransformer [18] | 0.244 | 0.753 | 0.250 | 0.763 | 0.810 |
| HBOS [8] | 0.242 | 0.625 | 0.242 | 0.631 | 0.696 |
| TimesNet [41] | 0.224 | 0.742 | 0.228 | 0.751 | 0.805 |
| OCSVM [33] | 0.218 | 0.658 | 0.220 | 0.664 | 0.700 |
| KNN [28] | 0.213 | 0.638 | 0.215 | 0.644 | 0.708 |
| ModernTCN [20] | 0.210 | 0.725 | 0.213 | 0.734 | 0.807 |
| PatchTST [22] | 0.208 | 0.728 | 0.211 | 0.736 | 0.803 |
| DAGMM [51] | 0.204 | 0.599 | 0.204 | 0.604 | 0.571 |
| DLinear [48] | 0.202 | 0.721 | 0.205 | 0.730 | 0.808 |
| EIF [9] | 0.202 | 0.671 | 0.203 | 0.679 | 0.782 |
| LODA [25] | 0.197 | 0.608 | 0.194 | 0.609 | 0.674 |
| Chronos-Bolt [1] | 0.196 | 0.695 | 0.199 | 0.705 | 0.755 |
| LSTMED [21] | 0.193 | 0.669 | 0.195 | 0.677 | 0.704 |
| AE [32] | 0.189 | 0.609 | 0.190 | 0.615 | 0.682 |
| ZMS | 0.184 | 0.650 | 0.187 | 0.656 | 0.709 |
| NLinear [48] | 0.183 | 0.719 | 0.186 | 0.727 | 0.794 |
| TranAD [38] | 0.179 | 0.594 | 0.182 | 0.603 | 0.774 |
| VAE [13] | 0.177 | 0.622 | 0.179 | 0.630 | 0.681 |
| Torsk | 0.177 | 0.662 | 0.180 | 0.666 | 0.703 |
| CBLOF [10] | 0.173 | 0.651 | 0.174 | 0.659 | 0.692 |
| PCA [34] | 0.172 | 0.606 | 0.171 | 0.610 | 0.674 |
| LOF [5] | 0.169 | 0.638 | 0.172 | 0.644 | 0.706 |
| IF [16] | 0.168 | 0.662 | 0.169 | 0.673 | 0.718 |
| StatThreshold | 0.148 | 0.578 | 0.148 | 0.581 | 0.637 |
| Series2Graph [4] | 0.129 | 0.675 | 0.134 | 0.684 | 0.780 |
| ARIMA | 0.129 | 0.564 | 0.129 | 0.567 | 0.652 |
| SARIMA | 0.127 | 0.586 | 0.127 | 0.587 | 0.682 |
| SpectralResidual [30] | 0.123 | 0.610 | 0.125 | 0.617 | 0.698 |
| DualTF | 0.107 | 0.604 | 0.110 | 0.611 | 0.728 |
| LeftSTAMPi [47] | 0.103 | 0.583 | 0.107 | 0.589 | 0.726 |
| ContraAD [50] | 0.059 | 0.579 | 0.059 | 0.586 | 0.684 |
| ATrans [44] | 0.058 | 0.485 | 0.058 | 0.485 | 0.700 |
| DCdetector [46] | 0.057 | 0.491 | 0.057 | 0.493 | 0.688 |
Table 6: Full TAB multivariate field (all baselines). Metrics higher is better (↑); dataset-mean; our discovered detectors first, then baselines ordered by VUS-PR. Best in each column is bold; podium medals (① ② ③) mark the top three values per column.
| Method | VUS-PR ↑ | VUS-ROC ↑ | R-AUC-PR ↑ | R-AUC-ROC ↑ | Aff-F ↑ |
|---|---|---|---|---|---|
| Opus 4.8 Loop (ours) | 0.499 $\text{①}$ | 0.783 $\text{①}$ | 0.512 $\text{①}$ | 0.790 $\text{①}$ | 0.668 |
| GPT 5.6 Terra Loop (ours) | 0.460 $\text{②}$ | 0.778 $\text{②}$ | 0.471 $\text{②}$ | 0.785 $\text{②}$ | 0.672 |
| MiniMax-2.5 Loop (ours) | 0.390 | 0.734 | 0.388 | 0.736 | 0.703 |
| MiniMax-2.5 ShinkaEvolve (ours) | 0.439 $\text{③}$ | 0.767 $\text{③}$ | 0.442 $\text{③}$ | 0.770 $\text{③}$ | 0.702 |
| KMeans | 0.325 | 0.676 | 0.325 | 0.676 | 0.688 |
| OCSVM [33] | 0.310 | 0.637 | 0.310 | 0.638 | 0.676 |
| Time-RCD [14] | 0.309 | 0.709 | 0.311 | 0.712 | 0.610 |
| DAGMM [51] | 0.303 | 0.656 | 0.302 | 0.657 | 0.538 |
| TimesNet [41] | 0.295 | 0.722 | 0.296 | 0.725 | $\text{①}$ |
| KNN [28] | 0.293 | 0.681 | 0.293 | 0.680 | 0.700 |
| DUET [27] | 0.285 | 0.709 | 0.287 | 0.712 | $\text{③}$ |
| LSTMED [21] | 0.285 | 0.688 | 0.288 | 0.691 | 0.584 |
| CATCH [42] | 0.284 | 0.709 | 0.287 | 0.712 | 0.777 |
| PatchTST [22] | 0.280 | 0.719 | 0.282 | 0.722 | $\text{②}$ |
| EIF [9] | 0.279 | 0.738 | 0.281 | 0.742 | 0.774 |
| VAE [13] | 0.278 | 0.686 | 0.281 | 0.690 | 0.548 |
| iTransformer [18] | 0.275 | 0.707 | 0.276 | 0.710 | 0.770 |
| AE [32] | 0.274 | 0.671 | 0.274 | 0.671 | 0.619 |
| TranAD [38] | 0.272 | 0.664 | 0.275 | 0.666 | 0.753 |
| CBLOF [10] | 0.272 | 0.712 | 0.273 | 0.716 | 0.674 |
| ModernTCN [20] | 0.266 | 0.694 | 0.267 | 0.696 | 0.776 |
| HBOS [8] | 0.264 | 0.680 | 0.266 | 0.683 | 0.664 |
| DLinear [48] | 0.262 | 0.705 | 0.264 | 0.708 | 0.775 |
| NLinear [48] | 0.257 | 0.704 | 0.258 | 0.706 | 0.774 |
| TSPulse [6] | 0.250 | 0.651 | 0.251 | 0.655 | 0.385 |
| PCA [34] | 0.247 | 0.662 | 0.246 | 0.664 | 0.642 |
| LOF [5] | 0.240 | 0.622 | 0.240 | 0.621 | 0.692 |
| IF [16] | 0.236 | 0.689 | 0.236 | 0.693 | 0.563 |
| LODA [25] | 0.196 | 0.591 | 0.196 | 0.590 | 0.651 |
| DualTF | 0.190 | 0.622 | 0.190 | 0.625 | 0.588 |
| Torsk | 0.189 | 0.582 | 0.190 | 0.584 | 0.611 |
| ContraAD [50] | 0.153 | 0.514 | 0.152 | 0.513 | 0.610 |
| ATrans [44] | 0.136 | 0.505 | 0.135 | 0.503 | 0.649 |
| DCdetector [46] | 0.132 | 0.508 | 0.131 | 0.507 | 0.632 |
Have an LLM Write Your Anomaly Detector: Autonomous Discovery of Compact, Interpretable Detectors for Time Series Table 7: Evaluation on TSB-AD [17] using the setup of Time-RCD [14]. The Opus 4.8 Loop row combines its two separately discovered, regime-specific algorithms: the univariate algorithm in the univariate columns and the multivariate algorithm in the multivariate columns. Gold, silver, and bronze markers denote first, second, and third place; the final three columns report their respective counts. Metric Model Univariate Datasets Multivariate Datasets Total Total Total IOPS MGAB NAB NEK Power SED Stock TODS UCR WSD YAHOO MSL PSM SMAP SMD SWaT 1st 2nd 3rd Affiliation-F Opus 4.8 Loop (ours) 2 89.04 1 77.36 85.73 76.57 2 84.60 1 99.00 67.91 2 79.66 1 87.55 1 94.36 2 92.02 1 89.51 79.45 2 93.89 88.22 3 77.87 05 05 01 GPT 5.6 Terra Loop (ours) 69.14 68.09 77.99 69.33 70.87 2 97.56 67.92 66.66 75.74 71.52 60.53 84.12 2 82.52 1 94.39 90.30 1 81.39 02 02 00 MiniMax 2.5 Loop (ours) 1 89.20 67.39 88.67 3 85.92 76.83 92.22 1 86.43 72.62 3 80.56 2 92.86 82.41 84.11 81.45 85.09 89.94 77.64 02 01 02 MiniMax ShinkaEvolve (ours) 3 88.66 67.81 91.26 84.71 71.87 3 97.21 2 85.52 71.77 80.33 3 91.79 3 85.95 2 86.20 1 84.60 85.92 3 91.00 2 78.53 01 03 05 Time-RCD 86.98 2 74.54 1 93.81 83.95 1 85.02 88.99 41.31 1 84.86 2 84.34 91.00 1 95.94 3 84.66 3 82.31 86.01 2 91.75 69.43 04 03 02 TranAD 83.19 67.28 90.28 85.02 71.56 61.03 57.94 52.76 73.31 84.34 76.08 79.91 73.83 87.39 1 92.20 75.37 01 00 00 USAD 71.08 67.81 3 91.54 71.13 76.48 55.60 35.92 47.90 76.00 65.10 53.05 81.86 57.86 87.25 85.09 75.06 00 00 01 OmniAnomaly 80.32 67.35 2 92.35 2 86.30 3 78.16 61.26 3 75.24 50.73 73.53 78.02 71.31 83.15 58.17 3 91.38 85.82 73.39 00 02 03 LOF 81.06 68.44 75.75 84.74 66.76 63.85 69.74 60.58 73.53 81.29 75.63 84.35 61.98 63.32 64.13 56.34 00 00 00 IForest 52.81 3 68.82 39.84 71.15 0.00 70.09 0.06 44.17 50.56 41.24 33.30 63.36 63.78 59.96 69.71 0.00 00 00 01 Sub-PCA 75.39 66.90 89.29 1 97.10 71.37 67.14 70.63 3 72.75 76.66 76.45 75.85 84.25 71.49 90.08 85.80 76.29 01 00 01 DCdetector 71.83 67.91 72.21 62.31 69.75 72.20 55.79 57.81 70.18 72.79 67.77 67.74 67.32 67.10 69.55 71.07 00 00 00 TFMAE 78.25 67.50 75.99 76.91 70.30 68.17 56.39 62.83 70.60 80.25 76.87 75.70 70.07 75.36 70.85 75.72 00 00 00 F1-T Opus 4.8 Loop (ours) 3 50.86 1 29.08 3 53.59 58.00 1 29.61 1 83.71 15.48 2 46.59 1 41.36 1 64.25 54.27 1 60.71 2 39.20 2 57.49 3 52.41 39.82 06 03 03 GPT 5.6 Terra Loop (ours) 8.82 0.77 44.68 54.48 22.36 3 70.36 15.51 21.41 17.74 8.64 5.16 2 57.78 3 34.26 1 61.54 2 53.32 45.62 01 02 02 MiniMax 2.5 Loop (ours) 1 51.24 2.13 43.01 3 77.43 20.67 21.73 3 55.69 28.61 3 23.49 2 57.18 45.51 42.39 28.94 31.41 47.48 45.54 01 01 03 MiniMax ShinkaEvolve (ours) 50.43 1.13 52.25 74.83 20.60 2 77.63 2 57.97 21.93 21.06 3 44.80 2 63.10 46.44 33.89 32.90 52.08 2 50.31 00 04 01 Time-RCD 45.39 2 9.05 50.49 76.91 23.05 60.59 18.38 1 68.46 2 41.18 44.13 1 79.14 43.67 1 43.86 35.82 1 55.96 35.47 04 02 00 TranAD 22.63 1.65 37.28 69.97 22.36 9.57 16.73 13.51 7.75 20.94 8.41 39.42 25.49 29.12 37.98 3 49.58 00 00 01 USAD 20.99 3 4.07 1 61.46 70.64 2 28.23 9.54 16.86 20.85 14.63 14.18 9.35 48.71 28.96 43.94 50.41 1 50.41 02 01 01 OmniAnomaly 2 51.17 1.61 40.09 2 82.20 3 23.48 9.68 36.22 14.33 8.47 34.79 24.16 3 49.36 30.42 3 46.63 51.84 46.64 00 02 03 LOF 27.97 1.15 35.76 63.57 19.80 9.60 1 66.14 3 31.63 8.31 24.38 3 55.93 38.97 25.58 21.81 10.13 30.62 01 00 02 IForest 7.64 0.84 21.44 65.56 0.00 9.54 1.10 11.06 6.36 4.28 4.90 20.73 25.39 14.32 16.20 0.00 00 00 00 Sub-PCA 32.75 0.98 2 54.15 1 84.18 20.30 9.54 20.10 18.40 18.90 24.62 11.57 49.02 30.38 44.31 51.87 46.65 01 01 00 DCdetector 6.61 1.32 32.72 29.21 21.13 10.53 16.07 16.40 6.62 7.32 6.81 23.24 25.34 15.73 9.47 28.64 00 00 00 TFMAE 19.41 1.07 33.04 31.11 20.18 11.82 22.15 16.48 5.90 19.11 23.85 25.28 25.36 19.39 10.13 28.46 00 00 00 Standard-F1 Opus 4.8 Loop (ours) 1 47.97 1 28.96 3 45.09 47.43 1 29.64 1 83.74 16.91 2 54.26 1 36.56 1 60.54 3 52.33 1 49.01 2 31.01 2 53.10 50.79 49.19 07 03 02 GPT 5.6 Terra Loop (ours) 12.05 0.68 35.96 47.72 22.35 3 70.51 16.92 24.86 13.48 5.75 2.72 2 48.92 28.47 1 59.51 53.51 54.06 01 01 01 MiniMax 2.5 Loop (ours) 2 47.65 1.90 34.79 3 70.86 20.64 21.96 3 56.08 3 27.21 3 19.94 2 52.38 32.67 28.52 28.90 26.58 51.15 2 66.91 00 03 04 MiniMax ShinkaEvolve (ours) 43.84 1.00 43.97 64.48 20.70 2 78.64 2 58.66 19.41 12.22 38.85 2 55.35 36.73 1 31.35 29.03 48.86 1 70.36 02 03 00 Time-RCD 3 47.28 2 8.63 42.66 68.64 23.12 60.85 19.56 1 70.02 2 33.47 3 41.04 1 89.05 34.48 28.25 25.36 3 53.82 34.44 02 02 03 TranAD 34.85 1.46 27.33 60.36 22.36 2.63 16.23 11.94 4.40 20.23 5.70 29.60 25.63 25.11 43.99 61.86 00 00 00 USAD 30.66 3 3.89 1 56.15 62.91 2 28.24 3.41 17.99 23.87 10.74 13.20 7.21 38.71 28.41 38.66 53.06 3 62.82 01 01 02 OmniAnomaly 47.05 1.44 28.81 2 74.03 3 23.50 0.43 38.59 12.65 5.11 29.57 21.40 3 39.10 3 30.43 3 40.50 2 57.06 55.93 00 02 04 LOF 30.28 1.05 24.04 56.92 12.18 4.11 1 66.20 25.77 4.70 22.62 48.95 30.65 18.80 18.70 8.41 29.08 01 00 00 IForest 8.37 0.73 29.41 58.10 19.77 3.81 16.91 13.35 4.09 2.07 3.20 14.68 24.15 13.61 16.89 26.76 00 00 00 Sub-PCA 33.96 0.83 2 46.71 1 85.43 16.05 9.56 21.77 18.72 15.12 24.74 11.06 38.29 30.26 38.90 1 57.22 55.98 02 01 00 DCdetector 5.19 1.21 24.02 17.37 21.10 10.54 16.97 17.85 3.18 4.64 4.14 14.08 25.33 10.67 8.99 27.02 00 00 00 TFMAE 9.48 0.97 23.78 19.74 20.14 11.87 23.32 14.88 2.83 15.53 20.50 15.68 25.39 12.58 9.16 27.08 00 00 00 VUS-PR Opus 4.8 Loop (ours) 1 49.52 1 14.99 41.45 46.88 1 21.47 1 97.46 66.70 2 84.71 1 33.09 1 60.93 2 75.20 1 40.51 1 22.15 2 47.06 36.01 30.08 08 03 00 GPT 5.6 Terra Loop (ours) 7.44 0.55 28.70 35.67 14.10 2 88.18 68.37 54.27 10.61 4.40 9.19 2 36.40 17.37 1 54.17 3 38.30 39.29 01 02 01 MiniMax 2.5 Loop (ours) 2 49.29 0.65 31.45 2 76.67 12.23 20.33 69.30 3 70.30 3 16.56 2 51.90 36.55 18.36 16.83 15.58 2 39.25 44.10 00 04 02 MiniMax ShinkaEvolve (ours) 33.78 0.61 39.67 69.10 12.34 64.77 2 84.55 51.92 8.11 3 33.57 3 50.49 23.07 3 20.17 18.58 38.09 2 45.97 00 02 03 Time-RCD 3 42.98 2 3.09 3 44.65 71.13 3 14.63 3 69.86 72.73 1 91.67 2 27.48 29.95 1 87.88 23.41 2 21.69 19.68 1 46.70 18.47 03 03 04 TranAD 21.61 0.64 24.82 61.63 13.04 5.75 78.08 47.33 2.25 12.20 25.78 14.78 16.49 13.37 28.34 1 47.37 01 00 00 USAD 16.58 3 0.75 1 55.03 58.53 2 18.68 4.37 74.53 56.36 8.85 10.00 14.15 29.95 17.59 26.37 34.53 3 44.73 01 01 02 OmniAnomaly 25.35 0.64 27.17 3 74.51 14.32 6.20 1 91.29 45.55 2.40 16.37 29.26 3 31.57 18.58 3 28.07 37.44 42.97 01 00 03 LOF 19.43 0.57 21.18 58.52 9.31 6.81 3 83.07 49.14 2.39 12.85 41.37 24.67 13.58 10.59 4.40 14.50 00 00 01 IForest 8.59 0.62 23.57 56.50 11.56 7.71 70.99 46.62 2.88 2.06 10.47 11.29 15.85 7.55 8.88 15.49 00 00 00 Sub-PCA 23.02 0.60 2 46.08 1 88.91 10.49 3.72 80.86 54.16 12.92 16.41 21.57 31.43 18.52 26.42 37.50 43.02 01 01 00 DCdetector 5.83 0.59 16.60 14.03 12.32 9.37 74.16 46.66 1.53 3.23 10.17 7.01 14.49 4.21 4.66 15.04 00 00 00 TFMAE 5.32 0.64 15.68 17.81 11.90 9.55 73.54 48.79 2.57 5.36 25.93 8.25 14.22 5.76 4.77 15.38 00 00 00
Table 8: Comparison with the closest published methods on the TSB-AD multivariate families, applying each univariate baseline per channel and averaging (Time-RCD protocol; dataset-mean, higher is better ↑). Best per column in bold.
| Method | Aff-F ↑ | F1-T ↑ | Std-F1 ↑ | VUS-PR ↑ |
|---|---|---|---|---|
| Opus 4.8 Loop (ours) | 85.79 | 49.93 | 46.62 | 35.16 |
| Spectral Residual [30] | 84.17 | 36.32 | 36.12 | 27.33 |
| C22MP [36] | 75.46 | 33.18 | 29.09 | 18.27 |
| FFT detector [29] | 77.24 | 29.83 | 28.34 | 17.05 |
| catch22 + Mahalanobis [19] | 75.73 | 31.81 | 27.15 | 15.82 |
F CLOSEST-METHOD COMPARISON ON MULTIVARIATE FAMILIES
The frequency-domain and feature-based detectors compared in Section 6.2 are univariate by construction. For completeness we also apply them to the multivariate families by scoring each channel independently and averaging the per-channel scores (catch22 features are likewise computed per channel). Table 8 reports this extension: the discovered multivariate detector remains ahead on all four metrics, most clearly on VUS-PR. Because these are univariate methods applied per channel rather than native multivariate detectors, we treat the comparison as indicative.