Time-series anomaly detection (TSAD) lacks a one-size-fits-all detector for heterogeneous data and anomaly types. Existing automation is limited by implicit objectives, potentially unreliable historical knowledge, or high computational costs. More fundamentally, it selects how to detect anomalies without explicitly defining what to detect. We propose SMAD, an LLM-based multi-agent framework that translates anomaly intent into executable, testable detection pipelines. Rather than selecting detectors against an implicit target, SMAD establishes a natural-language semantic contract grounded in measurable time-series properties, specifying target event patterns, expected score responses, and validation questions. This contract governs both detector construction and evaluation: LLM agents propose pipelines, while contract-matched synthetic interventions provide label-free evidence from the target series to assess semantic coverage and guide iterative self-refinement. A semantics-aware ensemble integrates validated candidates and attributes each alert to contributing detectors and supporting evidence. On univariate and multivariate TSAD benchmarks, SMAD improves detection performance over the strongest baseline by 11.5% and 9.6%, respectively, while outperforming general-purpose coding agents at 2-5x lower language-model token cost.
Figures & tables
Figure 1: Semantics-guided TSAD on an illustrative building-power time series. (a) Traditional AutoML may capture only a subset of anomaly patterns. (b) SMAD uses LLM-based grounding to specify what to detect through a semantic contract, which guides planning, label-free validation, and aggregation of detector (D) responses to determine how to detect .
Figure 2: Overview of SMAD . LLMs perform semantic grounding and candidate planning using input evidence and reusable knowledge. Candidate execution, label-free validation, aggregation, and claim auditing are deterministic. Validation feedback guides iterative refinement, while a run-specific evidence bank supports traceable outputs.
Figure 3: Illustration of the planning and refinement step. Each row: candidate and target entry, its validation signals and mean qi,k , and resulting coverage ∑kαkqˉk .
Method
Hist.
Run-All
Univariate
Multivariate
AUC-PR
VUS-PR
AUC-PR
VUS-PR
Global Best
✓
✗
0.3534
0.3712
0.2506
0.2510
Supervised Selection
✓
✗
0.4502
0.4826
0.3003
0.3087
Random Ensemble
✗
✗
0.2146
0.2519
0.1684
0.1750
AvgEns
✗
✓
0.4206
0.4673
0.2663
0.2906
MetaOD
✓
✗
0.3000
0.3479
0.2495
0.2632
Table 1: Performance overview of SMAD and baselines. Values are per-series means; higher is better. Families: Baseline Solution, AutoML, LLM-based, coding agent, ours. Hist. : has access to meta-training datasets. Run-All : must execute every candidate detector on the target series. Bold marks the best and underlined the second best. Additional per-dataset evaluation results are available in Table 6 .
Figure 4: Token cost against accuracy. Each point is a method that calls a hosted LLM, placed at its mean tokens per evaluation time series (log scale) and its mean VUS-PR; the upper left is better.
Figure 5: Effect of ensemble size k . SMAD uses semantic aggregation (Eqs. 4 – 5 ); the flat baseline takes a weighted mean of the same candidates.
Figure 6: Effect of domain context on SMAD by domain: paired mean VUS-PR change (with − without context) with 95% bootstrap intervals. Parentheses give univariate/multivariate series counts. Context augments the same frozen no-context ensemble.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Component
Fixed setting
Role and rationale
Semantic contract
At most five semantics; four equally weighted validation checks
Bounds the grounding schema and treats the four label-free checks symmetrically.
Planning budget
Four candidate proposals; 600-second wall-clock cap per episode
Provides the same bounded planning and execution budget to every time series; the budget changes cost, not the definition of a valid candidate.
Benchmark retrieval
Exact global scan; pool size 30; eight retained cards; profile/reliability coefficients (1,0.2)
Makes time-series structure the primary retrieval signal while record reliability acts as secondary evidence.
Semantic-scorer gate
At least one model candidate; coverage, model-support, benchmark-confidence, and redundancy cutoffs (0.5,1,0.5,2)
Implements a conservative model-first policy: a deterministic scorer is considered only when current evidence indicates an uncovered or weakly supported semantic.
Validation syllabus
At most three specifications; synthetic anomaly rate 0.03 ; magnitude scale 0.25 ; perturbation-noise scale 0.02
Bounds validation cost and uses one sparse, nontrivial intervention battery and one small stability perturbation shared by all candidates in an episode.
Validation frame
Full time series through 2,048 points; otherwise stride-10 sampling; 10,000-point cap with informative contiguous windows
Bounds repeated validation cost while retaining global temporal coverage; informative windows are used only for very long time series.
Appendix
Table 2: Fixed evaluation instantiation used for the reported runs. These values define one reproducible operating point rather than requirements of the framework.
Semantic bias
Score operator
Planner-set parameters
Targeted behavior
Robust tail
Robust z -score
–
Point / tail outliers
Local context residual
Rolling-median residual
window
Local contextual deviations
Seasonal phase residual
Same-phase peer residual
period
Seasonal phase breaks
Abrupt change
First difference
–
Sudden point-to-point change
Curvature impulse
Second difference
–
Sharp impulses, point shocks
Multiscale context
Multiscale residual
windows
Multi-scale local deviations
Appendix
Table 3: Examples of semantic biases available to the planner when it constructs a semantic scorer. Each bias is implemented by one deterministic, label-free score operator; the planner may set only the listed parameters.
Domain
Univariate
Multivariate
Source datasets
Total
Train / Eval
Total
Train / Eval
Medical
144
104 / 40
49
36 / 13
LTDB, MITDB, SVDB, UCR
Facility
101
70 / 31
22
16 / 6
SMD, UCR
Human Activity
58
41 / 17
9
6 / 3
Daphnet, OPP, UCR
Sensor
34
25 / 9
34
25 / 9
CATSv2, GECCO, SMAP, UCR
Synthetic
24
12 / 12
–
–
MGAB, TODS
Appendix
Table 4: Domain-wise statistics and splits for the twelve license-permitted TSB-AD source datasets.
Family
Candidate Model
U
M
Score principle
Statistical
MCD Rousseeuw and Driessen (1999)
✓
✓
Robust covariance deviation
OCSVM Schölkopf et al. (1999)
✓
✓
One-class decision boundary
LOF Breunig et al. (2000)
✓
✓
Local-density deviation
KNN Ramaswamy et al. (2000)
✓
✓
Nearest-neighbor distance
KMeansAD Yairi et al. (2001)
✓
✓
Distance to cluster centroid
IForest Liu et al. (2008)
✓
✓
Isolation depth
Appendix
Table 5: The 15-model candidate set shared by SMAD and the coding-agent baselines. All models are exposed in both the univariate (U) and multivariate (M) experiments.
Dataset
n
AvgEns
MetaOD
MSAD
TSADAMS
AutoOD
LLMAD
MLLMAD
MLLM4TS
Claude Code
Codex
AD-AGENT
SMAD
Univariate
UCR
64
0.3561
0.2849
0.3230
0.2200
0.0196
0.0636
0.0491
–
0.2455
0.2274
0.3244
0.3910
SMD
15
0.5683
0.2362
0.1412
0.1771
0.3962
0.1485
0.1714
–
0.5188
0.5303
0.1426
0.7710
SVDB
8
0.6052
0.4019
0.3175
0.0728
0.1088
0.1744
0.2054
–
0.4224
0.3274
0.3009
0.3532
TODS
8
0.6873
0.6536
0.6088
0.6779
0.5351
0.7800
0.7693
–
0.7882
0.8661
0.7748
0.8187
OPP
7
0.6914
0.4925
0.8285
0.2200
0.7236
0.1332
0.1521
–
0.3613
0.1875
0.2553
0.7221
Appendix
Table 6: VUS-PR per source dataset on the license-permitted evaluation time series, supplementing Table 1 . n is the number of evaluation time series from the dataset; rows are ordered by n , and All repeats the per-series means of Table 1 . Bold marks the best method in each row; the label-consulting Baseline Solution entries are omitted. – marks a method not run on that benchmark. Datasets with one or two series are noisy and should be read with care.
Method
Wall-clock (s)
AvgEns
747.3
LLMAD
245
MLLMAD
314
Claude Code
130.3
Codex
378.7
AD-AGENT
251.0
Appendix
Table 7: Mean wall-clock time per univariate evaluation time series ( n=115 ). Appendix B.4 describes how each time is measured.
Figure 7: How a semantic scorer changes the final anomaly score. Rows, top to bottom: the time series, with labeled anomalies shaded; the ensemble score without the scorer; the scorer’s own score; and the final score of the ensemble that includes it. Each score is min–max normalized over the whole series, and its VUS-PR is computed on the whole series. The views are zoomed to the anomaly. In the second and fourth rows, the score axis is clipped so that the sustained response is visible beneath the highest peaks. (a) The planner built the scorer during the run without benchmark cards. (b) The scorer was proposed from the domain context and admitted by the benefit gate.
ID
Type
Prio.
Shape
Operational description
Expected score behavior
SMAP #17 (multivariate): 25 channels, weak autocorrelation, heavy right tail, low cross-channel correlation
AS1
point spike
0.34
point
Isolated extreme observations in one or more channels, especially large positive excursions, are anomalous because the value distribution is strongly right-skewed and heavy-tailed while serial dependence is weak.
Sharp peaks at isolated extreme samples with rapid return to baseline.
AS2
collective
0.28
segment
Short runs of unusual volatility, repeated outliers, or abnormal motif/transition structure are anomalous even when individual samples are not uniquely extreme; local features show long stretches and burst-like structure despite weak global autocorrelation.
Sustained high over the abnormal run, with elevated segment-level score rather than a single-sample peak.
AS3
contextual
0.18
contextual
Values or local patterns that are plausible marginally but abnormal for their local channel context are anomalous, reflecting weak seasonality, moderate nonstationarity, and high noise where context-sensitive deviations matter more than global thresholds alone.
Localized elevation where the observation or short pattern departs from its recent local baseline.
AS4
level shift
0.12
segment
A persistent upward or downward change in a channel’s baseline level is anomalous, but lower priority because the profile shows weak trend strength and limited autocorrelation rather than strong stable regimes.
Step-like increase near the change point followed by sustained elevation while the shifted level persists.
AS5
correlation change
0.08
multivariate
A temporary change in cross-channel dependence is anomalous only when multiple channels move together or decouple in a way that contrasts with the normally low mean absolute correlation across 25 channels.
Elevated multivariate score over windows where cross-channel correlation structure changes.
Appendix
Table 8: Two frozen semantic contracts from the reported runs (no domain context), reproduced verbatim. Prio. is the entry priority; shape is the expected event shape.
Step
Target entry
Prio.
Detector
Window
π
q
w
Flagged (labeled)
VUS-PR
With benchmark cards (final VUS-PR 0.6842 ; 283 s; 88.2 K tokens)
0
AS1 contextual
0.38
KNN
48
0.74
0.344
20.5%
310 (70)
0.6742
1
AS2 collective
0.27
LOF
48
0.72
0.851
30.0%
554 (130)
0.7039
2
AS3 point spike
0.18
IForest
5
0.64
0.497
23.9%
893 (0)
0.0056
3
AS4 level shift
0.11
KMeansAD
48
0.58
0.588
25.6%
1,243 (0)
0.0051
Without benchmark cards (final VUS-PR 0.0207 ; 194 s; 80.5 K tokens)
Appendix
Table 9: End-to-end trajectory on MGAB #7 (univariate) from the reported run with benchmark cards and from the run without them (no domain context in either). Each step proposes one candidate for one contract entry. π is the planner prior, q the semantic coverage after validation, and w the final ensemble weight. Flagged gives the thresholded points attributed to the candidate’s semantic group, with the number inside the 200 labeled anomaly points in parentheses. VUS-PR is computed post hoc from the candidate’s own score; labels are never seen during the run.
ID
Claim
Cited
Verdict
Kept
Auditor note
C1
The input series has 7331 points across 25 channel(s) with seasonality strength 0.15, mean cross-channel correlation 0.07, and stationarity proxy 0.42.
E1
supported
✓
–
C2
Anomaly semantics suggest these types: point_spike, collective, contextual, level_shift, correlation_change.
E2
supported
✓
–
C3
IForest was selected as a candidate anomaly semantic/score stream with final score 0.552 (synthetic AP=0.08, recall@k=0.02, perturbation stability=0.72).
E19, E28
supported
✓
–
C4
KMeansAD was selected as a candidate anomaly semantic/score stream with final score 0.695 (synthetic AP=0.13, recall@k=0.12, perturbation stability=0.32).
E30, E36
supported
✓
–
C5
PCA was selected as a candidate anomaly semantic/score stream with final score 0.728 (synthetic AP=0.09, recall@k=0.03, perturbation stability=0.50).
E38, E44
supported
✓
–
C6
KNN was selected as a candidate anomaly semantic/score stream with final score 0.774 (synthetic AP=0.37, recall@k=0.34, perturbation stability=0.82).
E46, E52
supported
✓
–
Appendix
Table 10: Claim audit of the detection report for SMAP #17 (multivariate), reproduced verbatim from the reported run except that inline citation markers are moved to the Cited column. Cited lists the evidence identifiers in the claim; Kept indicates whether the claim appears in the emitted explanation (✓: kept; ∼ : kept with a partially supported marker; ✗: removed).
Recent studies have explored large language models for time-series anomaly detection, yet existing approaches often rely on a single general-purpose model to directly infer anomaly indices or intervals, limiting controllability, interpretability, and reliability for complex anomaly patterns. We propose SAGE (Specialized Analyzer Group for Expert-like Detection), a multi-agent framework for structured anomaly diagnosis in univariate time series. It decomposes anomaly analysis into four specialized Analyzers for point, structural, seasonal, and pattern anomalies. Each Analyzer applies family-specific numerical tools and diagnostic visualizations to generate evidence, while an evidence-grounded Detector consolidates the evidence into confidence-scored anomaly records with intervals and candidate types. A Supervisor then converts these structured records into analyst-facing diagnostic reports. SAGE further constructs synthetic in-context examples from normal-reference training segments, without using real anomalous segments or anomaly-type labels as in-context examples. Across three benchmarks, SAGE achieves the best average performance among strong ML/DL and language-model-based baselines. Ablation studies and human evaluation further show that the proposed framework improves detection reliability and the practical usefulness of diagnostic outputs.
Hyeongwon Kang, Jeongseob Kim, Jinwoo Park +1
Department of Industrial and Management Engineering Korea University · Mirae Asset Securities · Department of Industrial Engineering Seoul National University
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.
David Berghaus
Lamarr Institute Germany · Fraunhofer IAIS Germany
Time series anomaly detection (TSAD) supports the analysis of web service key performance indicators (KPIs) by identifying anomalous intervals. Recent large language model (LLM)-based agentic approaches have achieved promising results through reasoning and tool use. Despite their effectiveness, precise anomaly localization remains challenging, as diverse anomaly patterns demand targeted numerical evidence and iterative refinement to accurately determine anomaly boundaries. In this work, we propose AnomaMind, a coarse-to-fine agentic diagnosis framework for TSAD. AnomaMind first identifies suspicious regions from time-series visualizations, then adaptively acquires targeted numerical evidence through multi-turn tool interactions, and finally refines anomaly decisions through self-reflection. This process is supported by a tool engine that integrates knowledge memory and numerical analysis. To coordinate this diagnostic process, we design a hybrid inference strategy that employs frozen general-purpose LLMs for initial localization, tool orchestration, and evaluation, alongside a specialized LLM detector for evidence-grounded interval prediction. We optimize only the specialized detector through supervised fine-tuning (SFT) on diagnostic trajectories and reinforcement learning (RL) with verifiable detection rewards. Experiments on four benchmarks spanning web traffic, service KPIs, and system-monitoring signals, under both in-domain and multi-domain training settings, demonstrate competitive performance and support the effectiveness of coarse-to-fine adaptive diagnosis through targeted evidence acquisition and self-reflective refinement.The code is available at https://github.com/Xiaoyu-Tao/AnomaMind-TS.
Xiaoyu Tao, Yuchong Wu, Mingyue Cheng +2
State Key Laboratory of Cognitive Intelligence, University of Science and Technology of China, Hefei, Anhui Province, China