Certifying the reliability of LLM safety judges with compressed parameter-efficient adaptations.
Large language models (LLMs) are increasingly deployed in generative workflows
For these decisions to be reliable, judges must generalise beyond their evaluation samples, while thresholded safety decisions additionally require well-calibrated uncertainty estimates. However, judges are increasingly used in safety-critical settings without formal guarantees on their performance or predictive uncertainty, while what determines their generalisation remains poorly understood.
Guardrail models are already capable safety judges, so adaptation to a new safety taxonomy or set of guidelines can be viewed as a simple refinement of their existing safety capabilities. PAC-Bayes theory provides a natural route to investigating whether simple adaptations can achieve both strong predictive performance and tight generalisation guarantees, by relating empirical performance to model complexity
Our contributions are the following:
Quantisation maps real-valued parameters \(\theta \in \mathbb{R}^p\) to a finite discrete representation \((z, s)\), where \(z\) contains the quantised values and \(s\) the reconstruction parameters, such as a scale parmater to map quantised weights back to the original model’s precision. The resulting discrete representation can be further compressed losslessly, using a compressor such as Brotli, into a binary string \(c(h)\). We define the description length of a hypothesis \(h\) as \(\lvert h \rvert := \lvert c(h) \rvert\). This reflects the minimum description length principle, an application of Occam’s razor that favours simple hypotheses that fit the data. In our PAC-Bayes certificates, shorter descriptions contribute a smaller complexity term.
Among the many bounds in the PAC-Bayes literature
The infimum is inside the bound, which holds simultaneously for all \(\lambda>0\) on a single \(1-\beta\) event. Minimising over \(\lambda\) therefore evaluates the bound without a union-bound penalty or held-out data, unlike the fixed-\(\lambda\) Catoni bound used in prior compression-based LLM analyses.
Following prior work
Let a fixed generator \(G\) define a distribution over responses \(y\) to prompts \(x \sim \mathbb{P}_{\mathcal{D}}\), inducing a joint distribution \(\mathbb{P}_{\mathcal{D},G}\) over prompt–response pairs. Here fixed refers to the fact that the generator weights, decoding procedure, system prompt, and prompt distribution remain unchanged between certification and deployment. Let \(z^*(x,y) \in \{0,1\}\) indicate whether a pair satisfies the evaluation criterion, which the judge \(h\) seeks to emulate. We define the judge’s risk with respect to \(\mathbb{P}_{\mathcal{D},G}\) as
\[\mathcal{R}_{G}(h) := \mathbb{E}_{(x,y)\sim \mathbb{P}_{\mathcal{D}, G}}\big[\ell(h(x,y), z^*(x,y))\big].\]In line with prior compression-based analyses, we restrict attention to deterministic posteriors \(\mathbb{Q}_h = \delta_h\). Since safety systems typically deploy a single fixed judge to monitor a given generator, this lets the certificate apply directly to the deployed judge without requiring Gibbs sampling from a stochastic posterior.
For a point-mass posterior under the Solomonoff prior, the KL divergence is upper-bounded by the Elias \(\delta\) code length of \(h\),
\[\mathrm{KL}^{\mathrm{UB}}(\mathbb{Q}_h \,\|\, \mathbb{P}_{\mathrm{Sol}}) = \Bigl(|h| + \lfloor\log_2|h|\rfloor + 2\bigl\lfloor\log_2(\lfloor\log_2|h|\rfloor + 1)\bigr\rfloor + 1\Bigr)\log 2,\]and substituting this into the Catoni bound yields a computable certificate. With probability at least \(1-\beta\) over \(S \sim (\mathbb{P}_{\mathcal{D}, G})^n\), simultaneously for all judges \(h\),
\[\mathcal{R}_{G}(h) \leq \inf_{\lambda>0} \left\{ \frac{1}{1 - e^{-\lambda/n}} \left[ 1 - \exp\left(-\frac{\lambda \widehat{\mathcal{R}}_S(h) + \mathrm{KL}^{\mathrm{UB}}(\mathbb{Q}_h \| \mathbb{P}_{\mathrm{Sol}}) + \log \frac{2+\sqrt{2n}}{\beta}}{n} \right) \right] \right\}.\]The certificate thus bounds the risk of the deployed judge under \(\mathbb{P}_{\mathcal{D},G}\). Its tightness reflects a trade-off between the empirical performance and simplicity of the learned judge. No assumptions are made on the learning algorithm itself, with the judge trained conventionally before its adaptor is quantised and compressed for certification.
The Solomonoff prior assigns greater prior probability to hypotheses with shorter descriptions, formalising an Occam’s razor-style preference for simpler hypotheses. Our hypothesis class is accordingly the set of PEFT adaptations of a frozen oversight model. As in standard PEFT, every adaptor targets all linear layers in each transformer block, namely the attention and MLP projections, replacing each frozen weight matrix \(W_0\) with an adapted \(W\). We consider a sequence of progressively smaller updates, from LoRA
| Adaptor | Update to each weight matrix | Trainable parameters |
|---|---|---|
| LoRA | \(W = W_0 + BA\) | \(B\in\mathbb{R}^{d\times r},\ A\in\mathbb{R}^{r\times k}\) per weight matrix |
| LoRA-XS | \(W = W_0 + U\Sigma R V^\top\) | \(R\in\mathbb{R}^{r\times r}\) per weight matrix |
| LoRA-TN | \(W = W_0 + U\Sigma\big(\sum_{i=1}^u v_i P_i\big)V^\top\) | \(\mathbf{v}\in\mathbb{R}^{u}\) per weight matrix |
| LoRA-TT | \(W = W_0 + U\Sigma\big(\sum_{i=1}^u v^{(\ell)}_i P_i\big)V^\top\) | \(\mathbf{v}^{(\ell)}\in\mathbb{R}^{u}\) per layer, shared by all its weight matrices |
| LoRA-GT (ours) | as LoRA-TT | as LoRA-TT, quantised with one scale shared across all layers |
Here \(U\), \(\Sigma\) and \(V\) come from the singular value decomposition (SVD) of \(W_0\) and, together with the fixed random matrices \(P_i \in \mathbb{R}^{r\times r}\), remain frozen during training. LoRA-TN and LoRA-TT are the non-tied and weight-tied variants of LoRA-T. In LoRA-TT, each weight matrix in layer \(\ell\) keeps its own frozen \(P_i\) but shares the trainable vector \(\mathbf{v}^{(\ell)}\).
LoRA-GT (ours). LoRA-GT keeps the LoRA-TT update and changes only how it is quantised. Under \(b\)-bit quantisation of LoRA-TT, the per-layer scales stored in bfloat16 cost \(16L\) bits, dominating \(\lvert h \rvert\) for small \(u\) and \(b\). At \(u{=}1\), \(b{=}2\) on Llama-Guard-3-8B (\(L{=}32\)), the weights require only 64 bits while the scales require 512. Sharing a single global scale across layers, what we introduce here as LoRA-GT, removes \((L-1)\times16\) bits of this metadata, taking the total from 576 to 80 bits, an 86% reduction, and leaves the complexity term set more by the weights themselves than by reconstruction overhead.
| Llama-Guard-3-8B, \(u{=}1\), \(b{=}2\) | Weights | Scales | Total |
|---|---|---|---|
| LoRA-TT: one scale per layer | 64 bits | 512 bits | 576 bits |
| LoRA-GT: one shared scale | 64 bits | 16 bits | 80 bits |
Our main results cover five safety oversight models from two guardrail families, Llama Guard 3 at 1B and 8B
Figure 2 shows non-vacuous guarantees under both 0–1 and Brier loss across models, datasets, and adaptor families. Notably, this extends to Egida and OpenAI Moderation with only 792 and 1,344 certification samples, demonstrating certification in the common limited-data regime. The Brier results further provide guarantees on the quality of the predictive probabilities used for thresholded safety decisions.
The strongest certificates consistently come from the simplest adaptations. LoRA-GT is tightest in all 40 model–dataset–loss cases, while standard LoRA is vacuous in every case. This continues even on BeaverTails with \(n\approx300\)k, showing that large certification samples alone do not ensure tight guarantees.
Certificate tightness closely tracks adaptor description length across models and datasets. The description-length ordering, LoRA, LoRA-XS, LoRA-TN, LoRA-TT, then LoRA-GT, matches the certificate ordering in 39 of 40 model–dataset–loss cases, despite the large variation in backbone scale. Adaptation complexity is therefore a stronger determinant of certificate tightness than backbone scale.
Greater compression can weaken predictive performance, although the effect is modest in many settings. On BeaverTails, for example, quantised LoRA-GT has 2.1 to 6.7 points higher 0–1 test risk than LoRA, while its certificate falls from 1.000 to between 0.169 and 0.226.
Let \(h\) and \(\tilde h\) denote a fine-tuned judge and its quantised version, respectively. We define functional distortion as the change in risk caused by quantisation:
\[\Delta_G(h,\tilde h) = \mathbb{E}_{(x,y)\sim\mathbb{P}_{\mathcal{D},G}}\!\left[\ell(\tilde h(x,y),z^*(x,y))-\ell(h(x,y),z^*(x,y))\right].\]Compression tightens certificates when the complexity savings from shorter adaptor descriptions outweigh any increase in empirical risk stemming from functional distortion introduced through quantisation.
The trade-off between complexity savings and functional distortion depends on the certification sample size. Mean LoRA-GT certificates under 0–1 loss favour 2 bits on Egida and OpenAI Moderation, but 4 bits on Aegis and BeaverTails. The complexity penalty depends on \(\lvert\tilde h\rvert/n\), so on these larger benchmarks further compression saves less, and the added functional distortion at 2 bits loosens the certificate.
Our results show that simple PEFT updates can adapt capable safety judges to new safety data while retaining strong predictive performance and admitting tight generalisation guarantees. These guarantees fit within a standard fine-tuning pipeline. The adaptor is trained conventionally and certified post hoc, without constraining the learning algorithm or requiring a separate validation split. The full labelled sample can therefore be used for adaptation and certification, which is particularly relevant when safety data are scarce.
Limitations. Our guarantees apply to the generator-induced deployment distribution from which the certification data are drawn. Changes to the generator, decoding configuration, system prompt, or prompt distribution constitute distribution shift
We formalised PAC-Bayes certification for safety judges evaluating outputs from a fixed deployed generator. Across five guardrail models and four benchmarks, tailored PEFT yielded non-vacuous, often tight guarantees for both classification and Brier risk, including in small-data regimes and without a separate held-out validation set. Certificate tightness tracked adaptation complexity more closely than backbone scale, with LoRA-GT giving the tightest certificates in all 40 model–dataset–loss cases. These results show that simple, compressible adaptations can make formal certification practical when specialising safety judges to new taxonomies with scarce labelled data.
@inproceedings{lamb2026tight,
title = {Tight {PAC}-{Bayes} Generalisation Guarantees for Large Language Model Judges},
author = {Lamb, Tom A and Torr, Philip H S and Rudner, Tim G J},
booktitle = {Advances in Neural Information Processing Systems},
year = {2026}
}