Learning to Detect Shifts in Unstructured Data Streams via Monitoring-by-Betting
Organizations: University of California, San Francisco · University of Maryland · Johns Hopkins University
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 pre-specified. 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 , and prove that they asymptotically control the average run length to a false alarm as increases. Empirically, calibration sets as small as 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.
Figures & tables
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| CEBaB | CUB: yellow bill | CUB: white crown | AI scribe | |
| Data | Restaurant reviews from CEBaB | Bird images from CUB-200-2011 | Bird images from CUB-200-2011 | HPI section of Rheumatology clinical notes |
| Shifted attribute | Whether review mentions ambiance | Whether bird has yellow bill in image | Whether bird has white crown in image | Clinical notes from 60 days before vs after model update on 2026-02-25 |
| Prevalence pre post | 0.52 0.88 | 0.17 0.64 | 0.30 0.95 | N/A |
| Embedding model | MiniLM | CLIP ViT-B/32 | CLIP ViT-B/32 | MiniLM |
| Embedding dim | 384 | 512 | 512 | 384 |
| 50 | 50 | 50 | 100 |
| Dataset | Direction | IC text | OC text |
|---|---|---|---|
| CEBaB | Informed | a typical restaurant review describing the customer’s experience of the visit | a restaurant review that comments on the ambiance or decor of the restaurant |
| Unrelated | a typical restaurant review describing the customer’s experience of the visit | a restaurant review that mentions parking the car near the restaurant | |
| CUB (yellow bill) | Informed | a photo of a bird | a photo of a bird with a yellow bill |
| Unrelated | a photo of a bird | a photo of a bird perched on a wire or fence post | |
| CUB (white crown) | Informed | a photo of a bird | a photo of a bird with a white crown |
| Unrelated | a photo of a bird | a photo of a bird perched on a wire or fence post |
| Theme | Codebook definition | # Concepts | Before after | Example concepts (before after) |
|---|---|---|---|---|
| Unneeded content | Draft content that does not belong in the note because it is unnecessary, redundant, verbose, non-clinical, introductory or identifying, or the removal, condensing or restructuring of such content, whether clinical or not | 46 | 0.79 0.60 | Does the initial draft include unnecessary or irrelevant non-clinical information such as review of systems, introductory sentences, or personal details? ( ) Does the edit remove redundant or unnecessary note sections (including review of systems or initial summary)? ( ) |
| Clinical correction | Clinical content (diagnoses, symptoms, medications, treatment) that the clinician adds, corrects or clarifies, or that the draft is missing | 21 | 0.56 0.61 | Does the edit correct or improve diagnostic information? ( ) Does the initial draft miss or have incorrect medication, treatment, or procedure details? ( ) |
| Non-clinical correction | Non-clinical information (patient or social history, follow-up, administrative or demographic details) that the clinician adds, corrects or clarifies, or that the draft is missing | 5 | 0.51 0.67 | Does the edit improve the accuracy and completeness of patient, social history, or provider demographic information? ( ) |
| Stream | Concept | Theme | Before after |
|---|---|---|---|
| 1 | Does the edit add or correct procedural or diagnostic details based on inaccuracies or omissions in the initial draft? | Clinical correction | |
| Does the edit clarify or correct medication, management, or demographic information based on inaccuracies or omissions in the initial draft? | Clinical correction | ||
| Does the edit add or correct missing or inaccurate patient history and administrative details (such as functional status, anatomical location, provider identification, or lab data) in the initial draft? | Non-clinical correction | ||
| Does the edit add or correct missing treatment and clinical history details based on inaccuracies or omissions in the initial draft? | Clinical correction | ||
| 2 | Does the edit remove unnecessary or irrelevant patient-related information (such as identification, introduction, background, history, or personal details) from the initial draft? | Unneeded content | |
| Does the edit improve procedural and clinical detail documentation by clarifying, correcting, or adding missing information based on the initial draft? | Clinical correction |
Distribution Shift Detection
Distribution shift detection identifies when data or model behavior changes between reference and deployment settings.
See all 62 papers