arXiv:2608.30502cs.LGAug 2026

Manuscript Offprint

arXiv:2608.30502

When the Martingale Never Stops Firing: Anytime-Valid Gating on Real Forecast Streams

Weijia Han, Lisha Qu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Machine learning systems are increasingly corrected while they run, and the decision of when to intervene is increasingly delegated to statistical monitors. Anytime-valid inference promises evidence that can be acted on at any moment, exactly the guarantee this setting needs, and it is moving from theory into deployed monitoring. Conformal test martingales are the change-detection instrument, and Ville's inequality caps their false-alarm probability on exchangeable data. The guarantee is conditional. A deployment inherits it only if the stream it monitors behaves exchangeably. The premise is hardest to satisfy where these monitors are most useful, on dependent data and inside loops where the monitor modifies the learner whose scores it reads. It is also rarely measured. We measure it in a pre-specified case study, where such a monitor gates the online updates of a Kalman adapter correcting frozen time-series foundation models on five forecasting streams. On exchangeable synthetic streams, the same implementation fires in at most 1 of 60 runs. On the real streams, at α=0.05\alpha = 0.05, 135 of 135 clean-stream runs fired. The construction does not explain the firing; the failure comes from the deployed score stream itself. Repeated fires hold the gate's drift response active, and the gated filter amplifies the very transient it was designed to prevent. The component worth keeping makes no validity claim. Huber-style gating of the filter's own updates cuts isolated-spike degradation by an order of magnitude with no dataset-specific tuning. Anytime-valid methods proposed for dependent data should therefore be accompanied by null-calibration controls and mechanism traces.

1 A pre-specified martingale-gated deployment

Anytime-valid monitors are advocated precisely for online deployment. They fire as soon as evidence accumulates, at a finite-sample false-alarm level that holds at every stopping time [Ramdas et al., 2023]. That level rests on a premise, exchangeability of the monitored score stream. We measure that premise on a single deployment, frozen before any run.

Backbones and adapter. Frozen time-series foundation models, hereafter backbones, are increasingly corrected online by lightweight adapters. We use TiRex [Auer et al., 2025], Chronos-2 [Ansari et al., 2024, 2025], and TimesFM 2.5 [Das et al., 2024], the last a checkpoint release of the cited model line. We correct each backbone with a per-step linear “black-box stacking” adapter (forecast horizon 96, state dimension 192) maintained by a Kalman filter whose hyperparameters ( λ\lambda, QQ, RR) adapt online by Adam on the innovation likelihood [West and Harrison, 1997]. An exact block-structured form makes the filter and its hyper-gradient cost 0.163×0.163 \times one-step SGD; the gate’s conformal and martingale path is not counted.

Motivation. The staged study preceding the gate left exactly one problem for a gate to solve. Validation-tuned static forgetting diverges on test; its chosen cell finishes 1.4 to 3.6 orders of magnitude worse than the zero-tuning filter on one dataset across all three backbones. The zero-

Preprint.

zero-tuning filter | 0 / 45

SGD (val-tuned)

static forgetting (val-tuned)

6+3 / 45

12 / 45

0

2

4

6

8

10

12

14

16

diverged runs (of 45)

Figure 1: Clean-stream divergences per learner across the 45 staged-study runs (5 datasets × 3 backbones × 3 seeds). Hatching marks de facto divergences the magnitude guard missed (SGD on traffic under TimesFM 2.5, cumulative MSE 7.97 against the committed threshold of 5, no guard flag, in all three seeds).

Table 1: Fires on clean streams at α=0.05\alpha = 0.05; each range spans 3 backbones ×3\times 3 seeds (9 runs). Right column: largest Ljung-Box pp across the cell's full-gate runs; the weather value is a lower-tail degeneracy (see text). †\daggerCounts cover a shorter stream, truncated by clean-stream divergence (6 of 9 weather full-gate and 3 of 9 traffic SGD-surrogate runs, Section 3).

datasetHuber-onlyfull gateSGD surrogatemax LB pp (full gate)
ETTh231–7218–35121–173<10−8< 10^{-8}
ETTm1459–557146–176634–712<10−15< 10^{-15}
weather462–567115-277†115\text{-}277^{\dagger}787–1,340≈1\approx 1 (degenerate)
electricity77–9436–5657–750.250.25
traffic26–4322–33118-210†118\text{-}210^{\dagger}<10−10< 10^{-10}

tuning adaptive filter never diverged in any of the 45 staged-study runs (Figure 1). Its one weakness is a single self-excited transient on the weather stream. Cumulative MSE stays near 2×10−42 \times 10^{-4} through roughly step 18,400, a brief elevated-error episode follows, and one event at step 18,536 dominates the final cumulative MSE.

This motivates a gate that (i) robustifies isolated spikes and (ii) declares sustained drift so adaptation can be boosted, with a conformal test martingale [Vovk et al., 2003, 2021, Ville, 1939, Shafer, 2021, Ramdas et al., 2023] making the decision.

Gate construction. The nonconformity score is the filter's own standardized innovation, and the monitor is a simple-mixture conformal test martingale over randomized conformal pp-values from a 250-step sliding calibration window [Vovk et al., 2022]:

st=et⊤St−1et,Mt=1K∑k=1K∏τ≤tεkpτεk−1,s _ {t} = e _ {t} ^ {\top} S _ {t} ^ {- 1} e _ {t}, \quad M _ {t} = \frac {1}{K} \sum_ {k = 1} ^ {K} \prod_ {\tau \leq t} \varepsilon_ {k} p _ {\tau} ^ {\varepsilon_ {k} - 1},

with K=19K = 19 grid values εk∈{0.05,…,0.95}\varepsilon_k \in \{0.05, \dots, 0.95\}, threshold 1/α1/\alpha at α=0.05\alpha = 0.05, and reset on fire. A decision table maps each step to normal, huberize [Huber, 1964], skip, or sustained drift: drift is declared on Mt≥1/αM_t \ge 1/\alpha (checked first), isolated spikes on sts_t above the 99.9th percentile of its fixed chi-square null distribution; the drift response boosts QQ by 10×10\times, decaying linearly over 50 recovery steps, applies a covariance soft reset, and moves the forgetting factor to a drift value. Spike classification is suppressed during those recovery steps.

Protocol. Five datasets [Zhou et al., 2021, Wu et al., 2021] (ETTh2, ETTm1, weather, electricity, traffic; test blocks of 12,922 to 52,117 steps), three backbones, three seeds, deterministic cached-forecast replay. The online protocol is the immediate-reveal streaming convention: stride one, each step's full 96-step label revealed before the next update, so consecutive labels overlap in 95 of 96 entries, which is itself a mechanical source of serial dependence in the scores; the full-label reveal is optimistic for real deployment, and clean means uncontaminated replay with no stationarity claim. Label contamination is fraction-pinned (exactly round(fT)(fT) steps at f∈{1,5,10%}f \in \{1, 5, 10\%\}; spike, level-shift, and stuck injectors), applied to the update channel only; accuracy is scored against clean labels. A run that crosses a magnitude-divergence guard is truncated at that step and marked diverged. All verdicts, exclusion rules, and contamination severities were version-stamped before the runs; Appendix A states the composite criterion.