Online Active Testing: Adaptive Importance Sampling for Unbiased Risk Estimation in Data Streams

Hugo Schmutz, Hachem Kadri, Thierry ArtièresNeurIPS 2026

TL;DR

How do you know if a deployed machine learning model is failing when data streams past in real time and ground-truth labels cost a fortune? This paper introduces Online Active Testing (OAT), a framework that cherry-picks the most informative streaming data points to label on the fly while mathematically correcting for that selection bias. The result is an accurate, unbiased estimate of your model’s real-world performance for a fraction of the labeling budget.

What Problem Does This Paper Address?

We spend mountains of effort figuring out how to train models with minimal labels (active learning), yet we routinely assume we have massive, fully labeled test sets to evaluate them. In the real world—think autonomous vehicles, clinical monitors, or molecular simulations—test labels are just as expensive as training labels. Worse, data arrives sequentially in a continuous stream, and memory or latency constraints often mean you can't store everything; you have to decide immediately whether to pay for a label or let the data point vanish forever.

If you naively query labels only when your model is uncertain, your test score will look artificially terrible due to sample-selection bias. Existing "active testing" methods fix this bias, but they assume a static pool of data sitting on a hard drive. How to do unbiased, low-variance risk estimation in a strict, one-pass streaming environment has remained an open question.

Methods

The authors propose Online Active Testing (OAT) over a fixed stream horizon of $T$ unlabelled inputs, aiming to keep the expected number of queried labels within a budget $n_B$.

When an input $x_t$ arrives, OAT flips a weighted coin with probability $\beta_t$ to decide whether to query the true label $y_t$. To prevent selection bias, it uses adaptive importance sampling: if a point had a low probability $\beta_t$ of being picked, its eventual loss is divided by $\beta_t$ so it carries more weight in the final average. While standard in static pools, the authors prove novel theoretical consistency and deviation bounds for this estimator in the streaming setting, where the exact number of queried labels becomes a random variable.

What is truly new is how OAT sets $\beta_t$. By minimizing the "anticipated variance" of the risk estimator, the authors derive that the optimal sampling probability is proportional to the square root of the expected second moment of the loss ($\sqrt{\mathbb{E}[L^2]}$), rather than just the expected loss itself ($\mathbb{E}[L]$) used in prior work.

Illustration of second-moment active selection

Because true labels are unknown, OAT maintains a lightweight surrogate model $\pi(y|x)$ (like a Gaussian Process or Random Forest) to guess these loss moments, updating the surrogate online whenever a new label is acquired. For deep networks, the surrogate stays fast by running on the evaluated model's frozen latent representations. Crucially, even if the surrogate's guesses or online normalization constants are imperfect, the risk estimator remains strictly unbiased!

Datasets

No new datasets are introduced, as the focus is on evaluating models across established benchmarks:

  • Synthetic Benchmarks: 1D regression streams (Quadratic, Gaussian Process prior, Sinusoidal) and 2D classification (2-moons).
  • CellCount: Regression on $64 \times 64$ synthetic fluorescence microscopy images to count cells (1 to 200).
  • FashionMNIST: Image classification using a ResNet-18 pre-trained on a tiny 250-sample subset.
  • MELTS Fulvene: A real-world quantum chemistry dataset of sequential molecular geometries from simulation trajectories, where ground-truth energy labels require expensive electronic-structure calculations.

Key Insights and Ideas

  • Variance loves the second moment: Prior active testing methods sample proportionally to the expected loss (first moment). By deriving the exact anticipated variance online, the authors show you should actually sample proportionally to $\sqrt{\mathbb{E}[L^2]}$. Because $\mathbb{E}[L^2] = \text{Var}(L) + (\mathbb{E}[L])^2$, OAT naturally prioritizes points that have both high expected error and high loss uncertainty.
  • Safety against overconfident surrogates: If a surrogate model is poorly calibrated and overconfident, first-moment sampling can blindside you—sometimes performing worse than naive uniform sampling. Because the second-moment strategy explicitly accounts for predictive variance, skewness, and kurtosis, it acts as a natural shock absorber against surrogate errors.
  • Stop by horizon, not by budget: If you run a stream until you hit an exact label count $n_B$, your stopping time depends on the data, which mathematically breaks unbiasedness. Stopping after $T$ observed unlabelled items (controlling budget in expectation) preserves exact unbiasedness.

Key Results

Across all experiments, OAT remains empirically unbiased while shrinking estimator variance compared to uniform random sampling.

Figure 2: Online Active Testing improves risk estimation across diverse synthetic settings. Each column corresponds to a different combination of data structure, prediction model, and surrogate. Top row: regression and classification scenarios at the onset of the data stream (grey dots), showing the training data (black), the model under evaluation (red), and the surrogate model (blue). Middle and bottom rows: bias and variance of the risk estimator, respectively, as a function of the number of observations seen in the stream, for different loss functions (MSE for regression; log-loss and 0–1 loss for classification) and sampling strategies.
  • Synthetic & Image Tasks: On synthetic streams, CellCount (CNN + GP surrogate), and FashionMNIST (ResNet-18 + Random Forest surrogate), OAT consistently lowers median squared estimation error, closely tracking a label-aware oracle. On FashionMNIST with an overconfident surrogate, first-moment sampling degrades below uniform sampling, whereas OAT's second-moment strategy maintains a clear lead.
  • Quantum Chemistry (MELTS): Evaluating an ANI neural potential with a 200-label budget, OAT matches the estimation accuracy of uniform sampling using only ~35% of the labels (closing much of the gap toward the ~20% needed by a cheating, label-aware oracle). That translates directly to saving 65% of costly quantum-chemistry compute.

Limitations and Future Work

  • Single-metric focus: The optimal sampling probabilities are tailored to one specific loss function at a time, meaning you cannot simultaneously optimize the stream to evaluate disparate metrics (e.g., both accuracy and calibration).
  • Cold-start normalization: Computing exact sampling probabilities requires a normalization constant over the whole stream, which must be estimated on the fly. Early in the stream, OAT behaves mostly like uniform sampling until this estimate stabilizes.
  • Surrogate dependency: While unbiasedness is guaranteed regardless of surrogate quality, variance reduction still depends on having a reasonably capable surrogate.
  • Future directions: Extending OAT to handle non-stationary/drifting streams, learning loss moments directly via evidential deep learning (bypassing explicit surrogates), and evaluating or ranking multiple models simultaneously.

Summary updated

Abstract

We address the problem of evaluating machine learning models under a limited labelling budget in streaming environments, where data arrive sequentially. This setting is particularly critical for embedded and continuously deployed systems, such as autonomous driving or computer-aided diagnosis, where models must reliably assess their own performance online. We focus on a constrained online setting, where labelling decisions must be made immediately, and data cannot be stored. We introduce an **online active testing** (OAT) framework based on an adaptive importance sampling estimator that provides unbiased risk estimation for both regression and classification tasks. While importance sampling has been extensively studied in pool-based settings, we establish novel theoretical ground for the fully online setting, including deviation bounds and consistency guarantees. We derive an optimal sampling strategy in order to minimise the estimator's variance, which is driven by the expected second moment of the loss. This strategy is expressed for common loss functions, including mean squared error, mean absolute error, 0–1 loss, and log-loss, and analysed from a statistical perspective. We empirically demonstrate the effectiveness of OAT on synthetic benchmarks, deep learning tasks, and a real-world application involving the evaluation of machine learning models for molecular simulations, where data are generated sequentially and labels require expensive quantum chemistry computations, showing improved efficiency and reliable performance estimation under limited labelling budgets. In particular, on the real-world task, OAT requires only $\sim$35\% of labels to match the accuracy of a naïve uniform baseline, compared to $\sim$20\% for an oracle method that has access to the labels.
BibTeX
@inproceedings{schmutz2026online,
  author = {Hugo Schmutz and Hachem Kadri and Thierry Artières},
  title = {{Online Active Testing: Adaptive Importance Sampling for Unbiased Risk Estimation in Data Streams}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=AyJOqDpoNN},
}
Figure