LEAP: a Latent Embedding Anomaly Patch-Transformer for time-series anomaly detection
Organizations: Department of Computer Science and Artificial Intelligence, University of Granada, Granada, Spain. · Andalusian Institute of Data Science and Computational Intelligence (DaSCI), University of Granada, Granada, Spain. · Department of Software Engineering, University of Granada, Granada, Spain
Abstract
Time-series anomaly detection is dominated by reconstruction-based neural detectors, whose objective is structurally flawed. Since the target is also the input, an expressive model can learn to reconstruct anomalies too, leaving uninformative residuals. Recent large-scale benchmarks show that, on curated data, elaborate deep detectors rarely beat simple statistical baselines, while current leaders rely on representation learning. We propose LEAP (Latent Embedding Anomaly Patch-Transformer), which combines masked prediction with latent representation-based anomaly evidence, without relying on reconstruction or attention-based scoring. The model removes patches from a window and predicts them from the remaining temporal and cross-channel context, so prediction errors measure how well learned dynamics explain hidden segments. Deterministic complementary group masking ensures every time step is scored while hidden, with identical visible fractions during training and inference. LEAP adds three label-free evidence sources: latent-embedding novelty calibrated by local density, local temporal contrast, and per-channel novelty pooled over channels selected by six label-free criteria. Under the TSB-AD protocol, the full model achieves a VUS-PR of on held-out multivariate series. On TSB-AD-U, a univariate variant combining multi-scale masked-prediction scoring with latent novelty, without contrast or channel-pool novelty, achieves on held-out series. Both results average three random seeds. A five-stage ablation on TSB-AD-M, supported by paired Wilcoxon signed-rank tests, shows statistically significant gains from each successive component.
Figures & tables
| Family | Best member | VUS-PR | Range | Period |
|---|---|---|---|---|
| Representation bank | VACE Cencillo et al. (2026) | 0.48 | 0.42–0.48 | 2026 |
| Forecasting (deep) | KAN-AD Zhou et al. (2025) | 0.41 | 0.31–0.41 | 2019–2025 |
| Reconstruction (deep) | xLSTMAD-R Faber et al. (2025) | 0.37 | 0.19–0.37 | 2019–2025 |
| Discord/matrix profile | MMPAD Yeh (2026) | 0.35 | — | 2026 |
| Statistical | PCA Shyu et al. (2003) | 0.31 | 0.20–0.31 | 2003–2012 |
| Transformer | TranAD Tuli et al. (2022) | 0.18 | 0.09–0.18 | 2022–2023 |
| Stage | Integrated Mechanism | Score | Reduction Condition |
|---|---|---|---|
| 1 | Masked-patch prediction local moments | Eq. ( 24 ) | — |
| 2 | Latent shape novelty | Eq. ( 28 ) | |
| 3 | Local-density calibration of novelty | Eq. ( 30 ) | |
| 4 | Local temporal contrast | Eq. ( 31 ) | |
| 5 | Per-channel novelty over criterion pool | Eq. ( 35 ) |
| Method | Family | Published | Measured (this work) | Source |
|---|---|---|---|---|
| Leap (this work) | Masked repr. | — | this work | |
| VACE † | Representation | 0.48 | — | Cencillo et al. (2026) |
| PaAno † | Representation | 0.43 | Park and Kang (2026) | |
| PaAno | Representation | 0.42 | — | Zhu et al. (2026) |
| PaAno PAI | Representation | — | Zhang et al. (2026) | |
| KAN-AD † | Forecasting | 0.41 | Zhou et al. (2025) |
| Metric | PaAno | PaAno PAI | USAD | xLSTMAD-R | TimesNet | Leap |
|---|---|---|---|---|---|---|
| AUC-ROC | ||||||
| AUC-PR | ||||||
| VUS-ROC | ||||||
| VUS-PR | ||||||
| Standard-F1 | ||||||
| PA-F1 |
| Coefficient | Grid tested | Points | Deployed value | VUS-PR (deployed) | Grid optimum |
|---|---|---|---|---|---|
| to | at ( ) | ||||
| to | at ( ) | ||||
| to | at ( ) | ||||
| to | at ( ) | ||||
| to | at ( ) |
| Method | Family | Published | Measured (this work) | Source |
|---|---|---|---|---|
| Leap (this work) | Masked repr. | — | this work | |
| PaAno PAI | Representation | 0.58 | Zhang et al. (2026) | |
| PaAno | Representation | 0.55 | — | Zhu et al. (2026) |
| TSPulse † | Foundation model | 0.54 | — | Ekambaram et al. (2026) |
| PaAno † | Representation | 0.51–0.53 | Park and Kang (2026) | |
| CrossAD † | Reconstruction | 0.45 | — | Li et al. (2025) |
| Metric | PaAno PAI | PaAno | PatchTST | Sub-PCA | USAD | Leap |
|---|---|---|---|---|---|---|
| AUC-ROC | ||||||
| AUC-PR | ||||||
| VUS-ROC | ||||||
| VUS-PR | ||||||
| Standard-F1 | ||||||
| PA-F1 |
| TSB-AD-M | TSB-AD-U | |||
|---|---|---|---|---|
| Method | Wall (s) | Infer (s) | Wall (s) | Infer (s) |
| PaAno | (13.7) | (2.83) | (8.05) | (0.42) |
| PaAno PAI | (13.1) | (0.89) | (10.4) | (0.20) |
| USAD | (13.6) | (3.81) | (3.45) | (0.83) |
| xLSTMAD-R | (966) | (66.3) | — | — |
| TimesNet | (25.6) | (5.23) | — | — |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Family | Score mechanism | Suited to | Regime |
|---|---|---|---|
| Statistical residual | residual of a fitted model (ARIMA, ETS, STL) | point, contextual | Semi/Un |
| Control charts, CPD | accumulated deviation of the mean | level shift, regime change | Semi/Un |
| Spectral | saliency of the amplitude spectrum | point, seasonal | Un |
| Discord/matrix profile | distance to nearest non-trivial match | subsequence, shape | Un |
| Normal-pattern banks | distance to a set of normal patterns | subsequence, shape | Semi |
| Forecasting (deep) | prediction residual | point, contextual | Semi |
| Symbol | Meaning |
|---|---|
| Data, windowing and encoder | |
| series length, number of channels | |
| length of the anomaly-free training prefix | |
| observation at time | |
| globally standardized observation | |
| estimated dominant period, periods spanned by a window | |
| TSB-AD-M (180 series) | TSB-AD-U (350 series) | ||
| Source | # | Source | # |
| SVDB | 28 | UCR | 70 |
| Exathlon | 25 | SMD | 33 |
| SMAP | 25 | Exathlon | 30 |
| GHL | 23 | YAHOO | 30 |
| SMD | 20 | OPPORTUNITY | 27 |
| Group | Symbol | Meaning | Value |
| Architecture | patch length | ||
| model width | |||
| attention heads | |||
| encoder blocks | |||
| feed-forward width | |||
| dropout | — |
| Stage | Model | VUS-PR | W/L/T | -value | |
|---|---|---|---|---|---|
| 1 | Masked-patch base | 0.4611 | — | — | — |
| 2 | Latent novelty ( ) | 0.4954 | 113/55/12 | ||
| 3 | Density calibration | 0.5034 | 84/42/54 | ||
| 4 | Local contrast | 0.5074 | 87/35/58 | ||
| 5 | Per-channel pool ( Leap ) | 0.5171 | 90/51/39 |
| Design Decision | Configuration Comparison | Metric | Performance |
|---|---|---|---|
| Event-scale smoothing (Eq. ( 21 )) | VUS-PR | ||
| Local-moment evidence (Eq. ( 23 )) | VUS-PR | ||
| Moment combination scheme | vs. rescaled sum | AP |
| Source | Leap | PaAno | PaAno PAI | USAD | xLSTMAD-R | TimesNet | |
|---|---|---|---|---|---|---|---|
| SVDB | 28 | 0.6411 | 0.5544 | 0.4583 | 0.4489 | 0.3462 | 0.4669 |
| Exathlon | 25 | 0.9907 | 0.7773 | 0.8705 | 0.9659 | 0.9454 | 0.8449 |
| SMAP | 25 | 0.5980 | 0.5316 | 0.3713 | 0.2657 | 0.2377 | 0.2922 |
| GHL | 23 | 0.1830 | 0.0085 | 0.0114 | 0.0130 | 0.0336 | 0.0078 |
| SMD | 20 | 0.3295 | 0.3319 | 0.3218 | 0.3959 | 0.3877 | 0.4714 |
| MSL | 14 | 0.3715 | 0.2108 | 0.3103 | 0.3058 | 0.3427 | 0.2556 |
| Source | Leap | PaAno | PaAno PAI | PatchTST | Sub-PCA | USAD | |
|---|---|---|---|---|---|---|---|
| UCR | 70 | 0.4593 | 0.3739 | 0.4017 | 0.2520 | 0.1237 | 0.1045 |
| SMD | 33 | 0.8270 | 0.5005 | 0.5327 | 0.8065 | 0.4416 | 0.5439 |
| Exathlon | 30 | 0.9626 | 0.8186 | 0.9285 | 0.8559 | 0.8920 | 0.9364 |
| YAHOO | 30 | 0.4170 | 0.6810 | 0.6968 | 0.2731 | 0.1547 | 0.1027 |
| OPPORTUNITY | 27 | 0.6304 | 0.2646 | 0.7673 | 0.0726 | 0.9139 | 0.7977 |
| NAB | 23 | 0.6446 | 0.4982 | 0.4355 | 0.4868 | 0.3947 | 0.4946 |
| Type | Leap | PaAno | PaAno PAI | USAD | xLSTMAD-R | TimesNet | |
|---|---|---|---|---|---|---|---|
| Level shift | 88 | 0.5662 | 0.4455 | 0.4531 | 0.5097 | 0.4875 | 0.4466 |
| Subsequence/shape | 34 | 0.5265 | 0.4890 | 0.3730 | 0.3197 | 0.2574 | 0.3563 |
| Relational | 16 | 0.3547 | 0.1781 | 0.1707 | 0.1419 | 0.2146 | 0.1476 |
| Dispersion change | 16 | 0.3426 | 0.2675 | 0.2225 | 0.1561 | 0.1619 | 0.1593 |
| Mixed | 14 | 0.4573 | 0.3277 | 0.3261 | 0.2746 | 0.2845 | 0.3512 |
| Point (global) | 8 | 0.5828 | 0.5217 | 0.7148 | 0.6043 | 0.6079 | 0.6315 |
| Type | Leap | PaAno | PaAno PAI | PatchTST | Sub-PCA | USAD | |
|---|---|---|---|---|---|---|---|
| Level shift | 115 | 0.8072 | 0.5183 | 0.7578 | 0.5954 | 0.7053 | 0.6768 |
| Subsequence/shape | 101 | 0.5255 | 0.4934 | 0.4102 | 0.4250 | 0.2243 | 0.2311 |
| Dispersion change | 68 | 0.5494 | 0.5102 | 0.5108 | 0.3323 | 0.3114 | 0.3109 |
| Mixed | 22 | 0.5895 | 0.4862 | 0.5796 | 0.4912 | 0.4823 | 0.4132 |
| Point (global) | 29 | 0.4455 | 0.6773 | 0.7188 | 0.3593 | 0.2403 | 0.1619 |
| Point (contextual) | 15 | 0.5083 | 0.4213 | 0.4965 | 0.3140 | 0.2347 | 0.1652 |
| Leap | PaAno | PaAno PAI | USAD | xLSTMAD-R | TimesNet | ||
| By number of channels | |||||||
| 2–10 | 58 | 0.6089 | 0.5505 | 0.5089 | 0.4524 | 0.4028 | 0.4587 |
| 11–30 | 72 | 0.5182 | 0.3660 | 0.3356 | 0.3291 | 0.3333 | 0.3185 |
| 31–248 | 50 | 0.4121 | 0.3322 | 0.3827 | 0.4514 | 0.4499 | 0.4037 |
| By series length (samples) | |||||||
| 53 | 0.5424 | 0.4601 | 0.4517 | 0.3867 | 0.3812 | 0.3720 | |
| Leap | PaAno | PaAno PAI | PatchTST | Sub-PCA | USAD | ||
| By series length (samples) | |||||||
| 88 | 0.5785 | 0.5866 | 0.6334 | 0.4839 | 0.3915 | 0.3733 | |
| – | 87 | 0.6215 | 0.4511 | 0.6430 | 0.3175 | 0.3946 | 0.3296 |
| – | 96 | 0.7434 | 0.5540 | 0.6254 | 0.6177 | 0.5124 | 0.5459 |
| 79 | 0.5119 | 0.4651 | 0.4130 | 0.3849 | 0.3553 | 0.3118 | |
| By anomaly ratio | |||||||
| Component | Rule | VUS-PR | Range of | -value | W/L/T | |
|---|---|---|---|---|---|---|
| level_combine | add (deployed) | n/a | n/a | n/a | n/a | |
| pmean | ||||||
| max | ||||||
| gate | ||||||
| chan_agg | softmax (deployed) | n/a | n/a | n/a | n/a | |
| max |
| Constant | Grid tested | Selected | Best alternative ( ) | -value | W/L/T |
|---|---|---|---|---|---|
| (patch length) | : | ||||
| (depth) | : | ||||
| (width) | : | ||||
| (masking groups) | : | ||||
| (mask block) | : |
Time-Series Anomaly Detection
Time-Series Anomaly Detection identifies unusual patterns or events in sequential data, from sensor readings and network traffic to health and industrial telemetry.
See all 208 papers