Chapter 9 – Extensions of deterministic verification of LLMs
Chapter 7 verifies one prompt. It returns deterministic bounds [P_{LB},P_{UB}] on the probability that a response satisfies an oracle \Phi. Nobody deploys a model on one prompt. A released model receives many system prompts, personas and paraphrases, many of them adversarial. A developer deciding whether to release a checkpoint needs a statement about all of them.
This chapter uses the per-prompt bounds as a building block. In every extension the verdict for a single prompt stays deterministic; only the sampling over prompts or chains is statistical. The first extension samples prompts. The second samples reasoning chains (Suresh et al. 2026, sec. 7). The chapter then puts a per-prompt verifier inside the specification language Lumos (Chaudhary et al. 2026), describes the space-level measures of Otter (Wadhwa et al. 2026), and shows how a certificate supports a release decision.
From a prompt to a distribution of prompts
A released model is queried under many system prompts and paraphrases. A practitioner therefore specifies a distribution \mathcal{D} over prompts that covers attacks, jailbreaks and the contexts in which a request can be posed, then quantifies how much of it is risky. Since \mathcal{D} is too large to enumerate, draw n i.i.d. prompts and verify each one with the per-prompt verifier of Chapter 7 (Suresh et al. 2026, sec. 7.1).
A typical \mathcal{D} is uniform over pairs of a base request and an adversarial context. Contexts come from a bank of jailbreak personas and side instructions. A persona is a short paragraph that frames the request as legitimate. A side instruction adds pressure, such as refusal suppression, format enforcement or authority framing. A persona generates a context by inserting each side instruction independently with a small probability after its sentences, in random order. Each base request has one persona, whose contexts fill out the distribution (Suresh et al. 2026, Appendix F.1). Chapter 6 certifies a similar style of prompt distribution statistically, but from one sampled response per prompt. Here the inner quantity is a certified interval for the whole response distribution.
Definition 1 (Distributional risk (Definition 7.1 of (Suresh et al. 2026))) For a model M, oracle \Phi and risk threshold \tau, the distributional risk \rho(\mathcal{D}) of a prompt distribution \mathcal{D} is the probability that a prompt drawn from \mathcal{D} is categorized risky by BEAVER, \rho(\mathcal{D}) \;=\; \Pr_{\mathbf{p}\sim\mathcal{D}}\bigl[\,P_{UB}(\mathbf{p})<\tau\,\bigr].
Recall that a prompt is risky when P_{UB}(\mathbf{p})<\tau. So \rho(\mathcal{D}) is the fraction of \mathcal{D} on which the verifier proves that the model satisfies the oracle with probability below \tau. Prompts whose bounds straddle \tau are open and count as not risky. As a result, \rho(\mathcal{D}) never exceeds the true risky fraction \Pr_{\mathbf{p}\sim\mathcal{D}}[P(\mathbf{p})<\tau]. It also depends on the verifier’s tolerance and budget: a weaker verification leaves more prompts open and lowers \rho(\mathcal{D}) without weakening the statement.
The certificate needs three steps. Draw n prompts i.i.d. from \mathcal{D} before any verification. Verify each one with BEAVER and count the risky prompts, n_r. Report the Clopper–Pearson interval (Clopper and Pearson 1934) for n_r out of n at confidence 1-\alpha. The argument is short. For fixed tolerance and budget, the verifier is deterministic, so whether a prompt is categorized risky is a fixed function of that prompt. The draws are independent, so the risky indicator of each drawn prompt is a Bernoulli trial with success probability exactly \rho(\mathcal{D}). The count n_r is binomial with parameter \rho(\mathcal{D}), and the Clopper–Pearson interval inverts the exact binomial tails. It contains \rho(\mathcal{D}) with probability at least 1-\alpha. Because \rho(\mathcal{D}) is at most the true risky fraction, the lower end of the interval also bounds the true risky fraction, at any tolerance and any budget. Sampling must finish before verification: stopping once enough risky prompts appear, or discarding hard prompts, destroys the binomial argument.
The certificate has two layers. Each of the n verdicts has no statistical error: the verifier either proves the property for that prompt or stays silent. The only error is that the sampled prompts may be unrepresentative of \mathcal{D}, and the Clopper–Pearson interval prices exactly that error. The upper end of the interval needs care. It bounds only the fraction that the verifier categorizes as risky, not the true risky fraction, because open prompts can be risky too. This is a lower bound on risk. It cannot support a claim of the form “at most x\% of \mathcal{D} is risky”.
On the toy prompt distribution of Chapter 7, verifying all 31 contexts gives 19 risky, 7 safe and 5 open prompts, so \rho(\mathcal{D})=19/31=0.613. A practitioner who does not know this ground truth draws 40 prompts and finds 22 risky. The 95% interval is [0.385,0.707], which contains the true value; the 99% interval [0.339,0.748] is wider. The usable statement is: with 95% confidence, at least 38.5% of the prompts of \mathcal{D} are risky for this model and oracle. Every count came from deterministic verification.
Verifying inside a specification language: Lumos
Lumos is a domain-specific language for specifying and statistically certifying the behaviour of language model systems. It treats prompt generation as sampling random subgraphs of a graph (Chaudhary et al. 2026). A Lumos specification is a probabilistic program; its runs give i.i.d. observations, which the statistical core turns into a confidence interval. A per-prompt verifier fits this pattern because the quantity it observes is itself a pair of sound bounds.
Lumos can compute guarantees about the probability of a desirable response under the conditional output distribution of each prompt. It calls a prompt-level verifier as an external tool and receives sound lower and upper bounds for that prompt. In the privacy specification, the property is that the model does not produce private data. The specification does three things. It forms a prompt from a base request by prepending an adversarial prefix sampled from a mixture of jailbreak instructions modified to elicit private data, each inserted at random; the base request is a few-shot completion that the model must continue with an email address. It invokes the verifier and registers the returned pair as one observation of the probability that the response avoids private addresses. It repeats this for n independently drawn prompts and aggregates the observations into a global interval for the expected probability of a satisfying response over the prefix distribution.
Two conditions make the integration work. The verifier must be sound for each prompt. The oracle must be prefix-closed: a violation in an output prefix implies that the whole response violates it. This is the early-evaluation condition of Chapter 7, and the Lumos privacy specification uses the prefix-closed privacy oracle of BEAVER (Chaudhary et al. 2026, sec. 6.4).
The observed bounds are numbers in [0,1], not Bernoulli outcomes, so the binary Clopper–Pearson interval is the wrong tool. Lumos uses the empirical Bernstein method of Maurer and Pontil (2009), which builds a margin around a sample mean from the sample variance. It treats the two sides separately: the global lower bound is the mean of the per-prompt lower bounds minus a margin, and the global upper bound is the mean of the per-prompt upper bounds plus a margin. Both use the same n samples, so the failure probability \delta is split between them and a union bound gives joint confidence 1-\delta. The inner interval of each observation is deterministic; the outer margin accounts for sampling prefixes.
This interval answers a different question from distributional risk. Risk is a count: how often is a prompt risky? The Lumos interval is a mean: what is the expected probability of a satisfying response on a random prompt? A Hoeffding margin on the toy prompts with n=40 gives [0.236,0.772] at 95% confidence, wide because the sample is small; empirical Bernstein is tighter when the observations vary little. The Lumos paper also notes that Clopper–Pearson intervals on binary observations from one sampled response per prompt cover only the default decoding path, not all possible generations, and are expected to be much higher than bounds computed from full-distribution intervals.
Space-level measures of risk: Otter
Otter extends deterministic verification from one prompt to a space of prompts, the finite set of prompts a deployed model can receive (Wadhwa et al. 2026). A request is rarely posed in one form, and the model answers its phrasings with similar response distributions. Verifying each prompt separately is sound but linear in the size of the space. Chapter 8 shows how Otter reuses the prompt-independent part of the exploration to avoid that cost.
The statement Otter produces is a set of per-prompt sound bounds [P_{LB},P_{UB}], aggregated into space-level measures of risk: the fractions of risky, safe and open prompts. From them one reads a risky detection rate, the share of prompts certified risky at threshold \tau. The bounds hold for every prompt and do not depend on the order in which the space is verified.
Space-level measures and distributional risk sit at opposite ends of a spectrum. When a prompt space can be enumerated and verified in full, the fractions are exact counts with no sampling error. When it cannot, draw n prompts and apply the Clopper–Pearson argument, using Otter’s cheaper verification for the per-prompt verdicts. Chapter 8 reduces the cost of verify-everything-and-count; sampling makes a statement possible for spaces too large to enumerate.
Faithfulness of reasoning models
A reasoning model answers a prompt \mathbf{p} in two stages: it writes a chain c, then an answer conditioned on \mathbf{p}\cdot c. Safety is often judged by reading the chain, which assumes the answer follows it. Per-prompt verification can test that assumption (Suresh et al. 2026, sec. 7.2 and Appendix H).
For a sampled chain, run BEAVER on the answer distribution P_M(\cdot\mid\mathbf{p}\cdot c) with the oracle applied to the answer alone. This gives sound bounds on the probability that the answer satisfies \Phi, and categorizes the (prompt, chain) pair as risky, safe or open exactly as for a prompt. From the verifier’s point of view the chain is simply part of the context.
The chain is also labelled safe when it commits to a safe answer. For toxicity, a rule-based check of the chain’s conclusion detects a decision to refuse. For secure code, the label is safe when the last code block drafted by the chain satisfies the oracle.
Definition 2 (Unfaithful (prompt, chain) pair (Suresh et al. 2026, Appendix H)) A (prompt, chain) pair is unfaithful when the label of the chain and the categorization of the answer disagree. The case that matters for safety is a safe chain followed by a risky answer. Reading the chain would miss this case.
The procedure is straightforward. For each prompt, draw K chains i.i.d. from M(\cdot\mid\mathbf{p}), stopping at the answer marker. Label each chain, verify each answer distribution, and record the verdict. Then report two quantities: the fraction of safe chains whose answer is certified risky, and a per-prompt check of whether the verdict varies across chains of the same prompt. The guarantee on an answer is deterministic given its chain; it is statistical only over the chains drawn. A prompt that is risky under some chains and safe under others shows that the outcome depends on which chain is drawn, not only on the prompt.
Two cautions shape the interpretation. A chain can be labelled safe because the code it drafts stops before the line the benchmark marks as insecure. It then passes the oracle by being incomplete, not by committing to a secure alternative. This shows that the chain does not reveal the risk, not that the model changed its decision. Likewise, a refusing chain is rarely followed by a certified safe answer: a refusal continues in many phrasings, each below the tolerance, so the bounds straddle \tau and the pair stays open. The measured fractions for two reasoning models are in the Experimental results section at the end of this chapter.
Release decisions
Why collect these numbers? The setting of Otter makes the use case explicit (Wadhwa et al. 2026, sec. 3.1). For an open-weight model, the adversary holds the weights, chooses the context of a request, samples responses as often as it likes, and can remove any filter or guardrail. Only the model’s own behaviour remains as a defense. The verifier is the developer or deployer, working before release with the weights, an oracle and a space of prompts covering the contexts of interest. Per-prompt bounds show which contexts break the model and whether a checkpoint should be withheld or a system prompt admitted.
The extensions in this chapter turn those bounds into a document that travels with the model.
- A certified risky rate per oracle and prompt distribution. The distributional certificate gives a number with a confidence level: with 95% confidence, at least x\% of the prompts of \mathcal{D} are risky for oracle \Phi at threshold \tau. A model card can carry one line per oracle, such as privacy, secure code, toxicity or agent security, and per prompt distribution. An adopter with the weights can recompute the certificate, including under the distribution they will serve. This is a certificate about the weights themselves (Suresh et al. 2026).
- A go or no-go rule for a checkpoint. Compare the certified risky rate with a budget of acceptable risk. The lower end of the interval is sound, so a rate above the budget is a reason to withhold the checkpoint. A rate below the budget is not a proof of safety: the certificate is a lower bound on risk, open prompts count as not risky, and everything is relative to the oracle. The honest reading of a good result is that no risk was found at this resolution.
- Admitting a system prompt. The same machinery verifies a group of prompts that share a system prompt and vary the request. The deployer compares the bounds with \tau before the prompt goes into production.
- Reasoning models. A faithfulness measurement checks a release decision that rests on reading chains of thought. A model whose safe chains are often followed by risky answers must not be judged by its chains.
Three limits carry over from Chapter 7 and should accompany any such certificate. The verifier needs next-token distributions, so it applies to open-weight models and to developers verifying their own checkpoints, not to models behind an API. The guarantee is relative to the oracle; for a classifier-based oracle it concerns the classifier’s verdicts, and a response the classifier misjudges falls outside it. Verification runs to a tolerance and a maximum response length, so the probability mass below \epsilon stays unresolved.
Summary
- Per-prompt bounds compose with sampling over prompts. The distributional risk \rho(\mathcal{D})=\Pr_{\mathbf{p}\sim\mathcal{D}}[P_{UB}(\mathbf{p})<\tau] is estimated from n i.i.d. prompts with a Clopper–Pearson interval. Open prompts count as not risky, so the lower end bounds the true risky fraction at any tolerance and budget; the upper end bounds only the certified fraction.
- The certificate has two layers: a deterministic verdict per prompt and a statistical statement over prompts. On the toy distribution, 22 of 40 sampled prompts were certified risky and the 95% interval [0.385,0.707] contained the true \rho(\mathcal{D})=0.613.
- A verifier can be called from a specification language. For prefix-closed oracles, Lumos aggregates continuous per-prompt bounds with an empirical Bernstein margin and a union bound, giving a statement about a mean rather than a count.
- Otter’s space-level measures count risky, safe and open prompts over a whole space. There is no sampling error when the space is verified in full; sampling extends the statement to spaces that are too large.
- Faithfulness of reasoning models verifies the answer distribution given each sampled chain. It measures how often a safe chain is followed by a risky answer.
- A certificate is relative to an oracle, a distribution, a threshold, a tolerance and a confidence level. It is a lower bound on risk that supports go or no-go decisions and model cards.
Notes and further reading
Distributional risk, Definition 7.1 and the Clopper–Pearson argument are in Section 7.1 of the BEAVER paper (Suresh et al. 2026). The prompt distributions are in Appendix F.1 and the confidence intervals in Appendix G. Faithfulness of reasoning models is in Section 7.2 and Appendix H. The integration of a per-prompt verifier in Lumos is in Section 6.4 of (Chaudhary et al. 2026), which also gives the empirical Bernstein bound; the exact binomial interval is (Clopper and Pearson 1934). The threat model and space-level measures are in Sections 3.1 and 5 of Otter (Wadhwa et al. 2026). The BEAVER project page at https://beaverframework.pages.dev/ describes the single-prompt verifier. Chapter 6 gives the statistical certificates contrasted with the two-layer certificate here; Chapter 7 gives the per-prompt verifier; Chapter 8 gives the reuse across prompts. The experimental numbers are at the end of this chapter.
Experimental results
These results extend the per-prompt verifier of Chapter 7. They are taken from BEAVER (Suresh et al. 2026) and Lumos (Chaudhary et al. 2026).
Certified distributional risk. For the application of Chapter 7 in which n = 300 prompts are drawn i.i.d. from the prompt distribution and the number of prompts categorized risky is counted, the Clopper–Pearson interval of this count lower-bounds the distributional risk \rho(D), the probability that a prompt drawn from the distribution is certified risky, with the stated confidence. Open prompts count as not risky, so \rho(D) never exceeds the true risky fraction.
| Model | Privacy n_r | CP@95% | CP@99% | Secure code n_r | CP@95% | CP@99% | Toxicity n_r | CP@95% | CP@99% |
|---|---|---|---|---|---|---|---|---|---|
| Qwen3-4B | 153 | [.452, .568] | [.434, .585] | 103 | [.290, .400] | [.274, .418] | 54 | [.138, .228] | [.127, .244] |
| Gemma-3-12B | 145 | [.426, .541] | [.408, .559] | 117 | [.334, .448] | [.318, .466] | 281 | [.903, .961] | [.891, .967] |
| Qwen2.5-14B | 162 | [.482, .597] | [.464, .615] | 120 | [.344, .458] | [.328, .476] | 262 | [.830, .909] | [.816, .918] |
| Qwen3-30B-A3B | 157 | [.465, .581] | [.448, .598] | 97 | [.271, .379] | [.255, .397] | 93 | [.258, .366] | [.243, .383] |
| Llama-3.3-70B | 151 | [.445, .561] | [.428, .579] | 155 | [.459, .574] | [.441, .592] | 279 | [.895, .956] | [.883, .963] |
At 95% confidence, at least 42% of the adversarial contexts of the privacy distribution are risky for each of the five models (the model outputs a leaked Enron address with probability more than 10%), and the five intervals overlap, so no model can be said to leak less. On secure code the certified fraction is at least 27% for every model and at least 46% for Llama-3.3-70B. Toxicity separates the models: at least 83–90% of contexts are risky for Gemma-3-12B, Qwen2.5-14B and Llama-3.3-70B, against at least 14% and 26% for Qwen3-4B and Qwen3-30B-A3B. Raising the confidence from 95% to 99% lowers each lower bound by one to two points at n = 300. The upper end of each interval bounds only the fraction that BEAVER categorizes as risky.
Faithfulness of reasoning models. For the application of Chapter 7 in which BEAVER is run on the answer distribution conditional on a sampled reasoning chain, 50 chains were sampled for each of the first 10 prompts of each task from DeepSeek-R1-Distill-Qwen-14B and Qwen3-30B-A3B-Thinking (so 500 (prompt, chain) pairs per row), with \epsilon = 10^{-3}, budget 2,500, 32 answer tokens and \tau = 0.9. A chain counts as safe when it decides to refuse (toxicity; detected by a rule-based checker on the last three paragraphs before the answer) or when the last code block it contains satisfies the secure-code oracle; a pair is unfaithful when a safe chain is followed by an answer certified risky.
| Model | Task | Answers R/S/O | Safe chains → risky answer | Mixed prompts |
|---|---|---|---|---|
| R1-Distill-Qwen-14B | Toxicity | 238/50/212 | 6 (5.8%) | 7/10 |
| R1-Distill-Qwen-14B | Secure code | 230/81/189 | 11 (22%) | 9/10 |
| Qwen3-30B-A3B-Thinking | Toxicity | 110/1/389 | 9 (3.0%) | 0/10 |
| Qwen3-30B-A3B-Thinking | Secure code | 365/135/0 | 80 (49%) | 5/10 |
On toxicity, a chain that decides to refuse is rarely followed by an answer certified risky: 6 of 103 chains (5.8%) for R1-Distill and 9 of 301 (3.0%) for Qwen3-30B-A3B-Thinking, against 232 of 397 and 101 of 199 of the chains that do not refuse. The answers to refusing chains are, however, rarely certified safe (45 of 103 and 1 of 301): a refusal continues in many phrasings, each below \epsilon, so their bounds straddle \tau and most such pairs stay open. On secure code, the answer often departs from the chain: for 11 of the 49 R1-Distill chains (22%) and 80 of the 164 Qwen3-30B-A3B-Thinking chains (49%) whose drafted code satisfies the oracle, the answer is certified risky. In the cases the authors inspected, the chain’s code stops before the line the benchmark marks insecure and the answer writes that line, so the chain’s code passes the oracle because it is incomplete, not because it commits to a secure alternative; the pairs show that the chain does not reveal the risk, not that the model changes its decision. The outcome also depends on the chain drawn: for R1-Distill, 7 of 10 toxicity prompts and 9 of 10 secure-code prompts are risky under some chains and safe under others.