Paper commentary
Controlling the Probability of Unknown Unknowns in Pre-Deployment Testing of AI Systems
A betting test tells developers when pre-deployment testing has covered enough
- Problem Pre-deployment tests catch known failure modes but can't reveal unseen ones, so developers have no sound rule for when to stop testing and deploy.
- Method The authors build a betting process that bounds the chance of an unseen failure after each session, and testing stops once the bound drops below a threshold.
- Results On SWE-Chat coding agent traces, the bound was substantially tighter than both Good-Turing baselines, including one that is not anytime valid.

Figure 6 : Our method remains valid under an online embedding-based failure novelty rule , where a failure is considered unseen when its failure-mode description is insufficiently similar to all previously observed failures under the online embedding-based matching rule. (a) Anytime-valid upper bound on the unseen-failure probability, together with the true unseen-failure probability defined by the same online novelty rule. Solid line is the mean, shaded bands show 2.5th-97.5th percentiles across trials. (b) Empirical simul- taneous coverage through time t. Coverage remains above the nominal level 1 − α = 0 .95 throughout the evaluation horizon.
Original paper · CC BY 4.0 · Rachel Li, Chris Hays, Aaditya Ramdas, Manish Raghavan · Controlling the Probability of Unknown Unknowns in Pre-Deployment Testing of AI Systems · Original paper figure · Extracted the figure area from page 48 of the original PDF.Why stopping a test campaign is hard
A developer can patch the failure modes an audit has already surfaced, but no patch covers a failure nobody has seen yet. AI systems can fail in many ways, because the set of behaviors and actions they may take is very large. Pre-deployment audits, such as feeding the system past user requests or recruiting beta testers, surface failure modes but can't promise completeness.
So the developer must decide, at some point, that the chance of meeting an unobserved failure is small enough to release.
The real question becomes how long to audit, and the paper treats this as the core measurement challenge. The authors frame it as a sequential variant of the Good-Turing missing mass problem, where observation and estimation alternate. Good-Turing gives a classical answer, but it is built for a fixed sample size. Its guarantees hold at a fixed time, so a bound checked after every session needs more than that.
Stopping depends on the data, so the bound must stay valid at an arbitrary, data-dependent stopping time. A bound valid only at a fixed time can't be checked repeatedly while preserving statistical validity. The target also moves: the missing mass decreases over time and depends on the history, so the null hypothesis eventually turns false.
Software testing work applies Good-Turing in a batch setting without anytime validity, while Colombi et al. bound the maximum probability mass rather than the sum.
Betting on a shrinking missing mass to get anytime-valid bounds
The authors treat the problem as a sequential version of missing-mass estimation, where new outputs arrive and the bound is updated between them. The target is the remaining unseen-failure probability, the chance that the next output contains a failure unlike any earlier one. A tolerance epsilon and a miscoverage level alpha define the goal: a stopping time T with P(R_unseen_T < epsilon) at least 1 minus alpha.
Anytime validity matters because the developer stops at a data-dependent time, and a fixed-time bound can't be checked repeatedly without losing validity.
The method borrows anytime-valid testing ideas, in which a gambler bets that the missing mass lies below a threshold. Evidence against the null hypothesis grows the gambler's capital, while evidence consistent with it shrinks the capital. Early on the missing mass is high, so the gambler loses money. Once the missing mass drops below the gambler's threshold, the gambler wins, and the large wealth is strong evidence against the large-missing-mass hypothesis.
The betting process Mt is a mixture of component processes that start at different times, which the authors call a warm start. The mixture hedges because the number of early sessions needed before betting is unknown, so later starts get slowly decreasing weight. Algorithm 1 then inverts Mt into the upper confidence sequence Ut(alpha).
The usual supermartingale argument doesn't carry over directly, because the gambler is expected to win eventually. The authors rely on the monotone decrease of the target, so an upper bound on past draws also bounds future draws. That monotonicity is what lets earlier sessions inform later decisions, and it would fail for arbitrary parameter changes.
How Algorithm 1 runs each session
Each round draws a fresh input Xt independently from the target distribution P and runs the AI system on it. The output At is then checked by the failure indicator fail and by the unseen indicator against the history Ht-1 of earlier failed outputs. Only when fail(At) equals 1 is At added to the history, so the set of observed failure modes grows over time.
The unseen indicator must be monotone in H, so adding failures to the history can't make a seen failure look unseen again.
For a candidate threshold u, each session multiplies a factor 1 + λ(u − fail(Ai)·unseen(Ai, Hi-1)) into a running product. The product E^λ_{s:t}(u) starts at a chosen warm-start session s and runs through the current session t. Here λ sets how large each bet is: larger λ makes wealth grow faster when the missing mass is below ε, and decay faster when it is above.
The betting process Mt(u) averages these products over λ in [0, 1] and over warm-start times. Each warm-start time s gets weight ωs, and a tail term sums the weights for starts after t. The bound Ut(a) is the supremum of thresholds u in (0, 1) with Mt(u) below 1/a, so it is the largest threshold the wealth has not yet ruled out. Mixing over warm-start times matters early on, because many new failures may appear first and a single product would shrink too fast.
The uniform mixture over λ is approximated by a fine, evenly spaced grid, which the authors motivate by universal portfolio theory.
The loop stops at the first session where Ut(α) falls below the chosen threshold ε. In the empirical evaluations, the confidence sequence from inverting Mt is tighter than the one from E1:t, so it stops earlier. Theorem 3.2 states that Ut(α) bounds the missing mass simultaneously over all t with probability at least 1 − α. A fixed-sample Good-Turing bound has a deterministic width, while this bound adapts to the observed data.
What the guarantees cover
Theorem 3.2 gives a simultaneous guarantee: with probability at least 1 − α, the missing mass stays below Ut(α) at every time t. Because the statement covers all time steps at once, a developer who checks the bound after each session doesn't invalidate it. The bound is data-dependent, so its width changes with the sequence of observed data rather than being fixed in advance.
The authors note that this fixed width can be loose when their data-dependent procedure can achieve substantially tighter bounds.
Theorem 3.3 says the procedure stops almost surely, so a developer can rely on it eventually halting. For any γ below ε, the stopping time T is at most Tγ plus a term of order log((Tγ + 2)/β), with probability at least 1 − β. Integrating this high-probability delay over β gives an expected delay of O(log(Tγ + 2)). The proof uses Lemma A.1, which shows the missing mass eventually drops below γ, and the fact that Mt(ε) then grows exponentially fast.
The big-O hides dependence on α and ε − γ, so the constants depend on those choices.
Theorem 3.4 gives lower bounds for any procedure with the same coverage requirement, in the case of infinitely many failure modes. The first lower bound says that some distribution makes the expected delay after the missing mass drops below ε arbitrarily large. The second lower bound says that no procedure can stop within an additive logarithmic factor of the time the missing mass drops below γ.
The authors say these hard instances are where long delays must come from, since trivial or coarse fail and unseen definitions allow faster stopping.
The guarantees depend on unseen being monotone in the failure history: adding failures to H can't make a seen failure look unseen. Monotonicity is what keeps the missing mass from rising, so the paper's betting argument keeps working. Proposition 3.1 says that for a countable output space, the true unseen-failure probability is nonincreasing and converges to zero almost surely.
Because A is countable, the sampling can run long enough that a new unsafe behavior has arbitrarily small probability, so stopping eventually happens. Countability is necessary here: with an uncountable sampling space, unseen events could keep positive probability bounded away from zero.
Extensions for task shift and imperfect labels
When tasks come from a sampling distribution Q_t rather than the target P, the betting factor gets reweighted by the propensity ratio. The reweighted factor is 1 + λ(u − (P(X_t)/Q_t(X_t)) fail(A_t) unseen(A_t, H_{t−1})), so each sampled session is scaled back toward the target distribution. The propensity ratio must be known and uniformly bounded above by B, with B at least 1.
The authors restrict λ to at most 1/B, which keeps the betting process a nonnegative supermartingale. Inverse propensity weighting keeps the betting process valid because the reweighted indicator stays unbiased for the target quantity. The sampling policy can be adaptive, for example by prioritizing task categories that have been tested less.
A simple way to meet the bound is to mix an arbitrary sampling policy with P, giving P weight 1/B.
A cheap LLM judge can miss true failures, and that would make the missing mass look smaller than it is. Naively inserting such a labeler into Algorithm 1 could invalidate the statistical guarantee. Algorithm 2 follows prediction-powered inference, using ground-truth label audits to build a debiased estimator of the unseen-failure probability.
That debiased estimator lets the betting process stay a nonnegative supermartingale, with λ restricted to a proper range. Algorithm 3 instead builds a probably approximately correct labeler that explicitly controls for labeler error. The authors adapt the B-PAC algorithm from Yu et al. (2026) for this second approach.
That bound combines with the original guarantee in a statistically valid way. Both extensions also add the missing mass betting construction from Algorithm 1 and adaptive task sampling. Imperfect labeling needs one more weak condition: every true failure must have a positive chance of being audited at each round, bounded below by a constant.
Without that condition, the labeler could systematically miss failures, and the missing mass couldn't be bounded from the observed sequence. The PAC extension also requires that true successes can't be counted as new failure modes, even when the labeler flags them.
The two approaches trade off statistical efficiency and labeling cost in different ways. PAC labeling splits ε to account for labeler error, and splits α between the two sources of violation.
SWE-Chat results against Good-Turing baselines
The authors start from 5,001 agent sessions in SWE-Chat after preprocessing, each with metadata, transcripts, tool calls, and an LLM-judged success score. They first keep the 1,033 sessions whose original success score falls below 70 as candidate failures. A newer judge, GPT-5.6 Sol, then checks each candidate for concrete failures, because the original scores don't name specific agent failures.
Sessions scoring 70 or higher receive fail(A) = 0 without further checking.
The same judge writes a failure description for each session, and the authors embed and cluster these descriptions into 538 categories. A failure counts as unseen when its category hasn't appeared yet, and the taxonomy stays fixed for every method. Each of the 1000 trials treats the 4,961 test sessions as the target distribution and samples them with replacement.
The true missing mass of failures starts near 0.15 and slowly falls below 0.1 over the run. The anytime-valid bound sits well below the simultaneous Good-Turing bound, which is valid over the whole horizon. It also sits well below the pointwise Good-Turing bound, which is valid only at a prespecified sample size. The authors attribute the gap to variance adaptivity: their procedure tracks the observed variance of the unseen failure indicator as samples arrive.
The Good-Turing baseline instead uses a fixed width set by sample size and confidence level alone. That fixed width means the pointwise bound cannot in general support data-dependent stopping with statistical guarantees.
On SWE-Chat, empirical simultaneous coverage of the anytime-valid bound reaches 0.973 through t = 3000. Both Good-Turing baselines reach coverage of 1 in the same run, so that comparison concerns tightness rather than validity. For the worst-case check, every failure is unseen and the missing mass equals 0.05 for all t. The shaded bands in the coverage plot show the 2.5th to 97.5th percentiles across trials.
Checking coverage under a worst-case distribution
The authors stress the guarantee with a deliberately unfavorable distribution, where most sessions succeed and the rest reveal new failures. With probability 0.95 the session is successful, and with probability 0.05 it contains a failure mode that hasn't been observed before. Every observed failure mode is therefore new, so the unseen-failure probability stays fixed at 0.05 for all t.
The construction can be read two ways: as a fixed taxonomy whose failure mass spreads over K categories as K grows, or as a history-dependent rule whose similarity threshold approaches 1.
Across 10,000 trials, simultaneous coverage plateaus at 0.9587 under this distribution. That value sits above the nominal level of 1 − α = 0.95, so the guarantee holds in this stressed case. After 10,000 samples, coverage is still decreasing, so it approaches the nominal level from above. The authors report the shaded band as ±2 standard errors around the curve.
The authors flag that their empirics serve to validate the methodology, so they don't mirror real pre-deployment testing closely. They use public data, a fixed failure taxonomy, and LLM judges for labeling, which helps reproducibility and comparison with baselines. Those choices are in tension with ecological validity, because developers would run the procedure on private data with human labels.
Limitations of the guarantees and the empirical support
The guarantees and the usefulness of the method depend on how fail and unseen are defined. If the developer wants to find failures that fall outside existing mitigations, unseen(A, H) must capture whether those mitigations also prevent the failure in A. The framework doesn't weigh the cost of failures, so a rare, high-impact failure can cause harm the sampling can't address.
The authors describe this as a limit of any sampling-based approach when the harm can be unbounded. An infinitesimally unlikely event that causes unbounded harm can't be bounded by sampling, because it is statistically undetectable.
The SWE-Chat experiments use publicly available data, a fixed failure taxonomy and LLM judges for failure labeling. These choices help reproducibility and the comparison with Good-Turing baselines, but they are in tension with ecological validity. The taxonomy in the main experiments is fixed, while the method also supports an online, history-dependent unseen rule.
The empirical coverage on the synthetic distribution is about 0.96 after 10,000 samples, still decreasing, against a nominal 0.95.
Future work could model whether to keep observing a single trajectory, which would save inference and time costs. The paper also points to a guarantee over unseen outcomes that accounts for trajectories that were never observed in full. Another open direction is dependence across swarms of interacting agents, which would require modeling their dependence structure.
A multi-armed bandit-style formulation for several models at once is also left for future study.
Paper info
- Authors
- Rachel Li, Chris Hays, Aaditya Ramdas, Manish Raghavan
- Venue
- arXiv · Preprint
- First published
- 2026-11-11
- Added
- 2026-11-13
- Updated
- 2026-11-11
- Version
- v1
- arXiv
- 2611.15835
- Category
- cs.AI · cs.CY · math.ST
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
In pre-deployment testing of AI systems such as AI agents, a developer can often deal with known failure modes (e.g., leaking API keys, deleting important databases, or installing a malicious package) by implementing fixes or making contingency plans for when the same issue might occur again. What is more challenging are the unknown unknowns: the unseen failure modes that haven't surfaced during testing. The decision to stop testing and deploy therefore faces an inherent tradeoff: continue testing to observe more behaviors, at the cost of time and resources, or stop testing and deploy, at the risk of failure modes remaining undiscovered. How then does the developer decide when they have tested enough? To answer this, we develop an algorithm that certifies when the probability of observing an unseen failure mode is sufficiently small. The algorithm constructs an anytime-valid upper confidence sequence on this quantity, so the developer can repeatedly test a system, inspect the bound, and decide to stop when it falls below a chosen threshold without invalidating the statistical guarantee. Our problem can be interpreted as a sequential variant of the missing-mass estimation problem which gave rise to the classic Good-Turing estimator (Good, 1953). On SWE-Chat, a dataset of real-world coding agent traces (Baumann et al., 2026), we implement our procedure and show that it achieves tighter upper bounds than a simple multiple-testing corrected Good-Turing baseline, and even dominates a fixed-horizon (non-multiple-testing-corrected) Good-Turing upper confidence bound, which is not anytime valid. Additionally, to better match realistic evaluation pipelines, we extend our method to handle sampling from a different task distribution and imperfect automated failure labeling.
Figures from the paper

Figure 7 : Our method remains valid under set-valued failure observations, where a single session may contain multiple distinct failure modes. (a) Anytime-valid upper bound on the unseen-failure probability, together with the true unseen-failure probability under the set-valued novelty rule (a session is unseen if it contains at least one failure mode that has not been observed previously). Solid lines show the mean across trials, and shaded bands show the 2.5th–97.5th percentiles. (b) Empirical simultaneous coverage through time t. Coverage remains above the nominal level 1 − α = 0.95 throughout the evaluation horizon.
Original paper · CC BY 4.0
Figure 8 : Robustness to an alternative LLM-based fixed taxonomy. We repeat the main statistical evaluation using a second fixed taxonomy constructed by an LLM-based grouping procedure rather than the clustering-based taxonomy used in the main results. (a) Anytime-valid upper bound on the unseen-failure probability, together with the true missing mass and the simultaneous and pointwise Good-Turing UCBs. Solid lines show the mean, and shaded bands show the 2.5th-97.5th percentiles across trials. (b) Empirical simultaneous coverage through time t. Our method remains above the nominal level 1 − α = 0.95 throughout the evaluation horizon; both Good–Turing bounds achieve coverage of 1.
Original paper · CC BY 4.0
Figure 9 : Sensitivity to the choice of betting parameter λ. We compare the finite-grid mixture used in the main results with fixed choices λ ∈ { 0.1, 0.25, 0.5}. (a) Anytime-valid upper bounds on the unseen-failure probability together with the true missing mass. The grid mixture performs similarly to the fixed- λ alternatives across the evaluation horizon. (b) Empirical simultaneous coverage through time t. All choices remain above the nominal level 1 − α = 0.95 throughout the evaluation horizon.
Original paper · CC BY 4.0
Figure 10 : Minimal benefit of restart-mixing on SWE-Chat. We compare the restart mixture (solid purple) with a non-restarted betting process (dotted green), using the same equally weighted grid of 100 lambda values and α = 0 .05. Left: mean upper confidence bounds across 1,000 paired trials, with shaded bands showing the empirical 2.5th97.5th percentiles; black denotes the true unseen-failure probability. Right: empirical simultaneous coverage, which is 0.973 with restarts and 0.971 without restarts through 3,000 draws, both above the nominal 0.95 level. Restarting yields modestly tighter bounds on this dataset.
Original paper · CC BY 4.0Quote from the paper
Rachel Li, Chris Hays, Aaditya Ramdas, Manish Raghavan (2026). Controlling the Probability of Unknown Unknowns in Pre-Deployment Testing of AI Systems. arXiv:2611.15835v1. https://arxiv.org/abs/2611.15835v1
BibTeX
@misc{li2026controlling,
title = {{Controlling the Probability of Unknown Unknowns in Pre-Deployment Testing of AI Systems}},
author = {Rachel Li and Chris Hays and Aaditya Ramdas and Manish Raghavan},
year = {2026},
eprint = {2611.15835},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.15835v1}
}