arXiv:2610.17399cs.LGOct 2026

Manuscript Offprint

arXiv:2610.17399

Learning to Detect Shifts in Unstructured Data Streams via Monitoring-by-Betting

Siyu Zhou, Jialin Ouyang, Fan Xia, Adarsh Subbaswamy, Drew Prinster, Suchi Saria, Augusto Garcia-Agundez, Sarah Pollet, Jinoos Yazdany, Patrick Vossler, Jean Feng

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

Abstract

Continuous monitoring of generative AI systems requires detecting distribution shifts in the unstructured data they ingest and generate. Existing monitoring methods typically control false alarms by requiring the discrepancy measure used to detect shifts to be prespecified. However, for unstructured data, pre-specification creates a sensitivity–breadth trade-off: a narrowly defined measure is sensitive to the anticipated shift but may miss unexpected changes, whereas a broadly defined measure may detect a wider range of shifts but with reduced sensitivity. Although adaptively hypothesizing the shift direction can overcome this limitation, such data-dependent adaptation generally invalidates conventional false-alarm guarantees. We reconcile adaptivity with statistical validity through testing-by-betting, reframing sequential changepoint detection as a betting game in which the bettor continually updates its hypothesized shift direction, or witness function, as new observations arrive. We introduce asymptotic e-detectors, which approximate the pre-change distribution using a calibration set of size m, and prove that they asymptotically control the average run length to a false alarm as m increases. Empirically, calibration sets as small as m = 30 provide effective control. We then develop adaptive monitoring strategies ranging from black-box bettors that learn from embeddings to interpretable bettors based on LLM-proposed concepts. Across three real-world datasets, including data from a clinical AI scribe deployment, adaptive monitors detect shifts faster than fixed monitors at the same false-alarm level. Further, when the true shifts are sparse and interpretable, LLM-concept monitors provide the fastest and most interpretable detection, while also guiding root-cause diagnosis for complex shifts.

1 INTRODUCTION

Preventing performance decay in deployed generative AI systems requires monitoring throughout the entire pipeline, including the input distribution, user behavior, and model outputs. Existing monitoring procedures follow the general recipe of pre-specifying a discrepancy measure and tracking shifts with respect to this metric. Pre-specification plays a critical role [46, 63, 65], as it ensures control over false alarms; this is typically measured by Average Run Length under the null hypothesis of there being no changepoint (ARL 0_{0}), which quantifies the “lifespan” of a monitor until it must be reset. For instance, LLM-based monitoring methods track scores with respect to a fixed performance rubric [35] or shifts in fixed directions away from the original data distribution [74, 43, 70]. Other methods convert unstructured data into high-dimensional vectors, which can then be monitored for shifts with respect to pre-specified directions [7, 12, 50] or kernel functions [31, 9]. Monitoring metrics should be specified with immense care, as performance of monitoring procedures is highly sensitive to this choice [26]: strong alignment between the pre-specified measure and the future shift direction leads to fast detection, while poor alignment may lead to having little to no detection power.

Nevertheless, pre-specification has key limitations that leave it misaligned with modern AI practice. First, it is typically difficult to pre-specify the monitoring metric, since future shift directions are, by definition, unknown. This forces monitoring teams to choose between concentrating power on detecting shift in particular directions (sensitivity) versus spreading power across many possible directions (breadth). Defining shifts for high-dimensional or unstructured data is particularly difficult given that such data can experience a wide variety of shifts. As such, recent works on retrospective testing have instead sought to learn so-called “witness functions” that highlight differences between data distributions by training a classifier [44, 41, 40]. Second, pre-specification prevents the monitoring metric from adapting as information accumulates, whereas

†^{\dagger}Co-senior authors.

a monitoring team may gain a better understanding of the data and likely shift directions as data accumulates. For instance, a shift may become obvious to a human after a small number of observations [24]. In fact, the rigidity of current statistical monitoring procedures has led monitoring to be viewed as a fundamentally “human” activity [45], in which statistical evidence complements, rather than replaces, human judgment. Finally, with the increasing reasoning capabilities of LLMs, monitoring practitioners are increasingly drawn to using LLMs to assist in monitoring [3], but formal statistical monitoring procedures still lack the ability to incorporate such adaptations on-the-fly.

As such, the goal of this paper is to answer the following question: can we monitor unstructured data streams by adaptively increasing sensitivity to shifts learned from past data, while still maintaining statistical guarantees over false alarms? To this end, we look to the Safe Anytime-Valid Inference (SAVI) framework [54], which enables nearly arbitrary adaptations during the testing process by reframing sequential testing as a game of betting against the null hypothesis. This game must satisfy one simple martingale-like property: the game's returns should be centered so that any bettor—however adaptive and adversarial—cannot gain wealth in expectation under the null hypothesis [59, 30, 52]. A bettor's current wealth is thus the current level of evidence against the null, and rejection of the null is warranted when the bettor's wealth exceeds some threshold; this wealth is called an "e-value," as the analog of the classical p-value.

In sequential changepoint detection, the null hypothesis is that there is no change, i.e., H0:Pt=P∀t=1,2,⋯H_0 : P_t = P \quad \forall t = 1, 2, \cdots, while the alternative is that the data switches to a post-change distribution QQ after some changepoint τ\tau. To control ARL0ARL_0, recent work has built on e-values and the SAVI framework to introduce “e-detectors” as a broad class of procedures [62]. Through the betting lens, these methods can be generally viewed as playing the following game:

References (68)