LADE: Defending LLM Jailbreaks with Model-Agnostic Latent Safety Signals in Dark KnowledgeSafeguarding LLMs via Model-Agnostic Latent Safety Signals from Dark Knowledge
LADE uses first-token dark knowledge to filter jailbreak queries; on Llama-3, Held-out accuracy is 0.969 (Table 3).
Jailbreaks aim to bypass safety alignment and elicit harmful responses that would otherwise be refused. Main experiments cover GCG, AutoDAN, PAIR, LIAR, and DeepInception. The adaptive attack in Appendix D is white-box, where the attacker knows the signal token set, mapping, harmful reference set, and threshold. LADE only reads the target LLM's first-token probabilities and filters before generation.
- Decoding-stage defenses that tighten safety cause over-refusal and rely on internal hidden states, making cross-model transfer difficult. LADE aims to distinguish harmful from benign queries before generation without reading hidden states.
- LADE takes the top-k signals by harmful-vs-benign gap on the reference model's first-token distribution, maps them to the target tokenizer, and uses the kNN distance to the harmful reference set to filter before generation.
- The authors claim LADE reduces jailbreak compliance across multiple models; in Table 2, six of eight LLMs have the best Held-out average, except Qwen2 and Mistral. On Llama-3, Table 3 accuracy is 0.969; after adaptive attack in Table 14, it is 0.480.
- The authors point out that relying on existing alignment still over-refuses, requires first-token probabilities, and the fixed token set can be targeted by white-box attacks. Evaluation includes 6 main LLMs plus 2 13B models; guardrail comparison is on Llama-3.
- Evaluated models
- Llama-2-7B-ChatLlama-3-8B-InstructQwen2-7B-InstructQwen3-8BGemma-7B-itMistral-7B-Instruct-v0.3Vicuna-13B-v1.3Llama-2-13B-ChatGemma-7BGemma-2-9B-itGemma-3-4B-itBeaver-v3ThinkSafe-Qwen3-8B
- Benchmarks
- AdvBenchHex-PhiStrongRejectMMLUAlpacaGSM8KXSTestGCGAutoDANPAIRLIARDeepInceptionJailbreakBenchCyberSecEval 2Health-ORSC-BenchSafeLawBench
- Metrics
- compliancerefusalHeld-out Avg.classification accuracylatencyGPU memory
LADE extracts latent safety signals from the dark knowledge of the first-token output probability distribution by contrasting harmful and benign queries, constructing a safety direction that generalizes across models. The method consists of three parts: latent safety signal extraction, Tokenizer Mapping, and kNN discrimination, and can adapt to LLMs with different tokenizers. Across multiple models and benchmarks, LADE remains robust against various jailbreak attacks, reducing attack success rate while maintaining a balance between safety and utility.
Related events and news
1 events · 2 news mentions
- This event's paper
LADE:利用暗知识潜安全信号防御越狱
News that mentions this paper
LADE:利用暗知识潜安全信号防御越狱
- LADE authorscites the paper's id or linkLADE 提出基于首 token 暗知识的模型无关越狱防御
Ham and Mohit Bansal and Suhyun Kim}, year={2026}, eprint={2610.07532}, archivePrefix={arXiv}, primaryClass={cs.CR}, url={https://arxiv.org/abs/2610.07532}, }
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:决策性模型护栏也能被攻击者绕过
Safeguarding LLMs via Model-Agnostic Latent Safety Signals from Dark Knowledge(https://arxiv.org/abs/2610.07532)
Paper analysis
What problem does this paper attempt to solve?
Existing decoding defenses have two limitations: over-refusal and reliance on hidden states. LADE uses first-token dark knowledge for pre-generation filtering.
Decoding-stage defenses over-refuse when strengthening safety, and rely on internal hidden states, making them hard to transfer across architectures.
- Scenario: The authors state that LLM progress is accompanied by safety concerns, and jailbreaks can bypass guardrails and elicit harmful responses. Recent defenses have shifted to the decoding stage, using internal hidden states to steer generation away from harmful outputs.
- Limitations: The authors note that stricter safety leads to worse usefulness on benign queries, causing over-refusal; reliance on hidden states requires architecture-specific auxiliary modules, is costly, and does not generalize across diverse LLMs.
- Observation: The authors believe that beyond surface refusal tokens, the dark knowledge in the first-token distribution outside the argmax contains potential safety signals, i.e., tokens with large probability gaps between harmful and benign queries. The authors claim these signals are consistent across safety-aligned LLMs, forming an alignment-induced model-agnostic direction.
- Proposal: Proposes LADE (Latent Safety Signals for Defense). It only reads output probabilities, not hidden states, and filters queries that may elicit harmful responses before generation.
- Threat model:
- Goal: Bypass safety alignment and elicit harmful responses that the model would otherwise refuse.
- Knowledge: The adaptive attack in Appendix D is white-box; the attacker knows the signal token set, tokenizer mapping, harmful reference set, and threshold, and optimizes the distance actually used by LADE.
- Capability: The main experiments include model-specific prompts from optimization (GCG, AutoDAN, PAIR each 50, LIAR 104) and 50 fixed templates from DeepInception. The adaptive budget is 50 harmful prompts, 200 steps, and 128 candidate suffixes per step.
- Victim system: The safety-aligned open-source LLMs under test. LADE makes a single decision on their first-token output probabilities and returns a refusal before generation if the distance does not exceed the threshold.
What related research exists?
The paper compares jailbreaks, input/training/decoding defenses, and guardrail models as baselines. LADE does not read hidden states and filters before generation.
Jailbreak Attacks
- Manual Prompts: Role-playing (Shen et al., 2024) and few-shot contextual demonstrations (Wei et al., 2026), exploiting instruction following to bypass guardrails.
- Automatic Search: GCG (Zou et al., 2023) uses gradient search for adversarial suffixes; AutoDAN (Liu et al., 2024) uses genetic algorithms without human intervention.
- Semantic and Multi-turn: Cipher prompts (Yuan et al., 2024), cognitive overload (Xu et al., 2024), multi-turn strategies (Ha et al., 2025); AutoDAN-Turbo (Liu et al., 2025) uses lifelong learning to autonomously discover new strategies. The authors state these works show LLMs remain vulnerable to various adversarial prompts.
Input-Level and Training-Level Defenses
- Input-Level: Paraphrasing (Robey et al., 2023), perplexity detection (Jain et al., 2023), Self-Reminder (Xie et al., 2023). The authors state these methods often fail to block semantically rewritten adversarial inputs.
- Training-Level: Safety fine-tuning (Ouyang et al., 2022) and adversarial training (Jain et al., 2023). The authors state these improve robustness but are computationally heavy and suffer from catastrophic forgetting.
Decoding-Level Defenses
- Representative Methods: SafeDecoding (Xu et al., 2024) adjusts token probabilities with a safety expert; RDS (Zeng et al., 2025) and related layer editing (Zhao et al., 2024) use internal hidden states to suppress harmful generation; SafeInfer (Banerjee et al., 2025) adjusts hidden states and token selection during decoding.
- Authors' Criticism: The trade-off between safety and over-refusal reduces usefulness on benign queries; reliance on model-specific internal representations limits cross-architecture transfer.
Baselines and Benchmarks
- Defense Baselines: Self-Reminder, SafeDecoding, SafeInfer, RDS; guardrail models Prompt-Guard-2-86M, Llama-Guard-4-12B, WildGuard-7B.
- Queries and Attacks: AdvBench, Hex-Phi, StrongReject, MMLU, Alpaca, GSM8K, XSTest; jailbreaks are GCG, AutoDAN, PAIR, LIAR, DeepInception.
The authors state LADE does not access internal representations, only works on the output probabilities at the first decoding step, and filters harmful queries before generation begins.
How does the paper address this problem?
LADE takes the top-k signals from the reference model's first-token distribution, maps them to the target tokenizer, and uses kNN to filter before generation.
LADE extracts latent safety signals from the reference model's first-token output distribution, maps them to the target tokenizer, and uses the distance to the harmful reference set to filter before generation. It never reads internal hidden states throughout.
Extracting Latent Safety Signals
- Input: Reference model Mr and vocabulary Vr. Harmful set Dh and benign set Db come from disjoint subsets of benchmarks; in the main experiment, Dh is 253 Hex-Phi items and Db is XSTest.
- Distribution: Take the first-token distribution for query q, then compute the per-token mean µh(v) and µb(v) over each set.
- Token Selection: Algorithm 1 and Figure 2 sort by absolute gap, denoted Δ(v)=|μh(v)−μb(v)|; the typesetting of equation (3) in the main text does not show the absolute value bars. After removing special tokens and pure punctuation, keep the top-k; in the main experiment, k=500. Also store the benign means, used only for the next step's ratio calibration.
- Authors' Rationale: Selecting by raw probability is insufficient because the highest probabilities are often surface-level statements unrelated to intent.
Tokenizer Mapping
- Subword Splitting: A source token is first decoded by the reference tokenizer, then encoded by the target tokenizer. If it splits into multiple subwords, take the first meaningful subword after normalization that is not pure whitespace. This step is done once at the tokenizer level, with no LLM forward pass.
- Repeated Mapping: When multiple source tokens map to the same target token, use the slot with the largest benign mean in that group as the anchor, with anchor weight 1, and scale the others by their benign-mean ratio to the anchor. The feature value equals the weight times the target probability.
- Output: The mapping set and weights are computed separately for each target LLM. The authors state this avoids repeated source tokens over-weighting the same target probability.
kNN Discrimination
- Features: Read the probabilities at the mapped positions, multiply by weights, and apply L1 normalization. The authors state normalization removes scale differences between queries and models.
- Reference Set: Uses only the harmful queries from Section 3.1. The authors state harmful queries form a tight cluster in feature space, while benign queries vary greatly across datasets and domains.
- Threshold: Bootstrap the reference distances, take the ρ quantile of each resample, then take the median. ρ determines what proportion of the reference set falls within the threshold. In the main experiment, ρ=0.90, number of neighbors K=5, resamples B=200.
- Decision: If the average Euclidean distance does not exceed the threshold, return rejection before decoding; otherwise, pass the query to the target model. The authors compare: previous decoding defenses modify token probabilities at every generation step, while LADE performs filtering only once before generation.
Offline Configuration
- Two Stages: Offline, complete token selection, mapping, reference set construction, and threshold calibration once; online, one forward pass per query followed by kNN. Full steps are in Algorithm 1 and Appendix A.
- Reference Model: Llama-3-8B-Instruct. The authors state this choice is not strictly principled and report that the signal is insensitive to the reference model. All target models share the same extraction set, the same harmful reference, and the same hyperparameters, with no per-model tuning.
What experiments did the paper conduct?
The main evaluation covers six to eight open-source LLMs; the authors claim LADE reduces jailbreak compliance, and the Held-out average is best on six of the eight.
Experimental Setup
- Models: Llama-2-7B-Chat, Llama-3-8B-Instruct, Qwen2-7B-Instruct, Qwen3-8B, Gemma-7B-it, Mistral-7B-Instruct-v0.3; harmful/benign queries additionally include Vicuna-13B-v1.3, Llama-2-13B-Chat. Reference model is Llama-3-8B-Instruct.
- Data: AdvBench, Hex-Phi, StrongReject, MMLU, Alpaca, GSM8K, XSTest. MMLU, GSM8K, Alpaca each have 500 random samples; the rest are full sets of 520, 300, 313, 249, corresponding in order to AdvBench, Hex-Phi, StrongReject, XSTest. GCG, AutoDAN, PAIR, DeepInception each have 50 samples, LIAR has 104.
- Baselines: Self-Reminder, SafeDecoding, SafeInfer, RDS, and Prompt-Guard-2-86M, Llama-Guard-4-12B, WildGuard-7B. RDS is not evaluated on Gemma-7B-it and Mistral due to lack of pretrained EAGLE head; SafeInfer is not evaluated on 13B models.
- Metrics and Judging: Follow RDS protocol. Compliance is the number of harmful content responses, judged by Qwen3Guard-4B; refusal is the number of benign false refusals, judged by keyword detector Dic-Judge. Held-out Avg. excludes Hex-Phi and XSTest used offline.
- Implementation: k=500, ρ=0.90, K=5, B=200. Dh is 253 Hex-Phi samples, Db is XSTest, R is Hex-Phi. All targets share this configuration.
Main Results
Held-out Avg. (↓), according to Table 2. SafeDecoding and SafeInfer's same metric are in that table, not listed below.
Swipe horizontally to read the table
Model No Defense Self-Reminder RDS LADE Llama-2-7B-Chat 24.20 132.80 5.00 1.60 Llama-3-8B-Instruct 70.40 18.40 3.20 1.40 Qwen2-7B-Instruct 4.80 3.60 10.60 5.40 Qwen3-8B 3.40 4.20 4.00 3.00 Gemma-7B-it 99.60 68.40 Not reported 6.00 Mistral-7B-Instruct-v0.3 65.20 12.80 Not reported 32.60 Vicuna-13B-v1.3 9.60 9.20 19.00 3.00 Llama-2-13B-Chat 3.80 26.00 2.40 1.40 - The authors claim LADE achieves the best average on six of the eight LLMs; in the table, Qwen2-7B-Instruct and Mistral-7B-Instruct-v0.3 are not.
- Table 1 average compliance across five jailbreak types: LADE on Qwen2, Gemma, Mistral is 2.00, 15.80, 2.20, while no defense is 20.60, 47.40, 36.60. The authors claim Self-Reminder has 0 compliance on some models, but its Gemma and Mistral averages are 31.60 and 20.60.
- Exceptions: SafeInfer on Qwen2 and Qwen3 has jailbreak averages of 22.40 and 18.40, higher than no defense's 20.60 and 17.60. On Gemma, LADE still has 41/50 compliance on AutoDAN (Table 1). Mistral's Alpaca false refusal is 82, while no defense is 10. In Llama-2-13B-Chat's Full Avg., LADE is 14.00, no defense is 8.29; the authors attribute this to 89 refusals on XSTest (Table 17).
Guardrails, Transfer, and Alignment
- Guardrails: Table 3 uses Llama-3-8B-Instruct as both reference and target. Held-out average accuracy in the table is LADE 0.969, WildGuard-7B 0.947, Llama-Guard-4-12B 0.852, Prompt-Guard-2-86M 0.575; the text says 0.9689 and 0.9474. The authors claim WildGuard is better on directly harmful queries, while LADE is more robust to jailbreaks.
- Transfer: Figure 3's 6×6 average accuracy is 0.8934, 0.9413, 0.9649, 0.9660 (Split/Ratio four groups). The authors claim that using any tested LLM as reference still yields high accuracy; without Split, some results transferring to Llama-2 drop to about 0.40.
- Alignment: Table 5 average accuracy: Gemma-7B is 0.6836, Gemma-7B-it is 0.9396, Gemma-2-9B-it is 0.9474, Gemma-3-4B-it is 0.9647. The authors claim the first two differ only in alignment stage, so the signal comes from safety alignment.
Adaptive Attacks and Efficiency
- Adaptive: Table 14, Llama-3-8B-Instruct, 50 samples, 200 steps, 128 candidates per step. LADE on GCG is 1.000, after adaptive attack is 0.480 (24/50 still judged harmful); WildGuard-7B is 0.997 and 0.220 (11/50). Four-model average drops to 0.420. The authors claim this does not cover all adaptive attacks.
- Reference set evasion: Table 15, AutoDAN judged harmful proportion ranges from 42.00% to 93.50%, benign false positive from 2.22% to 5.42%. After re-optimizing against the enhanced version, accuracy drops from 0.960 to 0.480, and the original version drops to 0.240.
- Efficiency: Table 4, RTX A6000, Llama-3 as target, LADE is 34.13±3.93 ms, 14.96 GiB. Additionally tested on 60 StrongReject samples: RDS is 3,057±122 ms, SafeDecoding is 1,613±2,104 ms, LADE is 33.02±2.10 ms.
Other Ablations and Analyses
- Refusal token only (Appendix J, corresponding to Figure 4): Mistral, Qwen2, Qwen3 accuracy is 0.7599, 0.7121, 0.9311; adding latent signals gives 0.9150, 0.9745, 0.9645.
- Candidate positions (Table 6): only first/second/third positions are 0.9657, 0.9222, 0.8449; all three combined is 0.9523.
- Prefix attacks (Table 13, per-model tuning, Llama-3 as reference): six-model average all above 0.99.
- Reference model refusal proportion (Table 12): in Dh, 234/253 (92.49%) are refused; using only the 19 non-refused samples, token set overlap is 87.8%, harmful/benign still 96.52%/0.13%.
- Real benign sets (Table 16, only counting LADE filtering): 18 of 24 groups below 10%; Mistral's JailbreakBench is 28.00%, Qwen2's medical queries is 13.70%.
What are some points that can be further explored?
The authors point out that it relies on alignment, still over-refuses, requires first-token probabilities, and that a fixed token set can be evaded by adaptive attacks.
Limitations and future directions noted by the authors
- Reliance on alignment: LADE relies on the target LLM's existing safety alignment; for weakly aligned models, discrimination accuracy is lower and it cannot replace alignment. The authors consider this less important in practice because almost all publicly released LLMs undergo safety alignment before deployment (Appendix M).
- Still over-refuses: The authors state that LADE is not completely free of over-refusal; in Table 2, Mistral-7B-Instruct-v0.3 has higher refusal on Alpaca than without defense, because the harmful reference manifold overlaps with some conversational benign queries (Appendix M, Appendix K).
- Requires output probabilities: It requires the target LLM's first-token output probabilities, which may be restricted on closed APIs; the authors claim that the most likely 20 first tokens are sufficient to reproduce almost all filtering decisions (Appendix M, details in Appendix I).
- Fixed token set: The token set is fixed; an attacker who knows it can optimize inputs to evade filtering. Appendix D evaluates such adaptive attacks and a mitigation (Appendix M).
- Indirect harm: Misclassifications in Appendix K are mostly queries with indirect or context-dependent harm. The authors state that strengthening these cases requires safety alignment to explicitly cover indirect harm, and leave it as future work.
- AutoDAN failure: On Gemma-7B-it, AutoDAN pushes the first-token distribution away from the harmful reference set. The authors state that handling this failure may require later decoding positions or a larger harmful reference set, and leave it as future work (Appendix K).
Experimental coverage
- The main defense evaluation covers 6 open-source LLMs; harmful/benign queries additionally include Vicuna-13B-v1.3 and Llama-2-13B-Chat (Section 4.1, Table 2).
- Jailbreaks are GCG, AutoDAN, PAIR, LIAR, DeepInception; additionally prefix attacks (Appendix C, with per-model tuning) and white-box adaptive attacks (Appendix D, targeting Llama-3-8B-Instruct, and reporting averages over four models).
- Guardrail comparison is done on Llama-3-8B-Instruct for classification, and the paper states it does not average across multiple LLMs (Section 4.2). Compliance is judged by Qwen3Guard-4B, refusal by Dic-Judge.
- Offline, Dh is fixed as 253 Hex-Phi entries, Db as XSTest, R as Hex-Phi; Held-out Avg. excludes these two sets. Appendix I reports on three LLMs that retaining only the most likely 20 first tokens yields identical decisions to the full distribution in 6,998/6,999 cases.
- Appendix G reports Beaver-v3 and ThinkSafe-Qwen3-8B Held-out Avg. of 4.60 and 1.80. The main table does not report the number of repetitions for compliance; Appendix H compares three other automatic judges on 467 harmful responses and 3,498 benign responses, and the paper does not report human agreement.
Summarize the main content of the paper
The authors use LADE to filter harmful queries before generation and claim the best Held-out average on six of eight models.
LADE is a defense that only reads the first-token output probability, used to block queries that may elicit harmful responses before generation.
- Problem: The authors believe decoding-stage defenses have two limitations: tightening safety causes over-refusal, and reading internal hidden states is hard to transfer across architectures.
- Approach: On a reference model, compare the first-token distributions of harmful and benign queries, take the top-k tokens with the largest gap; transfer to the target tokenizer via subword splitting and repeated-mapping ratio calibration; then perform kNN against a reference set containing only harmful queries, and reject if the distance does not exceed the threshold. Main experiment reference model is Llama-3-8B-Instruct, k=500, ρ=0.90, K=5.
- Jailbreaks: In Table 1, LADE's average number of compliant responses is 2.00, 15.80, 2.20 on Qwen2-7B-Instruct, Gemma-7B-it, Mistral-7B-Instruct-v0.3. Self-Reminder is 0.00 on some models, but 31.60 and 20.60 on Gemma and Mistral. On Gemma, AutoDAN still has 41/50 compliant responses.
- Trade-off: In Table 2's Held-out Avg., the authors state LADE is best on six of eight LLMs, e.g., 1.40 on Llama-3-8B-Instruct and 6.00 on Gemma-7B-it; Qwen2 and Mistral are not, with the latter at 32.60 and Self-Reminder at 12.80.
- Comparison: With the same Llama-3 as both reference and target, Table 3's Held-out accuracy is 0.969 for LADE and 0.947 for WildGuard-7B. Figure 3(d)'s 6×6 average accuracy is 0.9660. In Appendix D, the white-box adaptive attack reduces LADE from 1.000 to 0.480.
- Authors' Conclusion: The authors state LADE does not rely on internal hidden states, works on the tested architectures without modification, and has a competitive safety–utility trade-off. Appendix M also states it depends on existing alignment, and the fixed token set can be targeted by attackers who know the mechanism.
Related papers
- Safeguards Based on Copyable Context Cannot Provide Reliable Safety for LLMsAnalysis / interpretabilityarXiv