Chapter 3 – LLMs as frontier AI systems

What is different about autoregressive, probabilistic models, and what that means for any attempt to verify them.

Consider the request “Show me all files in the current directory, including hidden ones.” BEAVER uses a toy model that answers with bash commands (Suresh et al. 2026). Its first next-token distribution is ls: 0.60, echo: 0.15, rm: 0.12, chmod: 0.05, cat: 0.05, and \langle\mathrm{eos}\rangle: 0.03. An oracle rejects any response containing rm, chmod, or /etc/passwd.

One draw returns ls with probability 0.60. Another returns rm with probability 0.12. Ten independent draws all avoid rm as the first token with probability 0.88^{10}\approx0.279, so at least one draw starts with rm with probability about 0.721. The total risk also includes responses that start elsewhere and contain rm later. Only the distribution over complete responses gives that number. This example sets the agenda: define the response distribution, understand what changes it, and see how to bound a probability without enumerating every response.

From classifiers to language models

The classifier as a baseline

Most neural-network verification tools were built for feed-forward classifiers. A classifier f:\mathbb{R}^d\to\mathbb{R}^k maps a fixed-size input, such as an image, to k logits; the prediction is their \arg\max. A perturbation is a small change measured in an \ell_p norm. A property such as “the prediction does not change” refers to one output vector.

This setting has four convenient features. One forward pass gives one answer. The input has fixed dimension and a continuous geometry. A ReLU network is piecewise affine, so bound propagation and SMT or MILP solvers can reason about a whole input region at once (Singh et al. 2025). The property refers to a single label. Classical verification exploits all four; Chapter 4 reviews the methods.

A language model breaks each feature. It maps a prompt to a distribution over variable-length text. Its inputs are discrete tokens. Its output is the result of many forward passes with random choices between them. Its properties refer to text, not logits.

The autoregressive model

Definition 1 (Language model) A language model M over a finite vocabulary \mathcal{V} with an end-of-sequence token \langle\mathrm{eos}\rangle returns, for a prompt \mathbf{p} and a response prefix t_1\cdots t_n, a distribution P_M(\cdot\mid\mathbf{p}\cdot t_1\cdots t_n) over \mathcal{V}.

A transformer computes each distribution with one forward pass (Vaswani et al. 2017). Generation samples a token, appends it, and repeats until the model samples \langle\mathrm{eos}\rangle or a maximum length L is reached. Complete responses lie in \mathcal{C}=(\mathcal{V}\setminus\{\langle\mathrm{eos}\rangle\})^*\langle\mathrm{eos}\rangle. The chain rule gives the probability of a response s=t_1\cdots t_n: \mu_{\mathbf{p}}(s) \;=\; \prod_{i=1}^{n} P_M\bigl(t_i \mid \mathbf{p}\cdot t_1\cdots t_{i-1}\bigr). Generation is a random walk down a tree of prefixes. Each edge is one token with its conditional probability; the probability of a complete path is the product of its edge probabilities.

Two identities matter for verification. Complete responses are disjoint events, so their probabilities add. Below any prefix, the total mass of all completions equals the probability of the prefix itself. In the toy model, all responses beginning with \mathrm{a} have total mass 0.5. A verifier that can decide the oracle on a prefix need not expand that subtree.

The next-token probabilities of our running toy model are:

Context \mathrm{a} \mathrm{b} \mathrm{c} \langle\mathrm{eos}\rangle
start 0.5 0.2 0.2 0.1
after \mathrm{a} 0.3 0.3 0.1 0.3
after \mathrm{b} 0.25 0.25 0.25 0.25
after \mathrm{c} 0.1 0.1 0.1 0.7

The oracle accepts a response when it never contains \mathrm{b}. A real model conditions on the entire prefix; this one uses only the last token to keep the arithmetic small. For instance, \mu(\mathrm{a}\,\mathrm{c}\,\langle\mathrm{eos}\rangle)=0.5\times0.1\times0.7=0.035. Chapter 2 reuses this model to illustrate sound bounds.

Prefill and the cost of a forward pass

Otter notes a useful property of transformer models (Wadhwa et al. 2026). One forward pass on a prompt followed by a known response prefix returns the next-token distribution after the prompt and after every token of the prefix: \text{pass on } \mathbf{p}\cdot t_1\cdots t_n \quad\Longrightarrow\quad \bigl\{P_M(\cdot\mid\mathbf{p}\cdot t_1\cdots t_i)\bigr\}_{i=0}^{n}. This is prefill. A verifier that explores many branches under a shared prefix pays for the pass once and reuses the conditionals. Generation also uses one pass per new token, so forward passes are a natural unit of cost, as in BEAVER (Suresh et al. 2026) and Otter (Wadhwa et al. 2026). Serving systems amortize real cost with caching and batching, but the count still orders verification methods. Chapter 8 exploits reuse across prompts.

Decoding is part of the system

The toy distributions are raw next-token probabilities, as in sampling at temperature 1. A deployed system usually transforms them before sampling. A decoding strategy changes each conditional distribution, and the user observes samples from the transformed distribution. Greedy decoding is the extreme case: all mass goes to the most probable token at each step.

Three transformations are common. Temperature scaling with T\in(0,\infty) replaces a logit z_t by z_t/T before softmax. Small T concentrates the distribution; large T flattens it. Top-k sampling keeps only the k most probable tokens V_k and renormalizes on them, giving zero probability elsewhere. Top-p, or nucleus sampling (Holtzman et al. 2020), keeps the smallest set V_p of highest-probability tokens whose mass is at least p, then renormalizes. BEAVER Appendix A states these transformations and notes that they define the effective distribution over which verification takes place (Suresh et al. 2026).

Truncation sets depend on the prefix, and temperature and truncation can be combined in a fixed order. Decoding therefore runs at every step and changes the distribution over complete responses in a nonlinear way. Throughout these notes, P_M denotes the effective distribution of the deployed system, held fixed during a verification run. A bound proved at temperature 1 says nothing about temperature 0.5 unless the argument covers the change. Chapter 7 states this as part of the verification problem.

The space of complete responses

A response of length n in the toy model has 3^{n-1} variants, since three tokens may appear before \langle\mathrm{eos}\rangle. The number of complete responses up to length L is \sum_{n=1}^{L}3^{n-1}=\frac{3^{L}-1}{2}. At L=6 that is 364 responses. A real model with a vocabulary of 5\times10^{4} tokens and length 100 admits about 10^{470} token sequences. No traversal can visit them.

For a prompt \mathbf{p} and oracle \Phi, the verification target is P(\mathbf{p}) \;=\; \sum_{s\in\mathcal{C}} \mu_{\mathbf{p}}(s)\,\mathbb{1}[s\models\Phi], as stated in Otter (Wadhwa et al. 2026). The sum is finite; its size is the problem. Chapter 2 explains the four ways to bound such a quantity. In outline, statistical certification draws responses and estimates the total from samples, with confidence 1-\delta (Chapters 5–6). Deterministic verification visits the most probable prefixes and bounds the unvisited mass (Chapter 7). Incremental verification reuses work across similar prompts (Chapter 8; Chapter 9).

The prefix-mass identity enables the deterministic route. The prefix \mathrm{a} has mass 0.5. If the oracle accepts every completion below it, a verifier adds 0.5 to a lower bound without expanding the subtree. If the oracle rejects every completion below it, the verifier raises the violating mass by 0.5. If the oracle cannot decide, the verifier expands to \mathrm{a}\,\mathrm{a}, \mathrm{a}\,\mathrm{b}, and so on, paying one forward pass. This is branch and bound rather than enumeration.

Access to the model

The verification method determines the required access. Three levels are common.

Access level What we receive Where it is used
Full white box Weights and next-token distributions Chapters 7–9
Distribution access Next-token probabilities for chosen prefixes, or top-k log-probabilities through an API Chapters 7 and 8
Black box Sampled text for a prompt Chapters 5 and 6

A black box returns one response per call but no token probability. Repeated calls support statistical certification for closed models behind an API (Chaudhary et al. 2025; Chaudhary, V. V. Jain, et al. 2026). They do not support a deterministic bound for one prompt. Deterministic verification needs the next-token distribution at the prefixes it chooses to expand: BEAVER obtains it by expansion (Suresh et al. 2026), and Otter by prefill (Wadhwa et al. 2026). An API that exposes only top-k log-probabilities gives partial access; the missing mass must appear in the bound. Weights alone are more than the method needs.

Access also shapes the claim. A statistical result speaks about a distribution of prompts and the randomness of responses. A deterministic result speaks about all complete responses to one prompt, without a confidence parameter. The distinction is about available information, not model size, and it is developed in Chapter 2.

Beyond text: VLMs and agents

The autoregressive model also appears inside larger systems. Vision-language models condition on images and text. Agents condition on tools, memory, and environments. Their outputs remain token sequences, but inputs and oracles now describe situations rather than single strings.

A VLM in a driving scene

Lumos defines a specification for a VLM answering questions about autonomous-driving scenes (Chaudhary, V. Jain, et al. 2026). A symbolic scene graph contains an ego vehicle, a barrier or empty road ahead, and weather states. A program samples the obstacle from a distribution and so fixes the ground-truth answer. A simulator (Scenic and CARLA) instantiates the graph as an image from the ego vehicle’s viewpoint. The VLM receives the image and a question such as “Is it necessary for the vehicle to stop here?” The oracle compares its text response with the ground truth from the graph. Figure 1 shows two scenes that this procedure produces.

Two scenes sampled for the driving specification, seen from the ego vehicle. Panel (a) has a barrier ahead; panel (b) has no barrier. The symbolic graph supplies the ground-truth answer for each scene.
Figure 1: Two sampled driving scenes from the ego vehicle’s view. Panel (a) has a barrier ahead; panel (b) has no barrier. The symbolic graph supplies the ground-truth answer. Figure from (Chaudhary, V. Jain, et al. 2026).

The image is continuous, so pixel perturbations regain a meaning. The output is still a distribution over token sequences. The input distribution is now a distribution over scenes defined by sampled graphs. Statistical certification draws scenes, runs the VLM, and bounds the satisfaction rate. The figure also shows why the label comes from the graph, not the pixels: both scenes show a rainy road, but only one requires a stop.

Agents that retrieve and select tools

An agent is a system, not one model. LLMCert-T studies a tool-selection pipeline with a retriever and a language-model selector (Yeon et al. 2026). The retriever scores a pool of tools and passes the top N to the selector, which reads their names, descriptions, and schemas and chooses one. In the paper’s example, a user asks for the area of a triangle. An inserted tool with a persuasive description enters the slate and is chosen over the legitimate one. Figure 2 shows the pipeline.

A user query reaches a tool pool. The pool contains an inserted tool with persuasive metadata (i). A retriever produces a top-N slate (ii). The selector chooses the inserted tool (iii).
Figure 2: Tool-selection pipeline of LLMCert-T: a query reaches a tool pool, an inserted tool with persuasive metadata enters the top-N slate, and the selector chooses it. Figure from (Yeon et al. 2026).

A third party can add a near-duplicate tool, edit a description, or request more privileges. The agent can fail while the model weights stay fixed. The oracle checks that the chosen tool matches user intent and declared privileges; the scenario distribution describes possible tool pools. Certification draws pools, runs the whole pipeline, and bounds satisfaction from sampled text. The verifier treats the pipeline as a black box. AgentDojo studies a related setting with environments and prompt injections (Debenedetti et al. 2024). The specification must cover the pool, the retriever, and the selector together, since a guarantee about a fixed slate ignores the first stage.

Agents in multi-turn conversations

C³LLM studies catastrophic risk across multi-turn conversations (Wang et al. 2026). Here the scenario is a whole query sequence. At turn i, the model reads the accumulated context and the next query, then returns a response. Queries are drawn as paths in a graph of semantically related prompts, shown in Figure 3. The oracle (called a judge in the paper) flags a response that reveals a harmful target. The property is temporal: it holds when some turn triggers the oracle.

A query set becomes a graph of related queries. Distributions over query sequences are defined on the graph. Each sampled sequence gives a conversation, an oracle labels the responses, and a certifier returns bounds on the probability of catastrophic risk.
Figure 3: Framework of C³LLM: a query set becomes a graph, sampled paths give conversations, an oracle labels responses, and a certifier returns bounds on catastrophic risk. Figure from (Wang et al. 2026).

Order matters. A query that looks harmless alone can become dangerous after two earlier turns. Each response is random and becomes part of the next context. Certification samples query sequences, runs the conversation turn by turn, and applies the oracle to the responses. The pattern matches the other examples: describe a scenario space, run the system, apply an oracle, and bound a probability.

What is different, and what it implies

The six differences below drive the rest of the tutorial.

  1. Outputs are distributions, not labels. One rm response shows that risk is positive, not how large it is. Verification targets P(\mathbf{p})=\sum_{s\in\mathcal{C}}\mu_{\mathbf{p}}(s)\mathbb{1}[s\models\Phi]. Chapter 7 bounds this probability for one prompt.
  2. The output space is exponential. 10^{470} sequences at length 100 rule out enumeration. Verification must sample responses or visit a small part of the tree and bound the rest.
  3. Inputs are discrete and semantic. Adding noise to a token has no meaning, and an \ell_\infty ball in embedding space does not match a user-visible change. Relevant changes are paraphrases, jailbreak prefixes, or a barrier replaced by an empty road. Specifications build distributions over such scenarios (Chapter 5).
  4. Computation is sequential. A response runs the model once per token, and each sample becomes the next input. Prefill recovers conditionals at every position of a known prefix in one pass (Wadhwa et al. 2026), which makes branch-and-bound and reuse practical.
  5. Properties come from oracles. “Does not leak an e-mail address”, “is secure code”, and “answers correctly” are properties of text. A regular expression, a static analyzer such as the Insecure Code Detector of CyberSecEval (Bhatt et al. 2023), or a model-backed judge can decide them. Harmfulness is not decidable in general, so every evaluation fixes a decidable oracle and states results relative to it.
  6. Scale and access vary. Frontier models have billions of parameters, and budgets count forward passes. Black-box APIs return text only; open-weight models expose next-token distributions. Statistical certification uses the former (Chaudhary et al. 2025; Wang et al. 2026; Yeon et al. 2026), deterministic verification the latter (Suresh et al. 2026; Wadhwa et al. 2026).

Summary

  • A language model maps a prompt to next-token distributions; autoregressive sampling induces \mu_{\mathbf{p}}(s)=\prod_i P_M(t_i\mid\mathbf{p}\cdot t_1\cdots t_{i-1}) over complete responses.
  • One prefill on a prompt and a known prefix returns all conditionals along that prefix. Forward passes are the unit of verification cost.
  • Decoding changes the effective distribution at every step. Temperature, top-k, and top-p are part of the system under verification.
  • The response space grows exponentially: 364 responses at length six in the toy model, about 10^{470} for a realistic one. Verification samples or bounds instead of enumerating.
  • Text-only access supports statistical certification over prompt distributions; next-token distributions support deterministic bounds for one prompt.
  • VLMs, tool agents, and multi-turn agents keep the autoregressive output model. Their specifications describe distributions over scenes, tool pools, and conversations.
  • The six differences—distributions, exponential spaces, discrete inputs, sequential computation, oracle-defined properties, and varied access—explain the split between statistical and deterministic methods.

Notes and further reading

The language-model definition and product formula follow Section 3 of BEAVER (Suresh et al. 2026) and Section 2.1 of Otter (Wadhwa et al. 2026). BEAVER Appendix A gives the formulas for temperature, top-k, and top-p and explains why they define the distribution to verify. Nucleus sampling is due to Holtzman et al. (Holtzman et al. 2020); the transformer is described by Vaswani et al. (Vaswani et al. 2017). RealToxicityPrompts (Gehman et al. 2020) is an example of a fixed prompt collection; a statistical treatment replaces such lists with a prompt distribution and an oracle, using intervals such as Clopper–Pearson (Clopper and Pearson 1934). Classical verification of piecewise-affine networks is surveyed in (Singh et al. 2025). Lumos (Chaudhary, V. Jain, et al. 2026), LLMCert-T (Yeon et al. 2026), and C³LLM (Wang et al. 2026) show how to write specifications for VLMs, tool agents, and conversations; LLMCert-B (Chaudhary et al. 2025) and LLMCert-C (Chaudhary, V. V. Jain, et al. 2026) cover bias and knowledge comprehension. AgentDojo (Debenedetti et al. 2024) studies agent safety in interactive environments.

References

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.
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.
Chaudhary, I., V. V. Jain, and G. Singh. 2026. “Certifying Reading Comprehension in Large Language Models.” AISTATS. https://arxiv.org/abs/2402.15929.
Chaudhary, I., V. Jain, P. Parhar, et al. 2026. “Lumos: Let there be Language Model System Certification.” arXiv Preprint. https://arxiv.org/abs/2512.02966.
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).
Debenedetti, Edoardo, Jie Zhang, Mislav Balunović, Luca Beurer-Kellner, Marc Fischer, and Florian Tramèr. 2024. “AgentDojo: A Dynamic Environment to Evaluate Prompt Injection Attacks and Defenses for LLM Agents.” NeurIPS Datasets and Benchmarks. https://arxiv.org/abs/2406.13352.
Gehman, Samuel, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A. Smith. 2020. “RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models.” arXiv Preprint. https://arxiv.org/abs/2009.11462.
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.
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.
Vaswani, A., N. Shazeer, N. Parmar, et al. 2017. “Attention Is All You Need.” NeurIPS. https://arxiv.org/abs/1706.03762.
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, C., I. Chaudhary, Q. Hu, W. Ruan, R. Gupta, and G. Singh. 2026. “How Catastrophic is Your LLM? Certifying Risks in Conversation.” ICLR. https://openreview.net/forum?id=yt9TW2WtpG.
Yeon, J., I. Chaudhary, and G. Singh. 2026. “Quantitative Certification of Agentic Tool Selection.” arXiv Preprint. https://arxiv.org/abs/2510.03992.