Every streaming anomaly detector compares each new score against a baseline of "normal" computed from recent history. The length of that history works like the width of a smoothing filter in edge detection. A long window gives a stable baseline but blurs the moment a regime changes and slowly absorbs creeping attacks. A short window reacts quickly but lets noise spikes drag the baseline around. Current methods pick this window once, by grid search, and estimate the baseline with tools that either assume Gaussian scores or need the tail heaviness of the noise to be known in advance. We propose to let the data choose the window at every time step. The detector keeps a ladder of windows of doubling length and uses the longest one whose baseline estimate still agrees, within confidence intervals, with every shorter one. The intervals come from order statistics, the ranks of sorted scores, so they are valid for any continuous distribution and need no knowledge of variance or tail order.
The opportunity is that two known obstacles dissolve together once the estimated quantity is changed. Heavy-tailed mean estimation cannot be fully adaptive to unknown tail parameters, but an anomaly threshold never needed the mean; it needs a location and an upper quantile of normal scores. Rank-based confidence intervals for quantiles need no tail parameters at all. With that constraint gone, the remaining problem is the scale-localization trade-off in time. The window selected at each step then does three jobs. It sets the baseline, it sets how much history the extreme-value tail fit may use, and, when it suddenly shortens, it signals a change and marks roughly when the change began.
Core Claim
A cross-scale agreement rule over quantile baselines should do three things. It should match the best hand-tuned fixed window on stationary stretches. It should beat every fixed window when noise levels or regimes change within a stream. And it should detect slow ramps that sliding-window thresholds absorb. All of this should hold without tail-parameter inputs and with a finite-sample false-alarm guarantee that holds under independence. The part that is new is using the selected scale itself as both the baseline-memory controller and the change-onset estimate. Prior detectors compare two fixed windows, or intersect confidence sets at a single time scale using known tail parameters.
Where This Sits
Three bodies of work define the problem.
The scale-localization literature supplies the trade-off but not the tool. A Variational Approach to Edge Detection formalized detection against localization. An Optimal Scale for Edge Detection showed that the optimal scale grows as the signal-to-noise ratio (SNR) falls. Both assume a well-defined variance and a globally fixed SNR, which is exactly what fails for heavy-tailed, non-stationary anomaly scores. A Multiscale and Anisotropic Edge Detection Algorithm shows that one scale cannot serve features of different widths, but it fuses scales empirically. We replace that fusion with a selection rule that carries a statistical guarantee.
Robust estimation supplies both the motivation and a constraint. Truncated means, median-of-means, and Catoni estimators need the moment order and moment bound to be set correctly (Optimal Mean Estimation without a Variance; On the Optimality of the Median-of-Means Estimator under Adversarial Contamination; Nearly Optimal Catoni's M-estimator for Infinite Variance). Towards Fully Adaptive Regret Minimization in Heavy-Tailed Bandits proves that full adaptivity to both parameters is impossible without extra structure. (ε, u)-Adaptive Regret Minimization in Heavy-Tailed Bandits recovers adaptivity under a "truncated non-positivity" assumption, using a bisection root-find at every step. We read the impossibility result as a reason to change the target rather than to add assumptions. The price is honest: our baseline is a median, not a mean. For a skewed score distribution this is a different number, but a threshold only needs a stable reference point.
Two heavy-tailed change detectors are the closest prior work.
- Online Heavy-tailed Change-point detection compares clipped-gradient mean estimates over two fixed windows and flags when their confidence intervals stop overlapping. It needs a bounded second moment.
- Catoni-Style Change Point Detection for Regret Minimization in Piecewise-Stationary Heavy-Tailed Bandits flags a change when sequential Catoni confidence intervals no longer intersect. It needs the tail order and bound, and its authors name removing that dependence as open.
Our rule borrows their intersection logic but applies it across a ladder of window lengths, uses rank-based intervals, and uses the result to choose memory rather than only to raise an alarm.
On the thresholding side, Anomaly Detection in Streams with Extreme Value Theory gives SPOT and DSPOT:
- SPOT fits a generalized Pareto distribution, the limiting shape of exceedances over a high level, to the tail of the scores.
- DSPOT runs SPOT on residuals from a fixed-width moving average.
An Evaluation of Anomaly Detection and Diagnosis in Multivariate Time Series shows that dynamic scoring (Gauss-D, which standardizes errors by a local test-window mean and standard deviation) matters more than the choice of network. Its window, however, is grid-searched and its standardization is Gaussian. Finally, Anomaly Detection for a Water Treatment System Using Unsupervised Machine Learning documents that both of its detectors miss stealthy gradual attacks, which is the failure mode our scale-collapse signal targets.
Research Program
The detector takes a univariate anomaly score stream from any upstream model. Following Garg et al.'s finding, we use a univariate autoencoder per channel as the default score source. At time $t$ the detector keeps windows of length $w_j = 2^j w_0$ for $j = 0,\dots,J$. For each window it computes the sample median $\hat m_j(t)$ of the last $w_j$ scores. It also computes a rank interval $I_j(t)$, bounded by the order statistics of rank $w_j/2 \pm c\sqrt{w_j \log(J/\delta)}$, where $\delta$ is the target failure probability. For independent draws from any continuous distribution, binomial concentration of the count of points below the true median means $I_j(t)$ covers the median with probability at least $1-\delta/J$. The selected scale is
$$\hat j(t) = \max\Big\{ j : \bigcap_{i \le j} I_i(t) \neq \emptyset \Big\},$$
that is, the longest window still consistent with all shorter ones.
The baseline location and spread are the median and interquantile range at window $w_{\hat j(t)}$. Standardized residuals at that window feed a SPOT tail fit. We cap the fit's history at $w_{\hat j(t)}$ and restart it on the new segment after a collapse, which removes DSPOT's fixed smoothing width and its exposure to a contaminated calibration batch. We maintain the $J+1$ windows with order-statistic trees, costing $O(J \log w_J)$ per step. That cost is compared against SPOT's reported 351 microseconds per iteration.
Three analyses accompany the construction. First, under independence and a piecewise-constant median, we will prove a finite-sample false-alarm bound. We will also prove that the onset estimate $t - w_{\hat j}$ lands within a window proportional to $(\text{local spread}/\text{shift size})^2$. That squared-ratio form is what rank-interval widths shrinking as $1/\sqrt{w}$ imply. It is the heavy-tailed, time-domain analogue of the rule that optimal scale grows as SNR falls. Second, for a linear ramp of slope $s$, we will derive the detection delay as the first scale at which ramp-induced bias exceeds interval width, roughly $w \propto s^{-2/3}$. Fixed windows that re-center continuously have no such bound. Third, we address temporal autocorrelation, which breaks the independence behind the rank intervals. We will widen intervals by an effective-sample-size correction estimated from block medians, and check empirically whether coverage survives on real telemetry. If it does not, that is a reportable limitation.
Baselines
The naive reference is a static threshold at the calibration-period mean plus three standard deviations of the scores, which is what many deployments still use.
The strongest published dynamic scorer is Gauss-D from Garg et al., with its window grid-searched on the same validation split we use. The file has no reported Lacuna per-dataset number for Gauss-D on SWaT, the Server Machine Dataset (SMD), or the Mars Science Laboratory data (MSL). We will therefore rerun it under the composite F-score protocol, which combines time-wise precision with event-wise recall, rather than quote it.
For extreme-value thresholding we use SPOT and DSPOT from Siffer et al. with the same risk level $q$. On MAWI network traffic that paper reports SPOT at 86% true-positive rate and under 4% false-positive rate. Our method must at least match that on MAWI, at equal $q$, while beating DSPOT on streams with changing noise.
For heavy-tailed change detection we use two methods:
- The dual-window clipped-gradient detector of Sankararaman & Narayanaswamy. On its synthetic Pareto streams it reports a regret score of about 300, against 1600 to 2400 for an improved generalized-likelihood-ratio baseline.
- The Catoni confidence-sequence detector of Genalti et al. (2026), given the true tail parameters as an oracle advantage.
On SWaT, Inoue et al. report an F-measure of 0.802 for their LSTM network. We cite this only as context, because its protocol differs from the composite F-score.
The key ablation is "robust Gauss-D": rolling median and interquantile range at the single best grid-searched window, feeding the same SPOT tail. It shares every ingredient of our method except scale selection, so it isolates whether adaptivity matters. A second ablation replaces rank intervals with Catoni intervals under misspecified tail parameters, to measure the cost of parameter dependence.
All methods receive identical score streams and validation splits. Each gets the same tuning budget of 20 configurations; for our method those configurations cover $w_0$, $J$, and $\delta$. Beating a baseline means a higher composite F-score and lower onset-localization error across seeds, with non-overlapping bootstrap intervals.
Why not just…?
Why not just use robust Gauss-D with a well-tuned fixed window? This is the real threat. On streams whose noise level is roughly constant, a tuned fixed window should come close to our method, and we expect ties there. The claim stands only if we win where the best window changes within a stream. The synthetic suite varies noise scale and tail index piecewise, and the SMD and SWaT segments are analyzed by local volatility. If the fixed-window ablation matches us on those, the adaptive part of the idea is not worth its complexity, and we will report that.
Why not just take the maximum score over several fixed windows? Multiscale fusion by maximum, with a Bonferroni correction, is cheap and catches both spikes and slow shifts. It does not, however, decide which history the baseline and tail fit should use, so contamination from a sustained anomaly still enters the long windows. It also gives no onset estimate. We include it as a baseline and compare onset-localization error, since detection rate alone may not separate the two.
Why not just use adaptive truncation of means, as in AdaR-UCB? Genalti et al. (2024) achieve adaptivity only under the truncated non-positivity assumption. That assumption is about the relation between upper and lower tails, and it is unlikely to hold for nonnegative reconstruction errors, which have only an upper tail. Their method also root-finds at every step. We run a streaming truncated-mean variant as an ablation to measure both its accuracy and its latency.
Why not just use DSPOT? Its moving average has one fixed width. The water-treatment evidence and Siffer et al.'s own discussion indicate that it absorbs gradual adversarial drift. The ramp-injection experiments below test exactly this.
Proposed Experiments
The first experiment is a synthetic suite built for ground truth. Streams draw from Pareto and Student-t noise with tail index in $(1, 3]$, including infinite-variance cases. We inject abrupt median shifts, noise-scale changes that are not anomalies, and linear ramps of varying slope, each with known onset. Metrics are false-alarm rate against the target $\delta$, detection delay, and onset-localization error. We plot error against fixed window length to reproduce the U-shaped curve, and check whether our adaptive choice sits near its minimum at every segment.
The second experiment uses real telemetry: SWaT, SMD, and MSL under Garg et al.'s composite F-score protocol, and MAWI under Siffer et al.'s true- and false-positive-rate protocol. The SWaT stealthy-attack episodes that Inoue et al. report missing are scored separately.
The decisive check is a comparison against the robust Gauss-D ablation on stretches stratified by local volatility change. If scale selection gives no gain on the high-change strata, the core claim fails. If it gains there and ties elsewhere, the adaptivity is justified.
A final check is coverage of the rank intervals on real, autocorrelated scores. We compare empirical false alarms on anomaly-free SWaT training days against $\delta$, with and without the effective-sample-size correction.
References
- A Variational Approach to Edge Detection
- An Optimal Scale for Edge Detection
- A Multiscale and Anisotropic Edge Detection Algorithm
- Optimal Mean Estimation without a Variance
- On the Optimality of the Median-of-Means Estimator under Adversarial Contamination
- Nearly Optimal Catoni's M-estimator for Infinite Variance
- Towards Fully Adaptive Regret Minimization in Heavy-Tailed Bandits
- (ε, u)-Adaptive Regret Minimization in Heavy-Tailed Bandits
- Online Heavy-tailed Change-point detection
- Catoni-Style Change Point Detection for Regret Minimization in Piecewise-Stationary Heavy-Tailed Bandits
- Anomaly Detection in Streams with Extreme Value Theory
- An Evaluation of Anomaly Detection and Diagnosis in Multivariate Time Series
- Anomaly Detection for a Water Treatment System Using Unsupervised Machine Learning