Safeguarding LLMs via Model-Agnostic Latent Safety Signals from Dark Knowledge

Wonjun Lee, Kyungsik Yang, Gaeun Ji, Vaidehi Patil, Haon Park, Bumsub Ham, Mohit Bansal, Suhyun Kim

TL;DR

LADE (Latent Safety Signals for Defense) is a model-agnostic framework that detects jailbreak attacks by analyzing "dark knowledge"—the subtle information hidden in an LLM's first-token probability distribution. By identifying specific tokens that act as latent safety signals, LADE filters harmful queries before generation begins, achieving superior safety with significantly less "over-refusal" of benign prompts compared to existing methods.

What Problem Does This Paper Address?

As Large Language Models (LLMs) become more integrated into our lives, protecting them against adversarial "jailbreak" attacks is critical. Current defenses generally fall into two camps, both with significant drawbacks:

  1. The Safety-Utility Trade-off: Many defenses are too aggressive, leading to "over-refusal" where the model refuses to answer perfectly safe, helpful questions (e.g., refusing a medical query because it contains the word "drug").
  2. Architecture Dependence: Many state-of-the-art decoding-stage defenses rely on a model's internal hidden states. This makes them difficult to port across different model architectures and often incurs heavy computational overhead.

The authors of this paper sought a "goldilocks" solution: a defense that is model-agnostic, computationally efficient, and maintains high helpfulness while robustly blocking attacks.

Methods

The core of LADE is the observation that safety alignment leaves a distinct "fingerprint" in the probability distribution of the very first token an LLM generates, even if the model is successfully jailbroken.

Figure 2: Overview of LADE. (1) Extracting Latent Safety Signals from Dark Knowledge selects top-k tokens from the first-token output probability distribution based on the harmful-benign distributional gap. (2) Tokenizer Mapping aligns the selected tokens with the target model’s tokenizer, using anchor-based ratio estimation to handle duplicate mappings. (3) kNN-based Discrimination classifies the query as harmful or benign based on its distance to a reference set of harmful queries, blocking harmful queries.

LADE operates in three main stages:

  1. Extracting Latent Safety Signals: The researchers contrast the first-token probability distributions of harmful and benign queries on a "reference" LLM. They identify a set of $k$ tokens (the "latent safety signals") whose probabilities differ most sharply between the two sets. This goes beyond surface-level refusal tokens like "Sorry" to include a broader range of "dark knowledge."
  2. Tokenizer Mapping: Because different LLMs use different tokenizers, LADE uses a mapping procedure to translate these signals from the reference model to a target model. It handles complexities like subword splits and "duplicate mappings" (where multiple reference tokens map to one target token) using a novel ratio-based estimation.
  3. kNN-based Discrimination: For any incoming query, LADE extracts the first-token probabilities for these mapped signals. It then uses a $k$-Nearest Neighbors (kNN) search to compare this "feature vector" against a reference set of known harmful queries. If the query is too close to the "harmful manifold," it is blocked before the model even starts generating a response.

Datasets

The authors evaluated LADE across a wide array of models and benchmarks:

  • Models: Llama-2 (7B/13B), Llama-3 (8B), Qwen2 (7B), Qwen3 (8B), Gemma-7B, and Mistral-7B.
  • Harmful Benchmarks: AdvBench, Hex-Phi, and StrongReject.
  • Jailbreak Attacks: AutoDAN, DeepInception, GCG, PAIR, and LIAR.
  • Benign Benchmarks: MMLU, Alpaca, GSM8K, and XSTest (specifically designed to test over-refusal).

Key Insights and Ideas

  • Dark Knowledge is Key: The most discriminative safety information isn't just in the top-predicted token (the argmax), but in the "long tail" of the probability distribution.
  • Safety Alignment is Universal: Latent safety signals extracted from one model (like Llama-3) transfer remarkably well to entirely different architectures (like Mistral). This suggests that safety alignment creates a shared "safety direction" in the probability space across the industry.
  • First Token Sufficiency: Surprisingly, almost all the information needed to detect a jailbreak is present in the very first token's probability distribution. This allows LADE to be a "pre-filter," saving the computational cost of generating a full (potentially harmful) response.
  • Separation via Latent Signals: As shown in Figure 1, relying only on standard refusal tokens makes it hard to distinguish between benign and jailbroken queries. Adding latent safety signals provides the "clear separation" needed for accurate defense.
Figure 1: The key idea of LADE. (Left) Latent safety signals (red points), identified by contrasting first-token probabilities between harmful and benign queries, are extracted from a reference LLM and transfer across target LLMs, while model-specific surface tokens (gray points) remain scattered. (Right) Refusal tokens capture only a small subset of safety signals and fail to separate harmful from benign queries (top), whereas adding extracted latent safety signals yields clear separation (bottom).

Key Results

  • Superior Safety: LADE consistently achieved the lowest or near-lowest attack success rates across all tested LLMs. On models like Qwen2 and Mistral, where other defenses often failed, LADE remained robust.
  • Minimal Over-refusal: LADE significantly outperformed other decoding-stage defenses in maintaining utility. For example, on Llama-2-7B, LADE's average over-refusal score was 1.60, compared to 132.80 for the Self-Reminder baseline.
  • High Efficiency: LADE is roughly 2.5x faster than Llama-Guard-4 and 16x faster than WildGuard-7B. Because it reuses the target model's own first-token forward pass, it requires very little additional memory (~15GB total for Llama-3-8B vs. ~37GB for Llama-Guard).

Limitations and Future Work

  • Dependency on Alignment: LADE relies on the existence of safety alignment. It performs poorly on "base" models that haven't undergone safety tuning, as the latent signals haven't been "baked in" yet.
  • Borderline/Indirect Harms: The system struggles with queries that involve indirect harm or context-dependent issues (e.g., specific financial predictions or medical misinformation) that current safety alignment doesn't explicitly target.
  • Adaptive Attacks: While LADE is robust, a white-box attacker who knows the specific token set being monitored could potentially craft "evasion" prompts. The authors suggest that adding these evasion examples to the kNN reference set is a promising mitigation strategy.
  • API Access: LADE requires access to first-token log-probabilities. While many providers offer this, some strictly closed APIs might limit this access (though the authors show that even the top 20 tokens are often enough for high accuracy).

Summary updated

BibTeX
@inproceedings{lee2026safeguarding,
  author = {Wonjun Lee and Kyungsik Yang and Gaeun Ji and Vaidehi Patil and Haon Park and Bumsub Ham and Mohit Bansal and Suhyun Kim},
  title = {{Safeguarding LLMs via Model-Agnostic Latent Safety Signals from Dark Knowledge}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=CIcsWVLkb3},
}
Figure