Chapter 4 – Surrounding techniques and why they fall short

Classical neural network verification, randomized smoothing, and conformal prediction, taught with worked examples and code, and the specific reasons each does not directly give guarantees about LLM generation.

Three neighbouring techniques often enter discussions of LLM safety: classical neural network verification, randomized smoothing, and conformal prediction. Each gives a real guarantee in its home setting, and each answers a question adjacent to, but different from, the question of this tutorial: what is the probability that a response drawn from a model’s output distribution satisfies a property? Verification asks whether every input in a specified set produces an output satisfying a postcondition. Smoothing asks how far an input can move before a noise-averaged prediction changes. Conformal prediction asks how large a set of answers must be to cover the true answer on average over prompts. Formal methods say “the property holds” or give a counterexample; statistical methods attach a confidence interval or confidence level to a claim about sampled data. Our goal is stronger and more specific: a sound bound P_{LB}\le P\le P_{UB}, or a bound with declared confidence, on the oracle-satisfaction probability of a generator.

For each technique we answer the same three questions in turn: what it is, what it guarantees, and why it is insufficient for LLM generation. The monograph (Singh et al. 2025) is the reference for the first part; the BEAVER paper (Suresh et al. 2026) surveys LLM-specific certification in its related work, and the project page https://beaverframework.pages.dev/ collects the papers and code. We keep the terminology of deterministic and statistical guarantees from Chapter 2 and the account of generation from Chapter 3. We do not reproduce derivations or implementations; the sources above are the place to find them.

Part A. Classical neural network verification

What it is

Classical verification treats a trained network as a deterministic function f and asks whether a property holds on a whole set of inputs at once. A property is a pair (\phi,\psi): \phi is the precondition, often an \ell_\infty ball around a test input or a polyhedron describing a physical system; \psi is the postcondition, usually a linear inequality on output logits such as “the correct class scores above every other class”. The question is f(\phi)\subseteq\psi. Because \phi is typically infinite, the verifier cannot enumerate inputs. Abstract interpretation (Cousot and Cousot 1977) instead propagates an over-approximation through the computation. An abstract domain provides symbolic objects for sets of activations and transformers for affine and activation layers; concretization maps a symbolic object back to the concrete values it represents. A transformer is sound when the concrete image of the represented set is included in the concretization of the transformed object. The Box domain stores one interval per neuron and uses interval arithmetic, including interval bound propagation for certified training (Gehr et al. 2018; Gowal et al. 2018). Zonotopes store affine forms with shared noise symbols and so preserve linear dependencies between neurons (Singh et al. 2018; Gehr et al. 2018). DeepPoly (Singh et al. 2019) and CROWN (Zhang et al. 2018) keep interval bounds plus one linear lower and upper bound per neuron and recover dependencies by back-substitution. Nonlinear activations such as ReLU are replaced by sound relaxations; the choice of relaxation controls how much precision is lost. Figure 1 shows the two outcomes for a single-execution property.

Figure 1: A single-execution specification requires that f(x) satisfy \psi for every x\in\phi. (a) Verified: the output set lies inside \psi. (b) Counterexample: some output lies outside. Figure from (Singh et al. 2025).

What it guarantees

When the analysis ends with the over-approximated output set inside \psi, the inclusion chain f(\phi)\subseteq\gamma(A)\subseteq\psi is a proof: the property holds for every input in \phi, not merely for tested points, and the certificate can be checked independently. A concrete violating input is equally decisive: it is a counterexample. When the over-approximation is too coarse, the verifier answers “unknown”, and that answer is not evidence that the property is false. This soundness/incompleteness trade-off is the one introduced in Chapter 2. Completeness is expensive: robustness verification of feedforward ReLU networks is NP-complete (Katz et al. 2017), and no verifier decides arbitrary network properties. Constraint solvers encode each ReLU as a disjunction and search the resulting linear regions, as Reluplex does (Katz et al. 2017); branch and bound (Bunel et al. 2020) and \beta-CROWN (Wang et al. 2021) refine an incomplete bounder by splitting inputs or activations. Such methods are anytime: after each split, settled subproblems are certified and the rest remain open. The monograph (Singh et al. 2025) also covers relational properties and probabilistic extensions for Bayesian networks and stochastic latent-variable models (Berrada et al. 2021). These still describe a single execution or a distribution over weights and inputs, not a distribution over generated sequences.

Why it is insufficient for LLM generation

Generation changes the object being certified. An LLM does not return one vector but a distribution \mu_{\mathbf{p}} over sequences, and the target is the probability mass on sequences accepted by an oracle, not the value of a linear constraint on logits. Verification analyses one forward pass, whereas a response chains many passes with a random choice between them. The number of paths grows exponentially with length and vocabulary size, and decoding logic such as temperature, nucleus sampling (Holtzman et al. 2020), and stopping rules is part of the system whose probability we want; it is not a layer with an abstract transformer. Prompts are discrete, so there is no meaningful norm ball around a sentence and small embedding changes need not correspond to semantic edits. Attention combines products of variable quantities inside a softmax (Vaswani et al. 2017), which resists tight single-neuron relaxations, and approximation errors compound across layers and unrolled steps. State-of-the-art verifiers also need white-box access and lose precision at scale, often returning inconclusive results for LLMs (Chaudhary et al. 2025). White-box verification is therefore a source of ingredients — soundness, abstraction, splitting — rather than a direct solution.

Part B. Randomized smoothing

What it is

Randomized smoothing (Cohen et al. 2019) changes the object being certified. Given a base classifier f, available only through queries, define g(x)=\arg\max_{c}\Pr_{\varepsilon\sim\mathcal{N}(0,\sigma^2 I)}[f(x+\varepsilon)=c]: the smoothed classifier returns the most likely class under Gaussian perturbations of the input. The noise level \sigma trades stability against accuracy on corrupted inputs, and g is a different function from f; it is g that must be deployed for a certificate to apply. The certified-radius theorem converts a gap in class probabilities into a ball. If p_A bounds the probability of the top class from below and p_B bounds every competing class from above, then g keeps that class for every perturbation \delta with \lVert\delta\rVert_2\le R, where R=(\sigma/2)(\Phi^{-1}(p_A)-\Phi^{-1}(p_B)) and \Phi^{-1} is the inverse standard normal CDF. The argument is a Neyman–Pearson comparison of two shifted Gaussians: moving the input by \delta changes the vote probability by an amount determined by \lVert\delta\rVert_2/\sigma. The probabilities cannot be computed exactly for a network, so CERTIFY estimates them by sampling: a first batch of noisy queries selects the class, and a fresh batch supplies a one-sided Clopper–Pearson lower bound (Clopper and Pearson 1934) on its probability (Cohen et al. 2019; Ugare et al. 2024). No gradients or weights are needed. Figure 2 shows how the cost of estimating a proportion depends on the proportion itself.

Figure 2: Samples needed to estimate a binomial proportion to a fixed error at confidence 1-\alpha, as a function of the true proportion. The cost is highest near 0.5. Figure from (Ugare et al. 2024).

What it guarantees

The guarantee is conditional on the sampling. With probability at least 1-\alpha over the noise draws, if CERTIFY returns a class \hat c and a radius R, then g predicts \hat c throughout the \ell_2 ball of radius R around x. Given a correct sample bound, the claim about the ball is deterministic and covers every direction, not a finite grid. Using a separate batch to choose the class is what keeps the binomial bound valid; reusing the same samples would bias the estimate upward. If the lower bound does not exceed one half, the procedure abstains and makes no claim. Calling CERTIFY N times yields N statements each correct with probability at least 1-\alpha; the expected number of invalid radii is at most \alpha N, not zero. The radius is also limited by sample size. When all n fresh samples agree, the lower bound is \alpha^{1/n}, so no certificate can exceed \sigma\Phi^{-1}(\alpha^{1/n}) however good the classifier. Estimation is hardest when the vote is near one half, as Figure 2 illustrates; the IRS paper (Ugare et al. 2024) uses this arithmetic to plan certification cost and to study how certified results change when a model is updated.

Why it is insufficient for LLM generation

Smoothing certifies stability of a vote, not safety of a response. For a classifier that is correct on the clean input, an unchanged prediction is useful; an LLM has no single label to preserve, and a safe answer is not “the answer produced on the clean prompt”. The certificate concerns g, its radius lives in input space, and it says nothing about the probability that an unperturbed prompt produces a bad response. Even the vote hides the target quantity: collapsing responses to a binary oracle verdict and taking a majority can give a stable “safe” verdict while a large fraction of the response distribution violates the oracle. Text also lacks a Gaussian perturbation model. Self-denoised smoothing (Ji et al. 2024) asks the model to denoise corrupted inputs before predicting and reports better empirical and certified robustness; erase-and-check (Kumar et al. 2023) certifies that a safety filter does not mislabel harmful prompts under token insertions. Both certify a derived decision procedure, not the response distribution of the generator. In the BEAVER and Otter taxonomy they are statistical guarantees obtained by sampling or smoothing, rather than deterministic sound bounds on generation (Suresh et al. 2026; Wadhwa et al. 2026), and LLMCert-T notes that a smoothing distribution over natural-language metadata is undefined (Yeon et al. 2026).

Part C. Conformal prediction

What it is

Conformal prediction (Vovk et al. 2005; Angelopoulos and Bates 2021) wraps an arbitrary predictor, with no access to its internals, in a set-valued predictor. Split or inductive conformal prediction (Papadopoulos et al. 2002) holds out a calibration set of pairs (x_i,y_i) and uses a nonconformity score s(x,y) that is large when y is a poor answer for x: an absolute residual in regression, or one minus the model probability assigned to a label in classification. Compute scores on the calibration set, take the k-th smallest score with k=\lceil(n+1)(1-\alpha)\rceil, and return all candidates whose score does not exceed that quantile. The +1 accounts for the test point and makes the finite-sample statement exact. The construction is distribution-free: it assumes no parametric family for the data and no particular calibration of the score, only that calibration and test pairs are exchangeable. Its output is a set of plausible answers, not a bound on a probability of interest.

What it guarantees

Under exchangeability, the test score is equally likely to occupy any of the n+1 ranks among the calibration scores and itself. It is covered exactly when its rank is at most k, an event whose probability lies between 1-\alpha and 1-\alpha+1/(n+1). Thus 1-\alpha\le\Pr[y_{n+1}\in C(x_{n+1})]\le 1-\alpha+1/(n+1), with the probability taken over both the calibration set and the test point; with n=99 and \alpha=0.1 the promised range is [0.900,0.910]. The guarantee is marginal: it averages over prompts and calibration sets and says nothing about a particular prompt or a subgroup. Distribution-free conditional coverage is impossible for continuous inputs without further assumptions (Barber et al. 2021). Weighted or localized constructions can improve specific slices, and corrections under covariate shift require knowledge of the shift (Tibshirani et al. 2019). Exchangeability is an assumption about how data is drawn, not a property that the procedure certifies.

Why it is insufficient for LLM generation

Conformal prediction covers a true answer; LLM certification needs the probability that a sampled response satisfies a semantic oracle. These are different events. Conformal language modelling (Quach et al. 2024) calibrates a stopping rule that adds sampled outputs to a growing set, together with a rejection rule that discards low-quality candidates, and proves that the set contains at least one acceptable response with the requested probability. A set that contains a good answer with high probability is compatible with each individual answer being unacceptable with high probability; a user shown one response gets no per-response safety statement. The guarantee is also marginal over an exchangeable stream of prompts, whereas safety questions concern a specified prompt or an explicitly specified distribution that may contain adversarial prompts. Calibration further requires labelled pairs and a score for the property, which is awkward when the property is a regular expression, a code checker, or an LLM judge. The LLMCert-B paper (Chaudhary et al. 2025) draws this distinction explicitly: conformal guarantees about correctness on individual prompts do not address certification over distributions of counterfactual prompt sets.

Part D. Why none of these certifies the response distribution

Fix a prompt \mathbf{p}, a model with decoding, and a deterministic oracle \Phi on decoded text. The quantity used in the rest of the tutorial is P(\mathbf{p})=\sum_{s}\mu_{\mathbf{p}}(s)\mathbb{1}[s\models\Phi]: the probability mass on responses accepted by the oracle, where \mu_{\mathbf{p}} is induced by next-token probabilities and the decoding rule (Chapter 3, Chapter 5). The goal is sound bounds P_{LB}\le P(\mathbf{p})\le P_{UB}, or statistical bounds with a declared confidence level. The BEAVER paper (Suresh et al. 2026) states the gap in one sentence: existing neural network verifiers, including probabilistic extensions for Bayesian networks, target deterministic input–output relations and cannot handle the combination of probabilistic choice, sequential unrolling, and decoding logic specific to autoregressive generation. Four differences carry most of the weight.

The property concerns a distribution, not one output. A verifier’s postcondition is a constraint on a single output vector. Even the probabilistic properties of the monograph are fractions of an input set or distributions over weights and inputs (Singh et al. 2025; Berrada et al. 2021). Here the output is a distribution over an astronomically large sequence space, and the property is the total mass on the accepted sequences. No interval or affine form in the domains of Part A represents such a quantity.

Generation is sequential and combinatorial. Each token is a random branch, so the number of response paths grows like \lvert\mathcal{V}\rvert^L with vocabulary size and length. Decoding choices such as nucleus sampling (Holtzman et al. 2020) and stopping rules are part of the system, and attention contains a softmax over products of variable quantities (Vaswani et al. 2017). An abstraction that remembers which paths remain possible and with what probability is the distribution itself; relaxation errors multiply across layers and across unrolled steps.

Prompts are discrete and properties are semantic. There is no norm ball around a sentence and no meaningful smoothing distribution over natural-language metadata (Yeon et al. 2026). The properties we care about are written as oracles over decoded text: a regular expression for a leaked address, a static analyser for insecure code patterns such as those in CyberSecEval (Bhatt et al. 2023), a toxicity classifier, or an LLM judge. Such oracles may themselves be inaccurate (Wadhwa et al. 2026; Chaudhary et al. 2025). Relevant prompt sets are also large and structured; LLMCert-B ranges over distributions of counterfactual prompt sets, of which Figure 3 shows one member. White-box methods face a further obstacle at scale: they need model internals and often produce inconclusive results on LLMs (Chaudhary et al. 2025), which rules them out for closed-source models.

Figure 3: Two prompts differing only in a sensitive attribute, from LLMCert-B. A specification ranges over distributions of such sets and asks about the probability of unbiased responses. Figure from (Chaudhary et al. 2025).

The statistical targets differ. Smoothing and conformal prediction are statistical, but they bound the stability of a smoothed classifier or the marginal coverage of a set. Neither produces bounds on the oracle-satisfaction probability for a specified prompt or prompt distribution with declared confidence. They do supply useful machinery: Chapter 6 treats each sampled response or prompt as a Bernoulli trial for the oracle, and Chapter 7 splits the token trie to obtain sound bounds after every forward pass, an anytime procedure like the branch and bound of Part A. Specifications for those distributions and oracles are the subject of Chapter 5.

Table 1: The three techniques against the problem of this tutorial.
Verification Smoothing Conformal What LLM certification needs
System deterministic f smoothed g from f any black-box predictor probabilistic generator with decoding
Claim f(\phi)\subseteq\psi g constant in an \ell_2 ball y\in C(x) on average P_{LB}\le P(\mathbf{p})\le P_{UB}
Assumption white box, norm-bounded inputs Gaussian noise, confidence 1-\alpha exchangeable calibration oracle; declared prompt distribution
Main obstacle one output, no unrolling stability is not safety marginal, correctness not safety distribution over sequences, semantic oracle

What carries forward is a toolkit rather than a solution: sound abstraction and splitting from verification, exact binomial bounds and honest confidence accounting from smoothing and conformal prediction, and reuse of results across related problems from incremental verification and incremental smoothing (Singh et al. 2025; Ugare et al. 2024). The later chapters assemble these pieces for the generative setting.

Summary

  • Classical neural network verification proves f(\phi)\subseteq\psi for a deterministic network over an infinite input set, using sound over-approximations and, when time permits, splitting for completeness. It has no representation of a distribution over responses or of decoding.
  • Randomized smoothing gives a confidence-1-\alpha radius around an input within which the smoothed classifier’s prediction is constant. It certifies stability of a vote, not safety of generated text.
  • Split conformal prediction gives marginal coverage between 1-\alpha and 1-\alpha+1/(n+1) under exchangeability. It covers an acceptable answer on average, not the probability that a single response is safe.
  • None of the three bounds P(\mathbf{p}) for a prompt or a specified prompt distribution. The remaining chapters build sound deterministic bounds and declared-confidence statistical bounds for exactly that quantity.

Notes and further reading

Part A. The monograph (Singh et al. 2025) is the reference for the verification cycle, property specifications, abstract domains and transformers, branch and bound, and the relational, probabilistic, and incremental extensions; the original papers are AI2 (Gehr et al. 2018), DeepZ (Singh et al. 2018), DeepPoly (Singh et al. 2019), CROWN (Zhang et al. 2018), Reluplex (Katz et al. 2017), branch and bound (Bunel et al. 2020), and \beta-CROWN (Wang et al. 2021). Abstract interpretation goes back to (Cousot and Cousot 1977), and interval bound propagation to (Gowal et al. 2018). See Figure 1 for the verification outcomes.

Part B. The certified radius and CERTIFY are due to Cohen, Rosenfeld, and Kolter (Cohen et al. 2019); the statement and pseudocode are restated in the IRS paper (Ugare et al. 2024), whose discussion of binomial sample size underlies Figure 2. The one-sided interval is Clopper–Pearson (Clopper and Pearson 1934). Text-domain variants are described in (Ji et al. 2024) and (Kumar et al. 2023), and the comparison with LLM certification in (Suresh et al. 2026; Yeon et al. 2026; Wadhwa et al. 2026).

Part C. Conformal prediction is introduced in (Vovk et al. 2005), split conformal in (Papadopoulos et al. 2002), and a modern tutorial in (Angelopoulos and Bates 2021). Limits of conditional coverage are in (Barber et al. 2021) and weighted shift correction in (Tibshirani et al. 2019). Conformal language modelling is (Quach et al. 2024); Appendix H of (Chaudhary et al. 2025) contrasts it with distributional certification.

Part D. The framing follows the related work of BEAVER (Suresh et al. 2026) and Otter (Wadhwa et al. 2026), the introduction and appendix of LLMCert-B (Chaudhary et al. 2025), and LLMCert-T (Yeon et al. 2026); Figure 3 is from LLMCert-B. Probabilistic verification for stochastic networks is in (Berrada et al. 2021). The BEAVER project page is https://beaverframework.pages.dev/.

References

Angelopoulos, A. N., and S. Bates. 2021. “A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification.” arXiv Preprint arXiv:2107.07511. https://arxiv.org/abs/2107.07511.
Barber, R. F., E. J. Candès, A. Ramdas, and R. J. Tibshirani. 2021. “The Limits of Distribution-Free Conditional Predictive Inference.” Information and Inference 10 (2).
Berrada, L., S. Dathathri, K. Dvijotham, et al. 2021. “Make Sure You’re Unsure: A Framework for Verifying Probabilistic Specifications.” NeurIPS.
Bhatt, Manish, Sahana Chennabasappa, Cyrus Nikolaidis, et al. 2023. “Purple Llama CyberSecEval: A Secure Coding Benchmark for Language Models.” arXiv Preprint. https://arxiv.org/abs/2312.04724.
Bunel, R., J. Lu, I. Turkaslan, P. Kohli, P. Torr, and P. Mudigonda. 2020. “Branch and Bound for Piecewise Linear Neural Network Verification.” Journal of Machine Learning Research. https://arxiv.org/abs/1909.06588.
Chaudhary, I., Q. Hu, M. Kumar, M. Ziyadi, R. Gupta, and G. Singh. 2025. “Certifying Counterfactual Bias in LLMs.” ICLR. https://openreview.net/forum?id=HQHnhVQznF.
Clopper, C. J., and E. S. Pearson. 1934. “The Use of Confidence or Fiducial Limits Illustrated in the Case of the Binomial.” Biometrika 26 (4).
Cohen, J., E. Rosenfeld, and J. Z. Kolter. 2019. “Certified Adversarial Robustness via Randomized Smoothing.” ICML. https://arxiv.org/abs/1902.02918.
Cousot, P., and R. Cousot. 1977. “Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints.” POPL.
Gehr, T., M. Mirman, D. Drachsler-Cohen, P. Tsankov, S. Chaudhuri, and M. Vechev. 2018. “AI2: Safety and Robustness Certification of Neural Networks with Abstract Interpretation.” IEEE Symposium on Security and Privacy.
Gowal, S., K. Dvijotham, R. Stanforth, et al. 2018. “On the Effectiveness of Interval Bound Propagation for Training Verifiably Robust Models.” arXiv Preprint arXiv:1810.12715. https://arxiv.org/abs/1810.12715.
Holtzman, A., J. Buys, L. Du, M. Forbes, and Y. Choi. 2020. “The Curious Case of Neural Text Degeneration.” ICLR. https://arxiv.org/abs/1904.09751.
Ji, J., B. Hou, Z. Zhang, et al. 2024. “Advancing the Robustness of Large Language Models through Self-Denoised Smoothing.” NAACL. https://arxiv.org/abs/2404.12274.
Katz, G., C. Barrett, D. L. Dill, K. Julian, and M. J. Kochenderfer. 2017. “Reluplex: An Efficient SMT Solver for Verifying Deep Neural Networks.” CAV. https://arxiv.org/abs/1702.01135.
Kumar, A., C. Agarwal, S. Srinivas, A. J. Li, S. Feizi, and H. Lakkaraju. 2023. “Certifying LLM Safety against Adversarial Prompting.” arXiv Preprint. https://arxiv.org/abs/2309.02705.
Papadopoulos, H., K. Proedrou, V. Vovk, and A. Gammerman. 2002. “Inductive Confidence Machines for Regression.” ECML.
Quach, V., A. Fisch, T. Schuster, et al. 2024. “Conformal Language Modeling.” ICLR. https://arxiv.org/abs/2306.10193.
Singh, G., T. Gehr, M. Mirman, M. Püschel, and M. Vechev. 2018. “Fast and Effective Robustness Certification.” NeurIPS.
Singh, G., T. Gehr, M. Püschel, and M. Vechev. 2019. “An Abstract Domain for Certifying Neural Networks.” POPL. https://dl.acm.org/doi/10.1145/3290354.
Singh, G., J. Laurel, S. Misailovic, et al. 2025. “Safety and Trust in Artificial Intelligence with Abstract Interpretation.” Foundations and Trends in Programming Languages. https://doi.org/10.1561/2500000062.
Suresh, T., N. Wadhwa, D. Banerjee, and G. Singh. 2026. “BEAVER: An Efficient Deterministic LLM Verifier.” VerifAI-2 Workshop @ ICLR. https://arxiv.org/abs/2512.05439.
Tibshirani, R. J., R. F. Barber, E. J. Candès, and A. Ramdas. 2019. “Conformal Prediction Under Covariate Shift.” NeurIPS.
Ugare, S., T. Suresh, D. Banerjee, G. Singh, and S. Misailovic. 2024. “Incremental Randomized Smoothing Certification.” ICLR. https://openreview.net/forum?id=SdeAPV1irk.
Vaswani, A., N. Shazeer, N. Parmar, et al. 2017. “Attention Is All You Need.” NeurIPS. https://arxiv.org/abs/1706.03762.
Vovk, V., A. Gammerman, and G. Shafer. 2005. Algorithmic Learning in a Random World. Springer.
Wadhwa, Nalin, Brian Kim, David Shu Cheng, Isha Chaudhary, Avaljot Singh, and Gagandeep Singh. 2026. Incremental Verification of LLM Distributions (Otter). https://nalinwadhwa02.github.io/files/custom/Otter_preprint.pdf.
Wang, S., H. Zhang, K. Xu, et al. 2021. “Beta-CROWN: Efficient Bound Propagation with Per-neuron Split Constraints for Neural Network Robustness Verification.” NeurIPS. https://arxiv.org/abs/2103.06624.
Yeon, J., I. Chaudhary, and G. Singh. 2026. “Quantitative Certification of Agentic Tool Selection.” arXiv Preprint. https://arxiv.org/abs/2510.03992.
Zhang, H., T.-W. Weng, P.-Y. Chen, C.-J. Hsieh, and L. Daniel. 2018. “Efficient Neural Network Robustness Certification with General Activation Functions.” NeurIPS. https://arxiv.org/abs/1811.00866.