Detecting drift in a sensor stream requires knowing what "normal right now" looks like. Today that reference is either a frozen training window or a recent sliding window of arbitrary length. Both are guesses. This note proposes computing the reference directly instead.
The method fits a learned transition model whose randomness is shared across starting states. It then runs coupling from the past through the sequence of time-varying transitions. Coupling from the past is an exact-sampling method: it starts copies of a random process from every possible state at some past time, drives them all with the same random numbers, and pushes the start time further back until every copy ends in the same place at the present. When they agree, the common value is an exact draw from the distribution the process has at time zero, as if it had started infinitely long ago.
That construction does not need the process to be stationary. Drift therefore does not break it. It just changes what is being sampled: the current marginal of a drifting process, which is exactly the "normal right now" reference a drift-aware detector needs. The look-back length at which the copies merged is a certified, label-free estimate of how much history actually matters. The rest of the proposal makes this work with distribution-free transition models, keeps those models from collapsing under drift, and tests the result on stress suites built to expose the gap between simulated and real conditions.
Core Claim
Monotone quantile-function forecasters can be built so that their sampling map is order-preserving in the previous state, not just in the quantile level. Such forecasters are valid update rules for monotone coupling from the past, even when their parameters change at every time step. The draws obtained this way come from the drifting process's time-zero marginal. They give an exact, model-based reference distribution for anomaly scoring and drift detection. The random coalescence horizon they produce gives an adaptive memory length that replaces a hand-tuned window.
To keep distributional flexibility from turning into drift fragility, the shape of the transition is non-parametric and shared across time. Only a low-dimensional location and scale path is allowed to drift.
This claim reverses a premise in the surrounding literature. Existing perfect-sampling work treats time-homogeneous kernels as a requirement: the linear-extension sampler of A Scalable Scheme for Counting Linear Extensions, the envelope method of Perfect sampling of Markov chains with piecewise homogeneous events, and the lagged couplings of Debiasing Piecewise Deterministic Markov Process samplers using couplings. The research file summarizing these lines even describes backward coalescence under drift as undefined. It is not undefined. The backward composition argument holds verbatim for inhomogeneous update maps; only the meaning of the output changes.
Mechanism
Discretize each sensor channel to its native resolution. Analog-to-digital converters already do this, and it avoids the dequantization problems that flows have on discrete data. Write the transition at time $t$ as
$$x_{t+1} = F_t(x_t, U_t) = a_t + b_t\, S\!\left(U_t;\ \tfrac{x_t - a_{t-1}}{b_{t-1}}\right),$$
where the symbols are as follows. $U_t$ is a uniform random number shared by all copies of the chain. $S(u; z)$ is a learned spline quantile function that is non-decreasing in both the quantile level $u$ and the standardized previous state $z$. $a_t$ and $b_t>0$ are a drifting location and scale. Because $b_t>0$ and $S$ is monotone in $z$, every $F_t$ preserves order.
Coupling from the past then only needs to track the chains started at the lowest and highest grid states at time $-T$. If
$$F_{-1}\circ F_{-2}\circ\cdots\circ F_{-T}(\hat 0) = F_{-1}\circ\cdots\circ F_{-T}(\hat 1),$$
then every intermediate chain is sandwiched between them. The common value is an exact draw of $x_0$ under the drifting kernel sequence. Here $\hat 0$ and $\hat 1$ are the grid extremes. If the chains do not meet, $T$ is doubled and the already-drawn $U_t$ are reused, as in standard coupling from the past.
The spline $S$ borrows its construction from the increment parameterization of Learning Quantile Functions without Quantile Crossing for Distribution-free Time Series Forecasting. That method predicts non-negative increments to guarantee no quantile crossing, and it reports a 0% crossing rate against up to 42% for MQ-CNN. Its closed-form loss for the continuous ranked probability score comes from Probabilistic Forecasting with Spline Quantile Function RNNs. The new ingredient is a second monotonicity constraint along the previous-state axis. Those papers enforce monotonicity only in the quantile level, as an output-validity device. Here it is the property that makes backward coupling possible.
Channels with negative cross-coupling break coordinate-wise monotonicity. For those, we fall back to the interval-envelope bounds of Perfect sampling of Markov chains with piecewise homogeneous events. That method reported roughly a 40x speedup over exhaustive perfect sampling on a 225-state queueing network. We accept that envelopes may be too loose to coalesce in high dimension, and we treat this as a measured limitation rather than a promised result.
Research Program
The first component is theoretical and short. We will state the inhomogeneous coupling-from-the-past result for order-preserving update maps on a finite ordered grid. We will give a sufficient condition for almost-sure coalescence: a uniform lower bound on how quickly the spline's dependence on the previous state decays. We will also show that the coalescence horizon $T^\ast$ upper-bounds the look-back beyond which the time-zero marginal no longer depends on earlier states. That bound is what licenses using $T^\ast$ as a window length.
The second component is the drift model. The location and scale paths $(a_t, b_t)$ are tracked online. The baseline tracker uses a robust quantile filter, and we compare it against a local-linear Kalman tracker. The shape $S$ is refit only on data inside a multiple of the recent median $T^\ast$.
This split responds to the main negative result motivating the work. Benchmarking IoT Time-Series AD with Event-Level Augmentations reports that flow-based detectors fail catastrophically under log drift on SKAB and the nuclear turbogenerator data. It also reports that freezing GANF's learned dependency graph raises drift sensitivity about 8x. Our reading is that high-capacity shape parameters absorbing drift is the failure. The design therefore keeps shape flexible but slow, and lets only two parameters move fast.
The third component is the detector. For each new reading we compute two quantities. One is its probability-integral-transform value against the exact time-zero marginal obtained from many independent coupling runs. The other is its one-step conditional value given $x_{-1}$. We combine both into an event-level score. Separately, a sudden growth in $T^\ast$ is tracked as a signal that the process is approaching slow mixing. The file notes that coalescence times explode near heavy load or phase transitions; here that symptom becomes a warning sign for regime instability.
Baselines
The naive reference point is a rolling Gaussian with fixed window length: a running mean and variance per channel, scored by z-value. The reviewer argument in the file treats this as the stable, tractable default. The benchmark paper's GANF ablation implies the Gaussian question is unresolved under drift. The research file reports that ablation in contradictory directions. Its main entries say that replacing the flow with a Gaussian reduced SWaT high-stress F1 under log drift from about 0.75 to about 0.57. Its gap discussion says the opposite. We will rerun this ablation ourselves rather than rely on either reading. The rolling Gaussian gets the same window-tuning budget as every other method.
The strongest univariate drift detector is the Incremental Kolmogorov–Smirnov test of Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test. It maintains a full empirical distribution in a randomized search tree with logarithmic-time updates, and reaches topline accuracy while requesting 42% to 47% of labels on Insects, Bike, Posture, Keystroke, and Arabic. It is the strongest competitor because it is distribution-free, fast, and differs from our method mainly in where its reference comes from: a sliding window rather than a coupled model. We will run it twice, once with window length tuned on validation streams and once with an oracle window chosen on test labels. Beating the tuned version means matching its accuracy at a lower label fraction. Matching the oracle version without labels would itself be a positive result for $T^\ast$ as a window selector.
For geometry-aware detection we compare against the distribution-valued change-point detector of Beyond Euclidean Summaries: Online Change Point Detection for Distribution-Valued Data. It reports F1 of about 0.75 with near-immediate detection on FlowCAP-II. Its authors note that its static reference barycenter is a limitation under continuous drift, and that limitation is precisely the gap we target.
For cyber-physical anomaly detection, the strongest reported clean-to-stress numbers in the file come from the benchmark paper on SWaT under additive noise. GBAD drops from 0.804 to 0.677 F1. MTAD-GAT drops from 0.762 to 0.756. GANF under log drift sits around 0.75 or 0.57 depending on the configuration, as discussed above. We will run GBAD, MTAD-GAT, and GANF through the same perturbation suite and the same event-level F1. Each method gets an equal hyperparameter-search budget measured in GPU-hours, and all use the same train and validation splits. For WADI, SMD, and TEP there is no reported result found on Lacuna for any of these models, so we produce those numbers ourselves.
Three ablations isolate the key ingredients. The first replaces exact coupling with forward simulation from a fixed past time equal to the median observed $T^\ast$; this isolates exactness and adaptivity from the model itself. The second keeps coupling but uses a Gaussian shape with the same drift tracker; this isolates distributional flexibility. The third lets the full spline shape vary over time; this tests whether the shared-shape constraint is what buys robustness.
Why not just…?
Why not just sample the fitted model forward from the latest observation, as every autoregressive forecaster does? For forecasting the next value, this is correct, and we do it too: it is the conditional half of our score. It cannot answer a different question: is the current reading itself typical of the current regime? That requires a marginal, not a conditional. The marginal is also what remains usable when the previous reading is missing or corrupted, and the benchmark paper's sensor-dropout and toxic-sensor results make that case the norm. The ablation that drops the marginal score measures how much this matters.
Why not just run forward simulation with a long fixed burn-in instead of coupling from the past? This is the real threat. With a generous fixed horizon it will sample nearly the same distribution. Coupling from the past adds two things. One is a certificate that the horizon was long enough. The other is a per-time horizon that shrinks after abrupt drift and grows during slow mixing. If the fixed-horizon ablation matches our detection accuracy and calibration at equal compute on every benchmark, the honest conclusion is that only the horizon statistic is new. We will then report it as a window selector rather than claim an exact-sampling advantage. The synthetic exactness experiment below is designed to show where fixed burn-in fails: when drift is fast relative to mixing, any fixed horizon either wastes compute or is biased.
Why not just use a rolling Gaussian or Student-t, since rigid models are reported to be more robust under drift? Under some readings of the benchmark paper this is exactly what happens, and we take it seriously. The evidence against rigidity alone comes from two places. On the bursty Wikipedia data, the spline model of Probabilistic Forecasting with Spline Quantile Function RNNs reports an interval score of 15.68 against DeepAR's 19.35. And Euclidean moment summaries miss multimodal reweighting and dependence shifts in Beyond Euclidean Summaries: Online Change Point Detection for Distribution-Valued Data. Our Gaussian-shape ablation shares the same drift tracker. If it matches the spline version under drift families held out from training, flexibility is not paying for itself. In that case we would recommend the Gaussian-plus-coupling variant.
Why not just use the Incremental Kolmogorov–Smirnov test with a well-chosen window? The comparison against the oracle window is built for this. If no label-free rule including ours can approach the oracle, the method has no practical advantage. If $T^\ast$ closes most of the gap between tuned and oracle windows, it has an advantage.
Proposed Experiments
The first decisive check is exactness on synthetic drifting chains where ground truth is computable. We use monotone autoregressive and birth–death queue chains on a grid with linear, logarithmic, and abrupt drift in their location and scale. On these, the true time-zero marginal can be computed by propagating the distribution forward from a very distant past. We test coupling-from-the-past samples against the true marginal with Kolmogorov–Smirnov and total-variation error. We compare against fixed-burn-in forward simulation across a grid of drift-to-mixing speed ratios. The prediction is that fixed burn-in error grows with drift speed and coupling error does not. A failure here would falsify the core claim.
The second check is window selection on the real drift streams used by the Kolmogorov–Smirnov paper (Insects, Abrupt Insects, Bike, Posture, Keystroke, Arabic). We measure accuracy versus label fraction for the incremental test using tuned windows, oracle windows, and windows set to our median $T^\ast$.
The third check targets the gap between simulation and reality. We train on SWaT, SKAB, and the Tennessee Eastman process with only linear drift and additive noise from the benchmark suite. We then test on log drift, window shifts, and dropout, which are drift families the models never saw. We report event-level F1 and the probability-integral-transform calibration of held-out normal segments. Holding out drift families matters because the suite's perturbations are themselves synthetic and closed-world, a limitation the robot-leg transfer results in Towards the targeted environment-specific evolution of robot components illustrate sharply. Where the Steam Turbine and turbogenerator streams can be accessed, they provide the only drift not injected by a modeler. Results on them will be reported separately from the augmented benchmarks.
The project would be abandoned or narrowed under either of two outcomes. One is that the rolling Gaussian with tuned window matches the full method on held-out drift families. The other is that coupling fails to coalesce within a horizon shorter than the stream's own segment lengths on SWaT.
References
- A Scalable Scheme for Counting Linear Extensions
- Perfect sampling of Markov chains with piecewise homogeneous events
- Debiasing Piecewise Deterministic Markov Process samplers using couplings
- Learning Quantile Functions without Quantile Crossing for Distribution-free Time Series Forecasting
- Probabilistic Forecasting with Spline Quantile Function RNNs
- Benchmarking IoT Time-Series AD with Event-Level Augmentations
- Fast Unsupervised Online Drift Detection Using Incremental Kolmogorov-Smirnov Test
- Beyond Euclidean Summaries: Online Change Point Detection for Distribution-Valued Data
- Towards the targeted environment-specific evolution of robot components