COMET: Codebook-based Online-adaptive Multi-scale Embedding for Time-series Anomaly Detection
Jinwoo Park, Hyeongwon Kang, Seung Hun Han, Pilsung Kang
NeurIPS 2026
TL;DR. COMET is a unified framework for unsupervised time-series anomaly detection that learns multi-scale patch embeddings, distills them into a codebook of normal prototypes, and adapts the codebook online, achieving best performance on 39 of 45 metrics.
Abstract. Multivariate time-series anomaly detection aims to identify abnormal temporal patterns in complex real-world systems. However, robust unsupervised time-series anomaly detection remains challenging because anomalies can manifest over different temporal ranges and emerge from interactions among variables, while distribution shifts can cause normal patterns to drift over time. To address these challenges, we propose Codebook-based Online-adaptive Multi-scale Embedding for Time-series anomaly detection (COMET), a unified framework with three tightly coupled components. First, Multi-scale Patch Encoder learns correlation-aware patch embeddings by combining variable-specific temporal dynamics with shared inter-variable structure across multiple patch scales. Second, Vector-Quantized Coreset quantizes these embeddings into representative normal prototypes, which are used to detect anomalies through a dual score combining quantization error and density-aware memory distance. Third, Online Codebook Adaptation leverages the same codebook structure to identify reliable normal samples from training-activated codebook entries, and then updates the prototypes through contrastive learning at inference time. Experiments on five benchmark datasets demonstrate that COMET achieves the best performance on 39 out of 45 evaluation metrics compared to seven baselines, showing robust performance across diverse evaluation protocols.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:47 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
This paper proposes COMET, an unsupervised time-series anomaly detection framework combining multi-scale patch encoding, a vector-quantized codebook of normal prototypes, dual anomaly scoring, and online codebook adaptation. The reviewers find the overall framework technically coherent, the prototype-based formulation intuitive, and the evaluation across multiple datasets and metrics relatively comprehensive. The reported results are consistently strong, and the ablation studies generally support the main design choices.
The paper currently needs clarification on the following prioritized issues:
Please clarify the technical novelty and the specific contribution of the vector-quantized codebook. As raised by Reviewers c7xX, 1YpP, and QjUE, most individual components have close precedents, and it remains unclear how much of the improvement comes from the codebook rather than multi-scale patching, representation learning, density-aware scoring, or their combination. A matched comparison using the same encoder without vector quantization would be especially helpful.
Please address the robustness of the empirical evaluation and online adaptation. Reviewer QjUE notes that the “best on 39/45 metrics” claim aggregates correlated metrics, while the main results use a single seed and best-F1 threshold selection. The rebuttal should also clarify when test-time adaptation helps, how contaminated pseudo-normal samples are controlled, and whether the codebook remains stable over long streams. Existing fixed-threshold, multi-seed, or contamination results would strengthen the paper.
Strong responses would further improve the paper, although I view these concerns mainly as limitations in analysis and positioning rather than fundamental flaws. Overall, the framework is technically sound and the empirical evidence is sufficiently strong to support acceptance as a poster.
Final justification
I recommend Accept (poster). The paper presents a coherent codebook-based framework with strong and relatively comprehensive empirical results across datasets and evaluation metrics. The rebuttal substantially addressed the main concerns regarding the specific contribution of the VQ codebook, sensitivity, threshold selection, and empirical robustness through additional matched comparisons and analyses. While the individual components have prior precedents and some limitations remain, I view these primarily as issues of positioning and analysis rather than fundamental flaws, and the overall technical and empirical contribution is sufficient for acceptance.
Read meta-review
Meta-review
This paper proposes COMET, an unsupervised time-series anomaly detection framework combining multi-scale patch encoding, a vector-quantized codebook of normal prototypes, dual anomaly scoring, and online codebook adaptation. The reviewers find the overall framework technically coherent, the prototype-based formulation intuitive, and the evaluation across multiple datasets and metrics relatively comprehensive. The reported results are consistently strong, and the ablation studies generally support the main design choices.
The paper currently needs clarification on the following prioritized issues:
Please clarify the technical novelty and the specific contribution of the vector-quantized codebook. As raised by Reviewers c7xX, 1YpP, and QjUE, most individual components have close precedents, and it remains unclear how much of the improvement comes from the codebook rather than multi-scale patching, representation learning, density-aware scoring, or their combination. A matched comparison using the same encoder without vector quantization would be especially helpful.
Please address the robustness of the empirical evaluation and online adaptation. Reviewer QjUE notes that the “best on 39/45 metrics” claim aggregates correlated metrics, while the main results use a single seed and best-F1 threshold selection. The rebuttal should also clarify when test-time adaptation helps, how contaminated pseudo-normal samples are controlled, and whether the codebook remains stable over long streams. Existing fixed-threshold, multi-seed, or contamination results would strengthen the paper.
Strong responses would further improve the paper, although I view these concerns mainly as limitations in analysis and positioning rather than fundamental flaws. Overall, the framework is technically sound and the empirical evidence is sufficiently strong to support acceptance as a poster.
Final justification
I recommend Accept (poster). The paper presents a coherent codebook-based framework with strong and relatively comprehensive empirical results across datasets and evaluation metrics. The rebuttal substantially addressed the main concerns regarding the specific contribution of the VQ codebook, sensitivity, threshold selection, and empirical robustness through additional matched comparisons and analyses. While the individual components have prior precedents and some limitations remain, I view these primarily as issues of positioning and analysis rather than fundamental flaws, and the overall technical and empirical contribution is sufficient for acceptance.
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
COMET is an unsupervised multivariate time-series anomaly detection framework built around three components. First, a Multi-scale Patch Encoder extracts patch embeddings at multiple temporal scales, combining variable-wise encoders for individual temporal dynamics with a shared core encoder for inter-variable structure. Second, a Vector-Quantized Coreset maps these embeddings to learned codebook prototypes representing normal patterns. Anomaly scores combine quantization error with a density-aware memory distance to the learned normal prototypes. Third, Online Codebook Adaptation updates the codebook at inference time by using training-activated codebook entries to identify reliable normal samples and applying contrastive adaptation.
The paper evaluates COMET on five standard TSAD benchmarks: PSM, SWaT, SMAP, MSL, and WADI. It compares against seven baselines and reports point-wise metrics, point-adjusted F1, threshold-free AUC-style metrics, and range-based metrics including Affiliation-F1, R-AUC, and VUS. The main empirical claim is that COMET without test-time adaptation obtains the best performance on 39 out of 45 metrics, while the TTA version improves many metrics further. The paper also includes component ablations, efficiency analysis, UMAP visualizations, and hyperparameter sensitivity studies.
Strengths and weaknesses
Strengths
The paper has several strengths. The method is motivated by real challenges in multivariate time-series anomaly detection: anomalies may occur over different temporal ranges, may arise from inter-variable interactions, and may be affected by non-stationarity at test time. The three main modules of COMET are each tied to one of these challenges. Multi-scale patching addresses temporal granularity, the variable-wise/shared encoder design addresses both per-variable dynamics and cross-variable correlation, the VQ coreset provides a compact memory of normal prototypes, and online adaptation targets distribution shift.
The codebook/prototype formulation is a natural fit for unsupervised anomaly detection. It gives a concrete representation of normal patterns and supports an interpretable distance-based anomaly score. The dual scoring scheme, combining quantization error and density-aware memory distance, is also sensible: quantization error captures mismatch to learned prototypes, while local scaling helps account for non-uniform prototype density. The activation-based TTA mechanism is a useful idea because it avoids directly filtering test samples by an anomaly-score threshold before adaptation.
The empirical evaluation is broad by the standards of the TSAD literature. The paper reports results on five common benchmarks and, importantly, does not rely only on point-adjusted F1. Including unadjusted point-wise metrics and range-based metrics such as Affiliation-F1, R-AUC, and VUS is a methodological strength, since point-adjusted F1 can substantially overstate performance in anomaly detection. The ablation study is also helpful: removing multi-scale encoding, quantization score, memory score, local scaling, variable selection, normalization, TTA, and contrastive learning each gives information about the role of individual components. The efficiency analysis is another positive point; COMET appears parameter-efficient relative to larger transformer-style baselines.
Weaknesses
The main weakness is that the empirical setting is fragile. PSM, SWaT, SMAP, MSL, and WADI are standard TSAD benchmarks, but the broader TSAD benchmark/evaluation ecosystem is known to be problematic. Wu and Keogh argue that many widely used time-series anomaly detection benchmarks contain artifacts that can create an illusion of progress [1]. More recent evaluation work also shows that point-adjusted/event-level scoring can substantially distort measured detector quality, making some detectors look strong even when localization quality is poor [2]. Thus, while COMET’s reported performance is strong, the main “39/45 metrics” result should be interpreted with caution because it is tied to this benchmark family and to many correlated metrics.
To the authors’ credit, the paper does more than many TSAD papers by reporting range-based and threshold-free metrics such as Affiliation-F1, R-AUC, VUS, AUC-ROC, and AUC-PR, rather than relying only on point-adjusted F1. This partially addresses the concern. Still, results on a cleaner recent benchmark, a controlled synthetic benchmark with known point/contextual/collective anomaly types, or a fixed-threshold deployment-style protocol would make the empirical claim substantially stronger.
Other weaknesses include:
-
Gains on some metrics/datasets are modest or mixed. On several individual cells in Table 1 the margin over the second-best is small, and "best on 39/45" aggregates across metrics that are correlated. A statistical-significance treatment (variance across seeds, paired tests) is not evident in the main text and would help (importance emphasized as a stand-alone line-item below).
-
Protocol Sensistivity. For thresholded metrics, the paper uses best-F1 threshold search. This is common in the literature, but it is not deployment-realistic if the threshold is selected using labeled test anomalies. Since COMET is positioned as unsupervised and online-adaptive, it would be important to know how performance changes under a fixed validation threshold, a contamination-controlled calibration set, or threshold-free evaluation only.
-
TTA contribution. The TTA contribution is less convincing than the static COMET pipeline. The paper reports that COMET without TTA is best on 39/45 metrics, while the TTA version improves 35/45 metrics. In the averaged ablation, removing TTA changes several metrics only modestly, and disabling contrastive learning has small effects. This suggests that most of the gain may come from the representation and scoring pipeline rather than online adaptation. The authors should more clearly characterize when TTA helps, when it hurts, and whether online adaptation can accumulate contamination over time.
-
Statistical robustness. The paper uses a single random seed and does not report confidence intervals or significance tests for the main results. Given the sensitivity of anomaly detection benchmarks to preprocessing, thresholding, and implementation details, multi-seed variation and paired comparisons would make the empirical claims more reliable.
Ref:
-
Wu, R., & Keogh, E. J. (2023). Current time series anomaly detection benchmarks are flawed and are creating the illusion of progress. IEEE Transactions on Knowledge and Data Engineering, 35(3), 2421–2429. https://doi.org/10.1109/TKDE.2021.3112126
-
Huet, A., Navarro, J. M., & Rossi, D. (2022). Local evaluation of time series anomaly detection algorithms. arXiv preprint arXiv:2206.13167.
Questions
-
For thresholded metrics, are best-F1 thresholds selected using labeled test anomalies? If so, can you report deployment-realistic results using a validation/calibration threshold, or emphasize threshold-free metrics as the primary comparison?
-
How much of the 39/45 result depends on per-dataset tuning of codebook size, model dimension, patch scales, local-neighbor count, EMA momentum, and score mixing weight? Can you report performance under a single fixed configuration across all datasets?
-
The TTA variant is a core contribution, but COMET without TTA is reported as best on 39/45 metrics, while TTA improves 35/45 metrics. Can you clarify when TTA helps versus hurts, and whether adaptation can degrade over long streams due to contaminated pseudo-normal updates?
-
How robust is COMET when the training set contains anomalous contamination, e.g. 1%, 5%, or 10% anomalies? This directly tests the assumption that training-activated codebook entries are reliable normal prototypes.
-
Can you report multiple-seed means/standard deviations or paired significance tests for the main metrics? This would help establish whether the margins over the strongest baselines are statistically meaningful.
Limitations
The authors acknowledge two important limitations: codebook size is tuned empirically per dataset, and heavy training contamination may weaken pseudo-labeling because COMET assumes predominantly normal training data. These are relevant and appreciated.
However, I think several additional limitations should be discussed. First, the evaluation relies entirely on standard TSAD benchmarks whose validity is contested; the main result should be interpreted with that caveat. Second, the method has a large hyperparameter surface, and practical performance may depend on per-dataset tuning. Third, thresholded metrics use best-F1 threshold search, which may overstate deployable unsupervised performance if test labels are involved. Fourth, the statistical robustness of the results is limited by single-seed reporting. Finally, online adaptation may be vulnerable to gradual contamination or novel normal regimes, and the paper should discuss how such failures would be detected or mitigated in deployment.
No major societal risks are specific to this work beyond the usual operational risks of anomaly detection systems, namely false alarms, missed anomalies, and overconfidence in automated monitoring.
Final justification
I thank the authors for their detailed responses and promised edits to the final manuscript. I maintain my positive score of 5 (Accept).
Formatting concerns
N/A
3 comments
Re: Rebuttal by Authors
Thank you for the detailed and constructive rebuttal. I have read it carefully.
The new experiments address the main empirical concerns I raised. The q99 result provides a deployment-realistic threshold check; the single fixed configuration across all five datasets reduces the concern that the headline result is driven primarily by per-dataset tuning; the WADI/SMAP shift analysis and the long-stream CATSv2 check clarify when adaptation has room to help and provide evidence against codebook drift or collapse; and the contamination, multi-seed, and curated TSB-AD-M results materially strengthen the robustness case. I also appreciate the clarification that "39/45" reflects broad performance across correlated metrics rather than 39 independent wins, and that VUS-PR will be treated as the primary comparison.
The response also supports a more precise characterization of TTA: it helps where train-test shift is appreciable and is close to neutral where it is not, and the VUS-PR comparison between TTA and the static model is indeed not significant. I recommend presenting TTA as a conditional component rather than a uniformly beneficial one, and treating the two-dataset shift analysis as suggestive rather than as establishing a general relationship between the shift proxies and TTA benefit.
Some limitations remain worth stating in the paper. The oracle-versus-fixed threshold comparison is shown on a single dataset, the multi-seed analysis covers three datasets and three seeds, and the long-stream stability check is one stream. In addition, treating dataset-seed pairs as independent units in the Wilcoxon test likely overstates the effective sample size, since seeds within a dataset are not independent datasets. These points temper the breadth of the statistical claim, but they do not undermine the central empirical result.
Overall the rebuttal substantially addresses my concerns and I am maintaining my positive assessment. Please include the new robustness results, the narrower TTA claim, and the benchmark/protocol limitations in the final version.
We thank the reviewer for reading our rebuttal carefully and for maintaining a positive assessment. The guidance on TTA was particularly helpful. We agree that it should be presented as a conditional component that is effective under specific conditions, rather than as a uniformly beneficial one. We also think the reviewer's suggestion to read the two-dataset shift analysis as indicating a possible relationship, rather than establishing a general one, is reasonable and well-founded, and we will follow it. The point about tempering our statistical claims is well taken. We are currently running additional experiments along these lines and will reflect them in the camera-ready version. Our plan is below.
R1. Incorporating the new robustness results.
The robustness experiments reported in the rebuttal will be moved into the main paper rather than left as rebuttal-only evidence.
- Training-contamination robustness (0-25%) will be added as a dedicated robustness study, showing that training-activated prototypes stay reliable under realistic contamination. We will note that this is robustness, not immunity.
- Multi-seed mean std will replace the single-seed numbers in the main comparison, so the headline results carry variance information.
- Wilcoxon significance tests will accompany the multi-seed tables, with the caveat in R3.
- CATSv2 long-stream stability (codebook drift, assignment flip rate) will be added to show that online updates track benign drift rather than collapsing.
- Curated TSB-AD-M results (Exathlon, MITDB) will be added to show that COMET's advantage carries over to a cleaner benchmark, though not uniformly.
R2. Reframing TTA as a conditional component.
We agree TTA should not be presented as uniformly beneficial, and will revise the manuscript so that it is described as a conditional mechanism whose benefit scales with the degree of test-time distribution shift.
- Claim edits. In the abstract, introduction, and TTA sections, we will rewrite statements that imply general improvement from TTA, and instead state that it helps under appreciable train-test shift and is close to neutral otherwise.
- Analysis framing. Since the shift-proxy analysis (JS distance, negative log training frequency vs. TTA gain) rests on a limited number of datasets, we will present it as suggestive rather than as establishing a general relationship, and will say so where the analysis appears.
R3. Strengthening and stating benchmark, protocol, and statistical limitations.
Beyond the results above, we are running additional experiments to broaden the scope of these caveats, and will state the resulting limitations so the paper's claims are appropriately bounded.
| Limitation | Ongoing work and how we will state it |
|---|---|
| Benchmark validity | Note that the standard TSAD benchmarks are contested, and that TSB-AD-M is included partly to address this. |
| Threshold protocol | We are extending the fixed-threshold check beyond a single dataset across several thresholding schemes (q99, q95, q97.5, POT). We will clarify that best-F1 is an oracle upper bound and report the broadened results. |
| Multi-seed scope | We are expanding the variance and significance analysis to all five datasets and increasing the number of seeds to five, and will state the coverage we reach. |
| Long-stream scope | We are adding long-stream evaluations beyond the single CATSv2 stream, and will state the scope of the stability check. |
| Wilcoxon test | We will temper the statistical claim. Treating dataset-seed pairs as independent units likely overstates the effective sample size, since seeds within a dataset are not independent datasets, and we are revising the analysis accordingly. |
R4. Retaining the clarifications the reviewer accepted.
Finally, we will keep the two framing clarifications from the rebuttal in the paper: (i) that "best on 39/45" reflects broad, consistent improvement across correlated metrics rather than 39 independent wins, and (ii) that VUS-PR is treated as the primary comparison metric, following the TSB-AD study.
We appreciate the reviewer's careful and constructive engagement throughout this process. The feedback helped us scope the paper's claims more precisely and improved both its empirical grounding and its clarity, and we will make sure this is reflected in the camera-ready version.
- Rating
- 3/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 2/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This work addresses a central challenge of unsupervised multivariate time-series anomaly detection under three difficult conditions: anomalies can occur over different temporal scales, anomalies can arise from interactions among variables rather than from a single corrupted channel, and normal behavior can drift over time due to distribution shift. The paper proposes COMET, a codebook-based framework that learns compact prototypes of normal multivariate time-series behavior and uses these prototypes for anomaly scoring and online adaptation.
At a high level, COMET has three main components:
Multi-scale Patch Encoder -- The model divides the time series into patches of different lengths, so it can capture both short-term and longer-term temporal patterns. It also uses variable-wise encoders together with a shared core encoder, so the representation can capture both individual variable behavior and inter-variable correlations.
Vector-Quantized Coreset -- The learned embeddings are mapped to a finite set of codebook vectors. These codebook entries act like prototypes of normal behavior. During inference, if a test patch is far from these learned normal prototypes, or if it is poorly quantized by the codebook, it receives a high anomaly score.
Online Codebook Adaptation -- To handle test-time distribution shift, COMET updates the codebook during inference. Instead of using a hand-tuned anomaly-score threshold to decide which test samples are normal, it uses whether a test sample activates a codebook entry that was already activated during training. These selected pseudo-normal samples are then used for contrastive adaptation.
Strengths and weaknesses
Strengths:
-
The paper is motivated by real weaknesses in existing time-series anomaly detection methods. Many existing methods compute anomaly scores at the timestep level, which can miss contextual or collective anomalies. COMET instead works at the patch level, which is a more natural choice for anomalies that only become visible over a temporal window.
-
The multi-scale patch encoder is one of the stronger parts of the method. Short patches can capture local abrupt deviations, while longer patches can capture broader contextual or collective abnormal patterns. The authors also combine variable-wise encoders with a shared core encoder. This is useful because multivariate time series contain both variable-specific dynamics and cross-variable dependencies.
-
The dual-score design is reasonable. Some anomalies may still be close to a normal prototype but poorly quantized, while others may be clearly far from the memory bank. The ablation study supports that removing either score reduces performance.
-
Experimentation uses multiple evaluation metrics.
Weaknesses:
-
The method is somewhat complex - the full system has many moving parts: multi-scale patching, variable-wise encoders, core encoder, feature fusion, vector quantization, codebook loss, commitment loss , reconstruction loss, local scaling distance, EMA normalization online pseudo-labeling, contrastive adaptation etc. This raises a concern - how much of the performance comes from the central codebook idea versus accumulated engineering choices?
-
The core ingredients are not entirely new individually. Patch-based time-series encoders, vector quantization, memory-bank anomaly detection, local-density distance normalization, and test-time adaptation all exist in related forms.
Questions
-
How sensitive is performance to the patch size and strides?
-
How is λ selected for combining memory and quantization scores?
-
Sensitivity to codebook size should be studied more thoroughly.
-
Adjusting patch size and strides when employed with contrastive learning can itself preserve long, short context information in time-series and hence can detect anomalies. How useful is the codebook addition - some baseline experiments are required to justify it.
Limitations
See weaknesses and questions
Formatting concerns
NA
1 comment
Rebuttal
We sincerely thank the reviewer for the thoughtful and constructive assessment, and especially for identifying that COMET's current presentation may obscure which components are essential and how sensitive the method is to its key design choices. This has helped us clarify the necessity of the core structure more explicitly. We address each point below.
W1. Complexity and many moving parts.
We agree that the current manuscript may make COMET appear more complex than intended. We would like to clarify, however, that the components are not independent engineering tricks but form a single tightly coupled pipeline: Represent → Memorize → Adapt. Beyond serving their individual purposes, the components are organically integrated, with each stage directly enabling the next.
Represent. The multi-scale patch encoder represents time-series windows at multiple temporal granularities, using variable-wise encoders together with a shared core encoder to capture both variable-specific dynamics and cross-variable structure.
Memorize. The VQ codebook memorizes compact prototypes of normal patch-level behavior during training, and anomaly scores are defined from this memory as a quantization residual and a density-aware memory distance.
Adapt. Online adaptation uses the same codebook-activation structure to select reliable pseudo-normal samples without a score threshold, and updates the prototypes under test-time distribution shift.
Crucially, these stages are not merely sequential but mutually enabling:
Represent → Memorize. Richer, multi-granularity representations let the codebook encode a more diverse and comprehensive set of normal prototypes; the quality of the memory is bounded by the quality of the representation.
Memorize → Adapt. Threshold-free pseudo-normal selection is possible only because the codebook has already encoded normal behavior in a discrete, indexable form. Without this, adaptation would fall back on the threshold-dependent filtering that prior TTA methods rely on.
Each component is thus tied to one specific purpose while also feeding the next stage:
| Component | Purpose |
|---|---|
| Multi-scale patching | Capture short-, mid-, and long-range temporal contexts |
| Variable-wise + core encoder | Model variable-specific dynamics and cross-variable structure |
| VQ codebook | Learn compact normal prototypes during training |
| Memory + quantization scores | Measure density within normal support and residual from prototypes |
| Codebook-based pseudo-labeling | Select pseudo-normal samples without score thresholds |
| Contrastive adaptation | Update prototypes under test-time shift |
Our intended contribution is therefore not that each module is new in isolation, but that we reformulate these elements for the time-series anomaly detection task, with the codebook providing a unified representation, scoring, and adaptation mechanism.
W2. Novelty of the individual components.
We appreciate this point. Patch encoders, VQ, memory banks, local scaling, and test-time adaptation all have precedents; our novelty lies in how the codebook is used as the central object connecting them. In COMET, the VQ codebook is not only a compression layer: it stores learned normal prototypes, defines anomaly scores through quantization residuals and memory distances, and enables threshold-free pseudo-normal selection. To make this explicit, we contrast COMET with post-hoc memory-bank alternatives that keep the same patch representation but replace the learned codebook:
- KMeans: after materializing all training-patch embeddings, run K-means and use the centroids as memory vectors.
- Greedy sampling: after materializing all training-patch embeddings, greedily select representative embeddings that cover the embedding space, and use them as memory vectors.
- Both materialize the full embedding set after training and then build the memory as a post-processing step, which is the key difference from COMET.
- COMET instead learns the codebook to act as the memory during training, without any separate post-hoc clustering or sampling.
Table W2. PSM ablation: learned VQ memory vs. post-hoc memories. Seed 42, oracle-test best-F1 threshold. All post-hoc memories are configured to have the same memory size as COMET.
| Method | F1@0 | F1@100 | Aff-F1 | VUS-PR | Mat. emb. | Emb. bank | Build |
|---|---|---|---|---|---|---|---|
| COMET-VQ | 0.947 | 0.518 | 0.719 | 0.487 | 0 | 0 GB | 0.096 min |
| NoVQ-KMeans | 0.876 | 0.492 | 0.737 | 0.460 | 9.39M | 9.62 GB | 240.5 min |
| NoVQ-Greedy | 0.945 | 0.457 | 0.725 | 0.473 | 9.39M | 9.62 GB | 6.15 min |
| Contrastive-KMeans | 0.876 | 0.498 | 0.743 | 0.476 | 9.39M | 9.62 GB | 218.1 min |
| Contrastive-Greedy | 0.938 | 0.460 | 0.734 | 0.486 | 9.39M | 9.62 GB | 7.33 min |
| VQEnc-KMeans | 0.875 | 0.491 | 0.729 | 0.456 | 9.39M | 9.62 GB | 415.9 min |
Patch and contrastive representations are useful, but without the learned VQ codebook they require materializing millions of embeddings and building a separate memory bank. COMET internalizes this compression into training, achieving comparable detection quality at a fraction of the memory and time cost.
Q1. Sensitivity to patch size and stride.
This analysis is in the appendix (C.3.1, Table 13) due to page limits; we summarize representative PSM results here.
Table Q1. Patch/stride sensitivity on PSM (Appendix C.3.1, values in %).
| Patch / stride | F1@0 | F1@100 | Aff-F1 | AUC-ROC | VUS-PR |
|---|---|---|---|---|---|
| 2 / 1 | 93.08 | 58.11 | 71.18 | 77.92 | 59.20 |
| 4 / 2 | 92.06 | 57.90 | 70.98 | 76.78 | 55.47 |
| 6 / 3 | 87.60 | 46.49 | 71.33 | 67.04 | 45.83 |
| 2,4 / 1,2 | 82.58 | 45.25 | 71.48 | 67.02 | 46.32 |
| 4,6 / 2,3 | 91.80 | 44.62 | 71.28 | 68.43 | 50.05 |
| 2,4,6 / 1,2,3 | 95.37 | 60.13 | 71.80 | 79.15 | 60.42 |
| 2,4,6,8 / 1,2,3,4 | 93.99 | 36.95 | 70.39 | 59.76 | 39.29 |
The benefit does not come from using multiple scales per se: some two-scale settings underperform even the finest single scale, and an overly coarse scale (8) degrades performance sharply. Performance is best when complementary fine-, medium-, and coarse-grained patches are combined, as in our default 2,4,6 / 1,2,3.
Q2. Selection of λ for combining memory and quantization scores.
We clarify that λ is the score-mixing weight between the memory and quantization scores, not the EMA momentum. We use λ = 0.5, giving equal weight to the density-based memory distance and the quantization residual, since anomalies may arise either from low-density regions of the normal support or from large residuals away from the prototype manifold. We sweep λ under the same protocol as Table W2.
Table Q2. λ sensitivity on PSM (seed 42, oracle-test best-F1 threshold).
| λ | F1@0 | F1@100 | Aff-F1 | AUROC | AUPR | R-AUPR | VUS-PR |
|---|---|---|---|---|---|---|---|
| 0 | 0.950 | 0.497 | 0.717 | 0.677 | 0.447 | 0.503 | 0.497 |
| 0.25 | 0.945 | 0.504 | 0.731 | 0.696 | 0.473 | 0.527 | 0.519 |
| 0.5 | 0.944 | 0.515 | 0.732 | 0.705 | 0.491 | 0.534 | 0.526 |
| 0.75 | 0.938 | 0.504 | 0.719 | 0.706 | 0.499 | 0.525 | 0.517 |
| 1.0 | 0.934 | 0.490 | 0.721 | 0.695 | 0.493 | 0.502 | 0.496 |
Performance is stable across the mid-range, with λ in [0.25, 0.75] consistently outperforming the single-score extremes (λ = 0 or 1). λ = 0.5 gives the best balance and is used across all datasets without per-dataset tuning, and the drop at both extremes confirms that combining the two scores is more robust than relying on either alone.
Q3. Sensitivity to codebook size.
Similarly, a detailed study is in the appendix (C.3.2, Table 14); we summarize representative PSM results here.
Table Q3. Codebook size sensitivity on PSM (Appendix C.3.2, values in %).
| Codebook size | F1@0 | F1@100 | Aff-F1 | AUC-ROC | VUS-PR |
|---|---|---|---|---|---|
| 16 | 90.67 | 53.31 | 71.05 | 74.38 | 53.01 |
| 32 | 90.22 | 47.72 | 71.73 | 71.86 | 50.46 |
| 64 | 95.12 | 34.03 | 71.01 | 58.46 | 38.80 |
| 128 | 95.37 | 60.13 | 71.80 | 79.15 | 60.42 |
| 256 | 94.85 | 55.69 | 73.54 | 75.43 | 56.03 |
Performance is non-monotonic: 128 is clearly best, while smaller and larger sizes underperform — too few prototypes cannot cover normal diversity, too many dilute each prototype's support. The codebook size should thus match dataset complexity rather than be enlarged, analogous to the memory size in memory-bank methods; we adopt 128 as a robust default.
Q4. Is the codebook useful beyond patch + contrastive learning?
We answer this directly with the matched No-VQ baselines in Table W2. For the contrastive variants, contrastive learning is applied during training (not as test-time adaptation): with the same reconstruction loss plus a symmetric InfoNCE loss over two augmented views (label-free amplitude scaling, Gaussian jitter, sparse masking), using in-batch normal patches as instance-level negatives. These baselines thus test whether patch + contrastive representation alone suffices without a learned codebook.
As shown in Table W2, COMET-VQ attains competitive-or-better detection than the contrastive post-hoc baselines, and the gap is larger in efficiency: because the codebook is learned jointly with the representation, the compact normal-prototype memory emerges as a by-product of training, rather than requiring the full embedding bank to be materialized and then compressed in a separate post-hoc step. The codebook is therefore not merely an extra module, but a mechanism that provides strong detection while making the memory step far cheaper in both storage and time.
We thank the reviewer for these comments, which identify exactly where our presentation should be strengthened, and we hope the clarifications and additional experiments above address the remaining concerns.
- Rating
- 5/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 4/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper considers time-series anomaly detection. Their proposed framework, Comet, consists of 3 components:
- Multi-scale Patch Encoder: extracts patches at different scales by applying different patch sizes and strides. Apply a different encoder to each dimension of a multivariate series, and then perform feature fusion
- Vector-Quantized Coreset: Takes the embeddings obtained previously and performs vector quantization. The codebook embedding are trained via a combination of 3 objectives: codebook loss (proximity of codes to examples, stopping gradient on the examples), comittment loss (swapping the stop gradient), and reconstruction loss (between quantized codes and original patches).
The anomaly score is an interpolation of the memory score (distance of quantized code for inference data to saved codes occurring during training) and quantization score (measuring how much the encoder output is close to matching codebook entries on inference data). These are essentially two measures of how the inference data deviates from expected distributions.
Strengths and weaknesses
Strengths:
- The paper, while suffering a bit from an overabundance of indices, is still easy to follow and well-written.
- Results appear quite strong: Comet often beats the baselines for many different metrics, commonly with a large gap (table 1). Additionally, there are quite a few metrics considered, strengthening the case.
- Ablation study makes a clear case for the approach working as intended.
Weaknesses:
- It can be argued that this work is a bit incremental: each individual component has been explored in prior work extensively. This is not a major flaw in my opinion.
Questions
- Concerning the first component in the scoring metric, can the authors comment on why codebook activation frequencies are a good indicator of an example being normal (not an outlier), from a theoretical standpoint?
Limitations
yes
Final justification
The authors have responded in detail to my questions/comments. While there are still issues, I consider that this paper should be accepted. I am raising my score to accept.
Formatting concerns
N/A
1 comment
Rebuttal
We sincerely thank the reviewer for the careful reading and encouraging assessment; the reviewer's comments have helped us build the theoretical foundation of this work more solidly. We address the theoretical question on the memory score and the point on the incremental nature of the components below.
Q1. Why codeword activation provides information about normality.
The reviewer's question made us realize the manuscript could read as treating codeword activation as a sufficient condition for normality. Our view on this point has three steps: the first two establish why activation frequency carries information about normality (the reviewer's question), and the third clarifies that our method uses only the weakest form of this signal — binary membership — as a support-coverage rule.
1. VQ induces a finite partition of the representation space. VQ-VAE assigns each encoder representation to its nearest codeword among a finite codebook (van den Oord et al., 2017). Because every point in the representation space is mapped to exactly one of the K codewords by this nearest-neighbor rule, the space is carved into K disjoint regions that together cover it — a Voronoi partition, where each cell is the set of representations closer to codeword than to any other:
Each cell is therefore centered on one prototype (its codeword), and quantization replaces by the prototype of the cell it lands in. A codeword index is thus not a mere identifier but a coordinate that indicates which prototype-centered region a representation occupies; representations sharing an index are quantized to the same normal prototype and, in this sense, treated as the same normal pattern.
2. Activation frequency estimates normal probability mass. Under a frozen encoder and codebook, normal codeword assignments form a categorical distribution over the codebook. The normal probability mass of cell k and its empirical frequency are
A frequently activated codeword thus corresponds to a region of larger normal probability mass; that such frequencies concentrate around the true probabilities is consistent with Mardia et al. (2020). Similarly, Kim and Park (2021) use inverse VQ-selection frequency as an image anomaly signal — a precedent for frequency as a heuristic score, though without a guarantee that frequency certifies normality.
To check this, we group test points by the training-activation frequency of their assigned codeword and measure the actual fraction of normal points in each group; a positive trend means codewords used more often on normal training data indeed contain more normal points at test time.
Table Q1-1. Normal fraction by training activation-frequency bin.
| Dataset | High freq. | Medium | Low freq. | High−Low |
|---|---|---|---|---|
| MSL | 0.894 | 0.781 | 0.706 | +0.188 |
| PSM | 0.721 | 0.445 | 0.388 | +0.333 |
| SMAP | 0.871 | 0.804 | 0.669 | +0.202 |
On all three, high-frequency cells have a higher normal fraction; on PSM, codewords unseen in training drop to 0.027. Frequency thus acts as a reliability prior on some datasets. However, the trend is not monotonic across all datasets, and adding frequency to the score gave only limited gains, so we do not claim it as a standalone anomaly score.
3. Our method uses only binary membership, as a support-coverage rule. Frequency gives a continuous prior, but our method uses only its weakest form — whether a codeword was activated at least once in training, not any frequency threshold. That is, it checks only whether a test point falls inside the region of representations seen as normal during training (support coverage), without ranking how normal it is. Writing the training-activated set as A,
The chance a future normal representation lands outside A is the missing mass over the codeword alphabet. Good–Turing, which estimates the total probability of events never observed in the sample (the missing mass), can quantify this; but Pananjady et al. (2024) show it can be biased for temporally dependent (Markov) sequences, so since our data is temporal we treat the estimate not as an exact guarantee but as a coverage diagnostic.
Table Q1-2. Good–Turing missing-mass diagnostic (columns: total GT estimate; unseen fractions for normal / anomaly points).
| Dataset | GT missing mass | Normal unseen | Anomaly unseen |
|---|---|---|---|
| MSL | 1.01e-08 | 4.46e-05 | 2.94e-04 |
| PSM | 1.24e-07 | 6.41e-07 | 2.42e-05 |
| SMAP | 2.34e-09 | 0.000 | 0.000 |
The tiny normal-unseen mass shows training-activated codewords cover almost all future normal representations. But the anomaly-unseen mass is also small, so binary activation alone cannot separate anomalies: it is not a sufficient condition for normality, and pseudo-normal purity is not guaranteed without a separation assumption. (On SMAP both are near zero, so the gate admits nearly everything — consistent with SMAP's small shift, JS distance 0.062 in QjUE Table Q3b.) Accordingly, in the final version we will rename this from a "normality certificate" to "training-supported candidate selection."
Even so, this does not destabilize adaptation: across five datasets the mean final codebook drift of activation-gated TTA was 0.0019, and its Affiliation-F1 and VUS-PR differed from oracle-normal TTA by at most 0.023. Binary activation thus stays numerically stable and close to oracle-normal — robustness to the observed contamination rather than reliable anomaly filtering.
In summary: (1) nearest-codeword VQ partitions the space into prototype-centered cells; (2) normal activation frequency estimates each cell's normal probability mass, with higher frequency tending to give a higher normal fraction; (3) the binary rule does not certify normality but broadly covers the training normal support; (4) anomaly overlap needs a separate assumption, which we will make explicit.
W1. Incremental nature and the specific contribution of the VQ codebook.
We agree each component has been studied individually and that per-component novelty is not our core claim. Our contribution is connecting them into a single codebook-based pipeline for the main challenges of time-series anomaly detection.
Represent → Memorize → Adapt. Represent: the multi-scale patch encoder captures temporal context of different lengths, and variable-wise and shared core encoders capture per-variable dynamics and inter-variable dependency. Memorize: scale-wise VQ codebooks compress these into a fixed number of normal prototypes, from which we compute a quantization score (residual to the nearest prototype) and a memory score (a kNN distance to the coreset reflecting local normal density). Adapt: using training-activated codeword indices, we select pseudo-normal candidates without an anomaly-score threshold and update the corresponding prototypes index-wise.
These are not independently added components: the multi-scale representation lets the codebook cover diverse normal patterns; the learned prototypes are the common reference for both scores; and the discrete indices let the same normal memory be reused for threshold-free selection and online adaptation. The codebook is the central structure linking compact memory, complementary scoring, and adaptation.
Direct evaluation of the codebook. To isolate its effect, we replaced the learned VQ codebook with post-hoc K-means and k-center memories under the same encoder features, patch configuration, scoring, and prototype budget. A full-memory approach storing all training embeddings costs storage and retrieval proportional to the number of patches, so a fixed-prototype comparison is the appropriate matched setting.
Table W1-1. VQ codebook vs. post-hoc memories (matched prototype budget).
| Method | F1@0 | VUS-PR | Embedding bank | Build time |
|---|---|---|---|---|
| COMET-VQ | 0.947 | 0.487 | 0 GB | 0.096 min |
| Post-hoc K-means | 0.876 | 0.460 | 9.62 GB | 240.5 min |
| Post-hoc greedy sampling | 0.945 | 0.473 | 9.62 GB | 6.15 min |
| VQEnc-KMeans | 0.875 | 0.456 | 9.62 GB | 415.9 min |
COMET-VQ matches or exceeds post-hoc memories without materializing 9.39M training embeddings or a separate compression step, showing VQ's benefit goes beyond compression: it jointly learns the encoder and prototype memory and reuses the same discrete structure for scoring and adaptation. The novelty we claim is thus:
COMET is a TSAD framework that organically integrates multi-scale normal-pattern representation, compact prototype memory, complementary anomaly scoring, and inference-time adaptation around a scale-wise VQ codebook.
In the final version we will more clearly explain the TSAD-specific problem each component solves and how they connect. We also thank the reviewer for noting the notational complexity; we will simplify repeated indices in the main text and add a unified notation table in the appendix.
We thank the reviewer again; these comments helped us state the role and limits of the codebook more precisely, and we hope our response resolves the remaining concern.
References
- van den Oord, A., Vinyals, O., & Kavukcuoglu, K. (2017). Neural Discrete Representation Learning. NeurIPS 30.
- Mardia, J., Jiao, J., Tánczos, E., Nowak, R. D., & Weissman, T. (2020). Concentration Inequalities for the Empirical Distribution of Discrete Distributions. Information and Inference, 9(4), 813–850.
- Kim, Y.-G., & Park, T.-H. (2021). Anomaly Detection Using Autoencoder With Feature Vector Frequency Map. IEEE Access, 9, 73808–73817.
- Pananjady, A., Muthukumar, V., & Thangaraj, A. (2024). Just Wing It: Near-Optimal Estimation of Missing Mass in a Markovian Sequence. JMLR, 25(312), 1–43.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Rebuttal
We sincerely thank the reviewer for the detailed and constructive assessment and encouraging evaluation. The comments identify where additional evidence would strengthen our claims, and we address them below. Due to space, we report a subset of the experiments; where a single baseline is shown we report the strongest-performing one.
Q1. Threshold selection (also addresses the "Protocol Sensitivity" weakness).
We agree that a threshold obtained by best-F1 search is not deployment-realistic, since it uses test labels; we report it as an upper bound for comparability with prior work, as it isolates the model's attainable utility from the confound of thresholding. That said, following the reviewer's suggestion, we additionally evaluate under deployment-realistic thresholds.
Table Q1. Threshold sensitivity on SMAP (representative thresholds).
COMET's threshold-free scores (e.g., VUS-PR) are invariant to the thresholding scheme and stay above the baselines, so its advantage is not due to a favorable threshold; on thresholded metrics it remains comparable or ahead even at conservative, deployment-realistic thresholds. The gains are thus not an artifact of oracle thresholding.
Q2. Dependence on per-dataset tuning.
To assess dependence on per-dataset tuning, we evaluate a single fixed configuration across all datasets (codebook size 128, dim 128, patches [2,4,6], strides [1,2,3], neighbors 10).
Table Q2. Fixed-capacity COMET vs. CATCH (Aff-F1 / VUS-PR).
Under one global configuration COMET is best on four of five datasets on both metrics, so the "39/45" result is not primarily due to per-dataset tuning. That said, some tuning — notably the codebook size — still helps, as a capacity parameter like the memory size in memory-bank methods, which we keep as an acknowledged limitation with sensitivity in the appendix.
Q3. When TTA helps, when it does not, and long-stream stability (also addresses the "TTA contribution" weakness).
We agree the role of TTA should be characterized more carefully. Its effect can be explained by the amount of test-time shift, which we assess by comparing Static (no adaptation) against an Oracle-normal TTA that updates only on ground-truth normal patches — a clean-label reference for how much adaptation could help.
Table Q3a. Static vs. Oracle-normal TTA (clean-label reference).
On WADI the Static-to-Oracle gap is large, so adaptation has room to help; on SMAP it is near zero, so adaptation can contribute little. A distribution-shift proxy explains this:
Table Q3b. Train-to-test distribution shift (5 seeds).
Both quantities are larger when the test data drifts further from training in codebook space: a higher Jensen-Shannon distance means test patches activate a more different mix of codewords than training did, and a higher negative log training frequency means test patches fall on codewords that were rarely used as normal. WADI has the larger shift on both and is where TTA helps most, while SMAP has little shift and little to gain. TTA thus activates in proportion to the shift — not a generic booster, and neutral rather than harmful where no shift exists.
For long-stream behavior we use CATSv2 (train/val/test = 800K/200K/4M); its long test split makes accumulated drift or contamination most likely to surface.
Table Q3c. Codebook stability and detection over the CATSv2 long stream.
Codebook drift (L2 movement of codewords) and assignment flip rate (fraction of patches whose nearest codeword changes) both stay near zero over four million steps, while TTA still improves detection (F1@0 0.723 → 0.771) — the update tracks benign drift rather than collapsing.
Q4. Training contamination robustness.
Since COMET treats training-activated codewords as normal, we test robustness when the training set itself contains anomalies. We inject labeled anomalous windows into the training split at a target ratio, train normally without using their labels, and check whether the training-activated codebook entries remain reliable.
Table Q4. Training contamination (COMET w/ TTA; Aff-F1 / VUS-PR).
COMET's performance is largely flat as contamination rises from 0% to 25%. This fits the prototype design: a modest fraction of anomalous patches is unlikely to form dominant prototypes, so the normal support is preserved. As acknowledged in the paper, COMET assumes predominantly-normal training, so heavy contamination would eventually weaken pseudo-labeling; these results show robustness well beyond typical levels rather than immunity.
Q5. Multi-seed variation and statistical significance (also addresses the "Gains modest/mixed" and "Statistical robustness" weaknesses).
We agree that reporting variability and significance is important. We report results over SWaT, SMAP, and WADI with seeds {42, 44, 46}.
Table Q5a. Multi-seed mean ± std (Aff-F1 / VUS-PR, %).
Table Q5b. One-sided Wilcoxon signed-rank over SWaT/SMAP/WADI dataset–seed pairs (H1: COMET w/ TTA > comparison).
COMET w/ TTA significantly outperforms CATCH on both metrics (p = 0.002). The effect of TTA itself is metric-dependent: it improves Aff-F1 over Static (p = 0.037), while for VUS-PR the two COMET variants are indistinguishable (p = 0.180) — consistent with Q3, where adaptation is near-neutral under little test-time shift, so this reflects the same behavior rather than a regression. We also clarify "best on 39/45": as many metrics are correlated, this reflects broad, consistent improvement rather than 39 independent wins, so we treat VUS-PR (most reliable per the TSB-AD study [1]) as the primary comparison.
W1. Benchmark fragility: evaluation on a cleaner benchmark.
We agree with the concern about benchmark validity. To address it directly, we additionally evaluate on Exathlon and MITDB from TSB-AD-M [1] — a recent multivariate benchmark meticulously curated by combining human perception with model-based screening to reduce labeling and evaluation artifacts.
Table W1. TSB-AD-M results (q99).
On Exathlon COMET is ahead across all metrics, while on the harder MITDB it leads on Aff-F1 and is roughly on par with the strongest baseline on the others. COMET's advantage thus carries over to a curated benchmark without depending on artifacts of the older datasets, though not uniformly.
W2. Controlled anomaly types.
For anomalies defined by temporal context rather than simple point deviations, we point to our existing analysis in Appendix C.5 (Table 17), which isolates contextual-anomaly localization on SMAP and MSL subdatasets; the appendix table reports additional results.
Table W2. Contextual-anomaly localization (Appendix C.5, Table 17; selected subdatasets).
COMET localizes anomalies more accurately than the strongest competitor on most contextual subdatasets, demonstrating strong performance. This fits the multi-scale, prototype-based design: contextual anomalies emerge over a temporal window, which patch-level prototypes capture better than point-wise scoring.
We thank the reviewer again; these comments have strengthened the paper's empirical grounding, and we hope the above addresses the remaining concerns.
Ref: