arXiv:2610.17343stat.MLOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.17343

Monitoring for Shifts at Unknown Times: Parameter-Free Conditional Conformal Martingales

Tuo Liu, Drew Prinster, Francesco Orabona

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

Abstract

Conditional conformal test martingales provide sequential tests for detecting distribution shifts, using a fixed reference dataset to avoid contamination from test-time samples. Prior work used a penalized betting function via online optimization with smoothing, clipping, and other hyperparameters, which can adapt slowly when a shift occurs after a long stationary period. In this work, we introduce an approach that requires no hyperparameters and provably adapts quickly to shifts occurring at unknown times. Our key idea is to frame the penalized betting problem as portfolio selection in a three-asset market. Then, we use a restarting universal portfolio, with a heavy-tailed wealth allocation over time. We establish anytime false-alarm control and derive optimal finite-sample bounds on detection delay under detectable alternatives. We also develop an FFT-based implementation that computes the portfolio sequence over T rounds in O(T2ln⁡T)\mathcal{O}(T^2 \ln T) time, instead of O(T3)\mathcal{O}(T^3) of the naive implementation. Synthetic and real-world experiments suggest that the proposed approach adapts rapidly after long periods of null samples, with detection delays depending substantially less on shift time than prior baselines.

1 Introduction

A deployed machine learning model is typically only reliable when the data distribution it was trained on is consistent with the distribution it currently sees. In reality, this consistency can break in many ways: a hospital replaces an imaging scanner, a camera lens degrades, or the questions a user asks a large language model evolve over time. Labels usually arrive late or not at all, so the resulting drop in accuracy can go unnoticed for a long time. Monitoring the inputs for distribution shift gives an early warning, which can trigger model retraining, additional data collection, or human review. A common approach is to monitor a scalar score of each incoming input, such as the confidence of a classifier [Hendrycks and Gimpel, 2017] or the likelihood under a density model [Ren et al., 2019], and to raise an alarm once the scores no longer resemble those of in-distribution data. In particular, a useful monitor should meet at least two key requirements. First, false alarms must stay minimal no matter how long the monitor runs, so the probability of rejecting a true null should be anytime valid. Second, shifts rarely happen at the start of deployment; a model usually operates normally for a long and unknown period before, say, a sensor degrades or incoming images become corrupted. So, a good monitor should detect a shift quickly, whenever it happens.

The framework of testing by betting [Shafer, 2021, Ramdas et al., 2023] allows one to design algorithms that meet the first requirement by construction. In this framework, a gambler starts with unit wealth and repeatedly places bets that are fair under the null hypothesis of no shift, and statistical evidence

*tuo.liu@kaust.edu.sa

†^{\dagger}drew@cs.jhu.edu

‡^{\ddagger}francesco@orabona.com for distribution shift is accumulated by the wealth process. As no bet is favorable under the null, the wealth is a nonnegative supermartingale, and by Ville's inequality [Ville, 1939] it exceeds level 1/α1/\alpha at any time with probability at most α\alpha. Conformal test martingales (CTMs) [Vovk et al., 2003, Vovk, 2021] apply this idea to monitoring for distribution shift by betting on conformal p-values, which rank each new score among all observations seen so far. Because the ranking uses test data, however, new scores collected after a shift gradually enter the reference pool; post-shift observations then look typical, weakening the evidence against the null, an effect known as test-time contamination [Podkopaev and Ramdas, 2022, Shaer et al., 2026]. To tackle this issue, Shaer et al. [2026] proposed conditional CTMs (CCTMs), which instead compare every test score with a fixed reference dataset D0D_0 and add a penalty that absorbs the estimation error of the reference distribution.

Crucially, the additional penalty term, ϵ∣η∣\epsilon|\eta|, for a bet size of η\eta is not differentiable at η=0\eta = 0, and Shaer et al. [2026] learn the bet with the online Newton step (ONS) [Hazan et al., 2007] as proposed by Cutkosky and Orabona [2018]. The resulting detector carries several hyperparameters: a smoothing constant to smooth ∣η∣|\eta|, a bound on the bet size, a clipping threshold that sets small bets to zero, and a warm-up period, with different clipping thresholds and warm-up lengths used for synthetic and image data. A good value will depend on how long the null period lasts, which is exactly what is unknown. More fundamentally, ONS is designed to compete with the best constant bet in hindsight, which is a poor target when the shift comes late. Before the shift, the optimal bet is precisely zero, since systematic wealth growth is impossible under the null, and every nonzero constant bet will cause wealth decay at a rate proportional to its size. Therefore, every nonzero constant bet needs a number of post-shift observations that grows linearly with the length of the null period to recover its expected wealth loss, so competing with the best constant bet guarantees little for late shifts. Empirically, we measured that the median delay of the CCTM grows roughly 9 times for a shift after t0=4000t_0 = 4000 null samples (Section 5).

In this paper, we address both problems: hyperparameter tuning and the slow response to late shifts. These are our contributions:

• An equivalent reformulation of conditional CTMs. Our key observation is that bet selection for the penalized betting function of Shaer et al. [2026] is equivalent to investing in a three-asset market (Section 2). So, the nonsmooth penalty becomes a linear function of the portfolio weights. The test martingale keeps the original betting function and is bounded below by the market wealth, so the reformulation needs no smoothing and costs no power.

  • A parameter-free detector. With the new formulation, betting strategies can be built with the tools from online portfolio selection, which offers algorithms with wealth guarantees on every sequence of returns [Cover, 1991, Orabona and Jun, 2024, Orabona, 2019]. To adapt to an unknown shift time, we propose a restarting universal portfolio with a heavy-tailed allocation of the initial wealth among the start times (Section 3). Each portfolio thus holds cash until its start time, so the one started right after the shift loses no wealth during the null period and then competes with the best constant-rebalanced portfolio (CRP) on the post-shift data alone. Apart from the test level and the confidence level of the reference band, it has no hyperparameters.

• Adaptivity to an unknown shift time. In Section 4, we show that false alarms are controlled anytime. For a detectable shift after t0t_0 null observations, the cost of not knowing t0t_0 a priori is ln⁡t0+O(ln⁡ln⁡t0)\ln t_0 + \mathcal{O}(\ln \ln t_0), measured in log-wealth. So, the delay grows only logarithmically with t0t_0, compared with the linear growth for constant bets. We also prove that ln⁡t0\ln t_0 is unavoidable: under anytime false-alarm control, no procedure detects shifts with a delay of smaller order than ln⁡t0\ln t_0 uniformly over all t0t_0, even if the pre- and post-shift distributions are known.

• Efficient implementation. Despite this adaptivity, restarting a universal portfolio at every round costs O(T3)\mathcal{O}(T^{3}) over a horizon of T when computed directly. We give a divide-and-conquer FFT-based algorithm that computes exactly the portfolio sequence in O(T2ln⁡T)\mathcal{O}(T^{2}\ln T) time (Section 3.2).

On synthetic and ImageNet-C data, our detector's delay is nearly flat in shift time, while those of conditional/standard CTMs grow steadily; after 4000–8000 null samples, we detect shifts two to five times faster.

Abbreviated Related Work. Sequential change detection has a long history, starting with the CUSUM procedure [Page, 1954]. However, classical theory [Lorden, 1971, Lai, 1998, Tartakovsky et al., 2014] generally assumes simple and parametric settings with known pre- and post-change distributions, and its guarantees generally control the average run length (ARL) to a false alarm under the null, which bounds how soon a false alarm is expected but allows one to occur eventually with probability one. E-detectors [Shin et al., 2023] extend CUSUM-type and Shiryaev–Roberts (SR)-type procedures to certain composite and nonparametric settings by starting a new e-process (a generalization of a test supermartingale) at every round and combining them, with a guarantee on the ARL to false alarm. For ARL control under the null of exchangeability, Vovk [2021] similarly studies CUSUM- and SR-type standard CTMs. Our detector also starts a new bettor at every round, but it combines them with weights that sum to one, so that the total wealth itself is a valid test supermartingale. This yields a stronger, unbounded-horizon guarantee: given a reference dataset whose confidence band holds, the probability of raising a false alarm is at most α\alpha anytime. Under this criterion, a delay growing logarithmically with the shift time is unavoidable (Section 4). For additional related work on sequential change detection, see Appendix A.

Universal portfolios [Cover, 1991, Cover and Ordentlich, 1996] achieve logarithmic regret against the best constant-rebalanced portfolio without tuning, and coin betting connects portfolio selection with parameter-free online learning [Orabona and Pál, 2016, Orabona, 2019]. To compete with comparators that change over time, one can mix over sequences of experts [Herbster and Warmuth, 1998, Singer, 1997, Kozat and Singer, 2008, Hazan and Seshadhri, 2009, Daniely et al., 2015, Jun et al., 2017]. The use of a universal portfolio as a testing-by-betting algorithm appeared for the first time in Orabona and Jun [2024], for the specific case of confidence sequences.

References (100)

Couldn't load all references. Reload the page to try again.