Abstract: Although Aligned Large Language Models (LLMs) are trained to reject harmful requests, they remain vulnerable to jailbreak attacks. Unfortunately, existing methods often focus on surface-level patterns, overlooking the deeper attack essences. As a result, defenses fail when attack prompts change, even though the underlying “attack essences” remain the same. To address this issue, we introduce EDDF, an Essence-Driven Defense Framework Against Jailbreak Attacks in LLMs. EDDF is a plug-and-play input-filtering method and operates in two stages: 1) offline essence database construction, and 2) online adversarial query detection. The key idea behind EDDF is to extract the “attack essence” from a diverse set of known attack instances and store it in an offline vector database. Experimental results demonstrate that EDDF significantly outperforms existing methods by reducing the Attack Success Rate by at least 20%, underscoring its superior robustness against jailbreak attacks.
The Challenge: Surface vs. Essence
Large Language Models (LLMs) are aligned to refuse harmful requests, but "jailbreak" attacks—prompts designed to bypass these safety guardrails—remain a persistent threat. Current defenses typically focus on surface-level patterns, such as specific keywords, high perplexity, or known malicious phrases.
This creates a "cat-and-mouse" game where attackers simply wrap a harmful intent in a new "surface." For example, an attacker might change a roleplay scenario from a "grandmother" to a "criminal profiler." Because the surface pattern changes, traditional filters fail, even though the underlying attack essence—the strategic logic used to trick the model—remains identical.
The Essence-Driven Defense Framework (EDDF)
EDDF is a "plug-and-play" input-filtering framework that operates in two distinct phases:
1. Offline Essence Database Construction
- Extraction: The framework uses an LLM to analyze a diverse set of known jailbreak prompts and distill them into "attack essences"—natural language summaries of the adversarial strategies (e.g., "exploit emotional vulnerability through nostalgic roleplay").
- Quality Assessment: To ensure accuracy, extracted essences undergo a four-step check: Non-Refusal, Strategy Alignment, Validation, and Abstraction.
- Vectorization: These distilled essences are converted into embeddings and stored in an offline vector database (EVD).
2. Online Adversarial Query Detection
- User Query Abstraction: When a new query arrives, the system abstracts its potential strategy.
- Vector Retrieval: It searches the EVD for the "Top-K" most similar known attack essences.
- Fine-Grained Judgment: A "Judge LLM" performs a deep intent analysis using the original query, its abstracted essence, and the retrieved examples as few-shot references to determine if the user is genuinely attempting a jailbreak.
Experimental Evaluation
The researchers evaluated EDDF using three primary data categories: original "in-the-wild" jailbreaks, a "Jailbreak Proliferation" dataset featuring eight different attack methods (e.g., Cipher, MultiLingual), and benign datasets (XSTest and Stanford Alpaca) to test for over-defensiveness.
Key Results
- Superior Robustness: On the proliferation dataset, EDDF achieved an average Attack Success Rate (ASR) of only 5.71%, significantly outperforming Llama3-Guard (42.4%) and Intention Analysis (25.41%).
- Low Over-Defensiveness: EDDF maintained a False Positive Rate (FPR) of 2.18%, ensuring it remains helpful for legitimate queries.
- Efficiency: As an input-side filter, it prevents the computational waste of generating harmful content that would otherwise be blocked by output filters.
Discussion and Future Work
EDDF demonstrates that adversarial strategies are more stable than surface-level variations. By using retrieved attack essences as few-shot examples, the framework provides the Judge LLM with a robust reference for discerning latent harmful intent.
While EDDF relies on a database of known essences, future work aims to dynamically monitor and update this database as new strategies emerge. Preliminary results also suggest that this "essence" concept can be successfully transferred to multimodal (image+text) jailbreak defenses.
Summary updated