Skip to content

The study finds guardrail models are overconfident where base models are uncertainGuard Models Are Overconfident Where Base Models Are Uncertain

arXiv· arXiv:2609.36477· Jonghyun Hong, MinJae Jung, Minwoo Kim·Indexed by this site · 2026-10-03· Originally publishedDefenses

Quick read

Analysis and theory

Based on the paper PDF (AI-generated); refer to the original

Five guards show calibration degradation by an order of magnitude on adversarial inputs, with missed detections often being high-confidence errors; corresponding base LMs remain more uncertain on most missed detections.

Questions
Guards commonly use confidence for review thresholds, but whether these scores remain trustworthy under adversarial inputs has not been systematically examined. The authors ask: do guards that are well calibrated on clean inputs turn missed detections into high-confidence errors after jailbreak wrapping?
Methods
Five guards and their base LMs are evaluated with the same binary safe/unsafe interface (guards use native instructions, base uses 5-shot), computing confidence and ECE with a constrained softmax. Then, the KL divergence in decisions caused by attacks and the entropy difference on missed detections are compared, and disagreements are localized using layer-wise logit differences, PCA, and effective rank.
Experiments and results
On the clean set, Llama-Guard-3 and WildGuard have ECE of 0.013 and 0.004, rising to 0.308 and 0.196 on the adversarial set (Table 1). At τ=0.99, 11%–37% of adversarial harmful samples remain high-confidence FNs (Figure 2). In three of four pairs, the base has higher entropy on about 80%–93% of guard FNs (Figure 4).
Limitations and future work
The authors state that the layerwise and representation-geometry evidence is correlational, no intervention was performed, and base uncertainty was not turned into a calibration method. The main analysis excludes the Llama-Guard 7B/Llama-2 pair; response review covers only the adversarial subset that is entirely unsafe.
Experimental setupLlama-Guard 7B、Llama-Guard-2 8B et al. · HarmBench、StrongREJECT et al. · ECE、Accuracy et al.
Evaluated models
Llama-Guard 7BLlama-Guard-2 8BLlama-Guard-3 8BWildGuard 7BShieldGemma 9BLlama-2 7BLlama-3 8BLlama-3.1 8BMistral 7BGemma-2 9B
Benchmarks
HarmBenchStrongREJECTAlpacaWildGuardMix
Metrics
ECEAccuracyASR-style FN fractionKL attack shift ΔASentropy gap ΔHeffective rank
AI summaryThe study evaluates five guardrail models on prompt classification tasks, finding they are near calibrated on clean inputs, but adversarial attacks worsen calibration error by an order of magnitude, turning false negatives into high-confidence errors indistinguishable from correct detections. Comparing each guardrail model with its corresponding base LLM, the authors find that uncertainty signals often persist; base models typically show uncertainty on the same inputs where guardrails fail. Layer-wise analysis localizes this guardrail–base disagreement to later layers, where guardrails exhibit sharper safe/unsafe separation and lower-rank representations, while adversarial harmful inputs move closer to the clean-safe region. The study points to a mismatch between guardrail confidence under attack and base model uncertainty.

The study evaluates five guardrail models on prompt classification tasks, finding they are near calibrated on clean inputs, but adversarial attacks worsen calibration error by an order of magnitude, turning false negatives into high-confidence errors indistinguishable from correct detections. Comparing each guardrail model with its corresponding base LLM, the authors find that uncertainty signals often persist; base models typically show uncertainty on the same inputs where guardrails fail. Layer-wise analysis localizes this guardrail–base disagreement to later layers, where guardrails exhibit sharper safe/unsafe separation and lower-rank representations, while adversarial harmful inputs move closer to the clean-safe region. The study points to a mismatch between guardrail confidence under attack and base model uncertainty.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Guards are reasonably calibrated on clean inputs, but after adversarial wrapping, missed detections become high-confidence errors.

    When guards are used as external safety classifiers, can their confidence still support review decisions under jailbreak inputs.

    • Deployment scenario: The authors state that many pipelines use guards to make safe/unsafe decisions on prompts or responses, and often use confidence thresholds rather than binary conclusions to decide whether to allow, flag, or block. Misalignment between confidence and correctness directly affects these decisions.
    • Existing gaps: The authors state that prior work mostly focuses on whether guards can detect harmful content, not on whether their confidence is trustworthy. Liu et al. (2025) use post-hoc calibration to partially mitigate overconfidence under jailbreaks; Pinneri and Louizos (2025) focus on instability under semantically preserving rewrites. The authors believe these do not diagnose adversarial miscalibration through paired guard–base comparisons.
    • Core observation: Drawing on work such as Nakkiran et al. (2025) and Leng et al. (2025), the authors hypothesize that pretrained base LMs retain reasonably well-calibrated uncertainty, while post-training pushes confidence higher. They therefore ask: are adversarial inputs inherently ambiguous, or does the uncertainty still reside in the corresponding base.
    • What this paper does: A diagnostic analysis, not proposing a correction method. It compares five guards and their base LMs on confidence, decision shift, and layerwise representations for clean and adversarial prompts, and checks whether response review shows similar phenomena.
  2. What related research exists?

    Related work is divided into guard detection, LLM calibration, and methods that use the base model as a calibration reference.

    Guardrails and Guard Models

    • Content moderation APIs: Perspective API (Lees et al., 2022) and OpenAI moderation API (Markov et al., 2023) detect toxic content in human text. The paper states they are not designed for jailbreaks and unsafe generation in LLM interactions.
    • LLM-specific guards: Llama-Guard (Inan et al., 2023), Aegis (Ghosh et al., 2024), MD-Judge (Li et al., 2024), WildGuard (Han et al., 2024), ShieldGemma (Zeng et al., 2024) classify prompts or responses according to safety taxonomies. Evaluation benchmarks include HarmBench, AdvBench, ToxiGen, RigorLLM.
    • System-level frameworks: NeMo Guardrails (Rebedea et al., 2023) and SafeRoute (Lee et al., 2025) handle deployment routing and efficiency. The paper states this line of work focuses on whether detection is correct, not whether confidence is trustworthy.

    LLM Calibration and Uncertainty

    • Self-evaluation and post-training: Kadavath et al. (2022), Lin et al. (2022), Tian et al. (2023), Xiong et al. (2024) study LLM estimates of their own correctness. Leng et al. (2025) states post-training systematically inflates confidence.
    • Calibration on guards: Liu et al. (2025) states guards are severely overconfident under jailbreak inputs, and temperature scaling, contextual calibration, and batch calibration can partially mitigate. Pinneri and Louizos (2025) states even semantically preserving rewrites cause unstable predictions, and propose self-supervised consistency training.

    Using Base as Calibration Reference

    • Pretraining retains calibration: Nakkiran et al. (2025) states semantic calibration is a byproduct of next-token pretraining and persists under few-shot prompting. Luo et al. (2025) states pretrained representations can serve as unsupervised calibrators for post-trained models.
    • Correction methods: BaseCal (Tan et al., 2026) projects post-trained hidden states into the base's representation space; Dual-Align (Luo et al., 2026) corrects layer-wise reasoning drift between pretraining and post-training. The paper states it shares the premise that "base can serve as calibration reference," but only does diagnostic comparison, not proposing correction methods.

    Baselines and Data: Comparisons are against each guard's corresponding base LM (Llama-2 7B, Llama-3 8B, Llama-3.1 8B, Mistral 7B, Gemma-2 9B), not external defenses. Clean harmful from HarmBench and StrongREJECT, benign from Alpaca; adversarial wrapping uses GCG, AutoDAN, TAP, PAIR, AutoDAN-Turbo, and custom TextGrad attacks. Response review uses WildGuardMix.

    The authors position this paper as: diagnosing adversarial miscalibration using paired guard–base uncertainty and internal representation comparisons, and argue that guard failures reflect surface-level biases in safety judgments, not just poor calibration.

  3. How does the paper address this problem?

    Using a constrained softmax to place guard and base in the same binary interface, then comparing confidence, entropy differences, and layer-wise representations.

    Overall approach is diagnostic rather than corrective: each guard and its corresponding base LM are placed in the same binary safe/unsafe interface, first examining how adversarial wrapping changes ECE and missed-detection confidence, then whether the base remains more uncertain on the same inputs, and finally localizing disagreement using layer-wise logits and hidden-state geometry.

    Binary Interface and Calibration Definition

    • Decision method: Guards are safety classifiers built on LMs. Given a user prompt x, predict ŷ(x)∈{safe,unsafe}. This paper only does prompt classification: deciding whether the input itself should be blocked before being sent to a downstream model.
    • Constrained softmax: Classification is implemented via autoregressive generation; the model generates label tokens such as safe/unsafe or allow/block according to instructions or safety policy. Let the logits of the two labels at the decision position be z_safe and z_unsafe; then punsafe(x)=exp zunsafe/(exp zsafe+exp zunsafe), (p_{\mathrm{safe}}=1-p_{\mathrm{unsafe}}). This distribution only measures confidence in the binary decision, not absolute probability mass over the full vocabulary.
    • Confidence and ECE: Confidence c(x) is the probability of the predicted label. Clean benign is labeled safe; clean harmful is labeled unsafe; adversarial prompts, even if jailbreak-wrapped, are still labeled unsafe based on underlying harmful behavior. ECE divides confidence into B bins, taking the weighted absolute difference between accuracy and average confidence per bin.
    • Label vocabulary: Llama-Guard family uses safe/unsafe; ShieldGemma 9B and WildGuard 7B use Yes/No, each following their official instruction templates. Guards use native safety instructions and chat templates, including official policy text or taxonomy when available.

    Data, Attacks, and Base Interface

    • Clean pool: 713 harmful prompts from HarmBench and StrongREJECT, 500 benign prompts from Alpaca, totaling 1,213. Labels inherit source behavior: the former two are unsafe, Alpaca is safe.
    • Adversarial pool: Harmful prompts are subjected to GCG, AutoDAN, TAP, PAIR, AutoDAN-Turbo, and custom TextGrad attacks, yielding 3,965 adversarial harmful prompts. The paper states these attacks cover gradient-based, template-based, and LLM-based strategies.
    • Base interface: Base LMs use a 5-shot binary classification prompt with 3 safe and 2 unsafe demonstrations. The authors cite Nakkiran et al. (2025): pretrained models retain calibrated confidence under few-shot prompting. For both guard and base, confidence is computed via constrained softmax over the two label tokens at the decision position. Appendix A gives full prompts and analyzes the validity of decision tokens and robustness to using the base interface.
    • Excluding one pair: Subsequent paired analyses exclude Llama-Guard 7B/Llama-2 7B. The authors state Llama-2 has a strong unsafe prediction bias on the adversarial set.

    Attack Sensitivity and Entropy Difference

    • Decision shift: For a clean harmful prompt x and its attacked version T(x), use KL(D_M(x) ∥ D_M(T(x))) to measure shift, where D_M is Bernoulli(p_unsafe). Attack sensitivity AS is the mean of this shift over samples; gap ΔAS = AS_guard − AS_base, positive meaning guard shifts more.
    • Restriction: Only samples where both base and guard give high unsafe probability (≥ 0.9) on the clean prompt are kept, to reduce confounding from initial disagreement on clean inputs.
    • Entropy difference: Binary entropy H_M(x) is the Shannon entropy of the decision distribution over {safe, unsafe}. On samples where the guard classifies an adversarial prompt with ground truth unsafe as safe, compute ΔH = H_base − H_guard. Positive means base is more uncertain.

    Layer-wise Logits and Representation Geometry

    • Layer-wise unsafe probability: At layer ℓ, pass the hidden state at the decision position through the final RMSNorm and LM head, then apply constrained softmax over the two decision tokens to get p_unsafe^(ℓ). Compare p_base^(ℓ) − p_guard^(ℓ).
    • Two input sets: One set is clean harmful inputs; the other is adversarial false negatives, restricted to base predicting unsafe and guard predicting safe.
    • PCA: Project the last token's hidden state onto the first two principal components, fitted independently per subplot. Three classes: clean safe, clean harmful, adversarial harmful. Shown for Llama-Guard-3 and WildGuard and their bases, taking layers 3 and 30 of 32.
    • Effective rank: Following Roy and Vetterli (2007), compute effective rank from normalized eigenvalues of the centered Gram matrix. Figures compare four guard/base pairs, clean and adversarial inputs, across relative depth.
  4. What experiments did the paper conduct?

    Adversarial ECE rises by an order of magnitude for the five guards; on most FNs the base entropy is higher, and divergence appears in later layers.

    Experimental Setup

    • Models: Guards are Llama-Guard 7B, Llama-Guard-2 8B, Llama-Guard-3 8B, WildGuard 7B, ShieldGemma 9B. Corresponding bases are Llama-2 7B, Llama-3 8B, Llama-3.1 8B, Mistral 7B, Gemma-2 9B.
    • Prompt data: Clean pool of 1,213 (713 harmful from HarmBench and StrongREJECT, 500 benign from Alpaca). Adversarial pool of 3,965, obtained by applying six attacks to harmful prompts.
    • Metrics: Accuracy is whether the predicted label matches the ground truth; confidence is the probability of the predicted label; ECE is defined by the binning in Question 3. Also attack sensitivity ΔAS, entropy difference ΔH, per-layer unsafe probability difference, and effective rank.
    • Review: No external review model is used. Labels are inherited from the source behavior; adversarial samples are still labeled unsafe. The paper does not report the number of ECE bins, repetitions, or random seeds.
    • Scope of paired analysis: Pairwise analyses in Figures 3–7 exclude Llama-Guard 7B/Llama-2 7B. Response review is in Appendix D, using WildGuardMix responses; scaling analysis is in Appendix C.

    Main Results

    According to Table 1, accuracy and ECE under the same binary interface:

    Swipe horizontally to read the table

    ModelClean AccClean ECEAdv AccAdv ECE
    Llama-2 7B (base).634.275.992.051
    Llama-Guard 7B.815.142.284.578
    Llama-3 8B (base).920.023.746.034
    Llama-Guard-2 8B.939.045.478.405
    Llama-3.1 8B (base).903.037.835.062
    Llama-Guard-3 8B.979.013.597.308
    Mistral 7B (base).935.102.802.116
    WildGuard 7B.989.004.767.196

    ShieldGemma 9B has clean/adv accuracy of .622/.216 and ECE of .325/.684; its base Gemma-2 9B has .906/.930 and .084/.048 (Table 1). This pair is omitted from the table to keep the row count within limits; the numbers are written here.

    • The authors state that safety fine-tuning generally improves clean-set accuracy, but this benefit does not transfer to adversarial calibration. Llama-Guard-3's adversarial ECE rises from 0.062 for the base to 0.308; WildGuard rises from 0.004 to 0.196, smaller in magnitude but in the same direction.
    • ShieldGemma is an exception: clean accuracy is already lower than its base, which the authors view as a broader guard failure, not just an adversarial calibration effect. Llama-2 has accuracy .992 and ECE .051 on the adversarial set, which the authors state reflects a strong unsafe bias, so this pair is excluded from subsequent pairwise analyses.
    • Figure 1 shows reliability diagrams for the five guards: clean ECE values are 0.142, 0.045, 0.013, 0.004, 0.325; adversarial ECE values are 0.578, 0.405, 0.308, 0.196, 0.684. The authors state that overconfidence is concentrated in the highest-confidence bin.

    High-Confidence False Negatives

    • What was measured: The upper half of Figure 2 summarizes confidence densities for TP and FN on the aggregated adversarial harmful set. The authors state that FN densities for all five guards are concentrated toward the high-confidence end, heavily overlapping with TP, rather than concentrated near 0.5. Sample sizes annotated in the figure: Llama-Guard TP 1127, FN 2838; Llama-Guard-2 TP 1896, FN 2069; Llama-Guard-3 TP 2367, FN 1598; WildGuard TP 3040, FN 925; ShieldGemma TP 856, FN 3109.
    • Thresholds: The lower half shows the proportion of adversarial harmful samples that remain TP or FN when confidence ≥ τ. Annotated on the figure: at τ=0.99, Llama-Guard still has 17% FN (with another 47% annotated), Llama-Guard-2 has 17% and 33%, Llama-Guard-3 has 11% and 26%, WildGuard has 12% and 18%, ShieldGemma has 37% and 62%. The main text writes the FN at τ=0.99 as Llama-Guard-3 11%, WildGuard 12%, ShieldGemma 37%.
    • Authors' interpretation: The authors state that raising the threshold filters out both TP and FN and cannot remove misses alone; "abstain when uncertain" cannot recover these misses. ShieldGemma's FN confidence distribution is wider, which the authors believe reflects its low adversarial accuracy rather than reliable uncertainty.

    Attack Sensitivity and Guard–Base Entropy Difference

    • Decision shift: Figure 3 compares KL(p_clean ∥ p_adv) on the subset where both give unsafe probability ≥ 0.9 for clean prompts. Annotated ΔAS values are Llama-Guard-2 +2.23, Llama-Guard-3 +1.71, WildGuard +1.79, ShieldGemma +4.91. The authors state that when the same harmful content is only rewritten by adversarial wrapping, the guard's safety decision shifts far more than the base, so they consider guards more sensitive to surface context.
    • Entropy difference: Figure 4 gives Pr(ΔH>0) on guard FNs: Llama-Guard-2 82%, Llama-Guard-3 80%, WildGuard 93%, ShieldGemma 51%. The authors state that for the first three, the base is more uncertain on most misses; ShieldGemma is near half, consistent with the broader calibration failure described in Section 4.2.
    • Authors' interpretation: Guards are sensitive to attacks but do not correspondingly increase uncertainty when they fail; on inputs where the guard predicts safe with high confidence, the base is usually more uncertain.

    Layerwise Divergence and Representation Geometry

    • Logit difference: Sample sizes for Figure 5 are Llama-Guard-2 n=1323, Llama-Guard-3 n=1138, WildGuard n=632, ShieldGemma n=2840. The authors state that on clean harmful inputs, p_base − p_guard is near zero or slightly negative; on adversarial FNs, this difference reverses and grows in later layers, reaching approximately Llama-Guard-3 0.45, WildGuard 0.7, ShieldGemma 0.9 at the final layer. The authors state that divergence appears in roughly the last third of layers, not only at the output layer.
    • PCA: Figure 6 shows the first two principal components for Llama-Guard-3 and WildGuard and their bases at layers 3/32 and 30/32. The authors state: for the base, clean safe, clean harmful, and adversarial harmful are largely mixed together in both early and late layers; for the guard, late layers separate clean safe from clean harmful, but adversarial harmful inputs lie closer to the clean-safe side. This is the authors' interpretation of the figure; point positions are not visible in plain-text conversion.
    • Effective rank: In Figure 7, the authors state that the base-to-guard effective rank ratio in the penultimate layer is approximately Llama-Guard-2 1.4×, Llama-Guard-3 1.7×, WildGuard 3.4×, ShieldGemma 4.0×. The authors state that the compressed subspace can separate clean inputs, but adversarial harmful inputs that superficially resemble safe content fall on the clean-safe side, where the guard does not express uncertainty.

    Other Ablations and Analyses

    • Per-attack reliability diagrams: Figure 8 gives ECE for five guards × six attacks. Among readable annotations, Llama-Guard-3 has 0.01, 0.02, 0.37, 0.45, 0.39, 0.55; WildGuard has 0.01, 0.00, 0.28, 0.33, 0.15, 0.34; ShieldGemma has 0.61, 0.48, 0.72, 0.78, 0.71, 0.81. Each cell has n of 400 or 713. The plain text does not indicate which attack each ECE corresponds to, nor does it give per-attack ECE for Llama-Guard and Llama-Guard-2.
    • Response review: Appendix D measures five pairs on WildGuardMix responses. The authors state that the five guards have adversarial ECE of .346–.788 and clean ECE of .081–.182; Llama-Guard-2, Llama-Guard-3, and ShieldGemma have higher adversarial ECE than their bases. The adversarial subset contains only unsafe responses, which the authors treat as a check of harmful-response review rather than a full response-calibration evaluation, and they avoid paired conclusions for Llama-2 and Mistral because their clean accuracy is low and adversarial accuracy is near perfect, indicating a strong unsafe bias. The per-cell numbers in Table 6 are not expanded in the text read.
    • Scaling: The authors state that Appendix C checks whether guard–base patterns hold across scales. The text read does not give specific numbers for Appendix C.
    • Interface robustness: Appendix A analyzes decision-token validity and alternative base interfaces. The text read does not give numbers for these analyses.
  5. What are some points that can be further explored?

    The evidence is correlational; the authors do not turn base uncertainty into a calibration method.

    Limitations and Future Directions Noted by the Authors

    • Correlational, not causal (Limitations): The authors localize the disagreement to later layers and describe the accompanying representation geometry, but state the evidence is correlational. Logit differences, sharper safe/unsafe boundaries, and lower-rank subspaces co-occur with high-confidence failures; the authors do not intervene on these quantities.
    • Mechanism not established (Limitations): The authors state it cannot yet be shown that this geometry causes the misclassification, rather than merely co-occurring with it. Establishing mechanism requires causal intervention, such as ablation or steering of the identified directions.
    • Diagnostic only (Limitations): The authors state the work is diagnostic. Base uncertainty remains informative where guard confidence fails, but the signal is not turned into a calibration method, nor is it characterized under what conditions this gap can be closed.
    • Suggested use in conclusion (Conclusion): The authors argue guards should not be evaluated solely on detection accuracy, but also on whether confidence remains trustworthy under attack; base uncertainty is a signal that calibration-aware guardrails could use.

    Experimental Coverage

    • Main experimental models: Five guards and five corresponding base models (Section 4.1, Table 1). Paired analyses in Figures 3–7 exclude Llama-Guard 7B/Llama-2 7B (Section 4.2).
    • Prompt classification data: 1,213 clean (HarmBench, StrongREJECT, Alpaca); 3,965 adversarial, with attacks GCG, AutoDAN, TAP, PAIR, AutoDAN-Turbo, and custom TextGrad (Section 4.1).
    • Response review: Appendix D compares accuracy and ECE of five pairs on WildGuardMix responses. The authors state the adversarial subset contains only unsafe responses, so no full response calibration evaluation is performed.
    • Analysis granularity: Layer-wise analysis covers four pairs (Figures 5, 7); PCA is shown only for Llama-Guard-3 and WildGuard (Figure 6). The paper does not report the number of ECE bins or experimental repetitions.
    • Conclusions the authors state do not apply: Appendix D avoids paired conclusions for response review under Llama-2 and Mistral, because their low clean accuracy and near-perfect adversarial accuracy indicate a strong unsafe prediction bias.
  6. Summarize the main content of the paper

    Adversarial wrapping causes guards to miss detections with high confidence, while the corresponding base is often more uncertain on the same inputs.

    Diagnostic analysis: The confidence of five prompt-classification guards can be reasonably calibrated on clean inputs, but after jailbreak wrapping, it becomes high-confidence incorrect decisions.

    • Problem: Deployment often uses confidence thresholds to decide allow or block. The authors aim to distinguish whether adversarial inputs are inherently ambiguous or whether the corresponding base LM retains uncertainty.
    • Approach: Guards use native safety instructions; base uses 5-shot prompts with 3 safe and 2 unsafe examples; both apply a constrained softmax over the two decision tokens. Compare accuracy, ECE, attack-induced decision KL divergence, and entropy differences on guard false negatives; then use layer-wise unsafe probability, PCA, and effective rank to examine later-layer representations.
    • Key numbers: In Table 1, Llama-Guard-3's ECE goes from 0.013 clean to 0.308 adversarial, WildGuard from 0.004 to 0.196, ShieldGemma from 0.325 to 0.684. In Figure 2, at τ=0.99, Llama-Guard-3, WildGuard, and ShieldGemma still leave 11%, 12%, and 37% of adversarial harmful samples as high-confidence FNs, respectively. In Figure 4, the proportion of these FNs where base entropy is higher is Llama-Guard-2 82%, Llama-Guard-3 80%, WildGuard 93%, and ShieldGemma 51%.
    • Internal localization: The authors state the gap widens in later layers, with final-layer values around Llama-Guard-3 0.45, WildGuard 0.7, ShieldGemma 0.9 (Figure 5); the second-to-last layer base/guard effective rank ratio is about 1.4× to 4.0× (Figure 7). Adversarial harmful inputs are described as closer to the clean-safe side.
    • Authors' conclusion: Failure is not just input ambiguity, because base models are typically more uncertain on the same missed detections. Guards should be evaluated on both accuracy and confidence trustworthiness under attack. The authors explicitly state the geometric evidence is correlational and do not turn base uncertainty into a calibration method.

Related papers

Show 3 more papers
Read originalarxiv.org