Abstract
Jailbreak attacks exploit specific prompts to bypass LLM safeguards, causing the LLM to generate harmful, inappropriate, and misaligned content. Current jailbreaking methods rely heavily on carefully designed system prompts and numerous queries to achieve a single successful attack, which is costly and impractical for large-scale red-teaming. To address this challenge, we propose to distill the knowledge of an ensemble of SOTA attackers into a single open-source model, called Knowledge-Distilled Attacker (KDA), which is finetuned to automatically generate coherent and diverse attack prompts without the need for meticulous system prompt engineering. Compared to existing attackers, KDA achieves higher attack success rates and greater cost-time efficiency when targeting multiple SOTA open-source and commercial black-box LLMs. Furthermore, we conducted a quantitative diversity analysis of prompts generated by baseline methods and KDA, identifying diverse and ensemble attacks as key factors behind KDA's effectiveness and efficiency.
Introduction
As Large Language Models (LLMs) are increasingly integrated into critical sectors like healthcare and finance, ensuring they remain "aligned"—preventing the generation of harmful or illegal content—is paramount. Red-teaming, or adversarial testing, is the primary method for identifying these safety vulnerabilities. However, current jailbreaking techniques face two major bottlenecks: a heavy reliance on expert-crafted "prompt alchemy" and high computational costs. Many automated attacks require hundreds or thousands of queries to find a single successful jailbreak, making large-scale safety audits slow and expensive.
KDA (Knowledge-Distilled Attacker) addresses these challenges by automating the generation of diverse, coherent attack prompts. By distilling the strategies of multiple state-of-the-art (SOTA) attackers into a single open-source model, KDA can generate effective malicious prompts in seconds without manual engineering.
The KDA Framework
The core innovation of KDA is its Teacher-Student distillation framework. Instead of training from scratch, the researchers used a set of "Teacher" attackers—AutoDAN, PAIR, and GPTFuzzer—to generate successful jailbreak prompts against various target models. A "Student" model, based on Vicuna-13B, was then fine-tuned using LoRA to predict these successful prompts based on a harmful query and a specific format tag.
KDA utilizes an ensemble strategy during inference, selecting from various attack formats (e.g., social engineering, roleplay, or structural manipulation) to find the most effective angle for a specific target. This approach allows KDA to produce coherent, human-like text that is harder to detect than the gibberish strings often produced by gradient-based optimization methods. Evaluation was conducted using standard benchmarks like HarmBench and a new, curated dataset of 120 high-quality harmful queries across 12 categories.
Results and Analysis
KDA demonstrated significant improvements over existing SOTA methods in both effectiveness and efficiency. On the Llama-2-7B-Chat model, KDA achieved an 88.5% Attack Success Rate (ASR), vastly outperforming individual teacher models like AutoDAN (0.5%) and PAIR (7.5%) on the same benchmark. It achieved a perfect 100% ASR on several other open-source models.
Efficiency is a standout feature of KDA. While some optimization methods require over 1,200 seconds to find a jailbreak, KDA averaged just 36.7 seconds per successful attack on Llama-2. Furthermore, quantitative analysis using the Topic Diversity Ratio (TDR) showed that KDA generates a wider variety of attack angles than its predecessors. This diversity and the ability to generalize to unseen models, including commercial black-box models like GPT-4, underscore the robustness of the distillation approach.
Conclusion
KDA represents a significant step forward in automated red-teaming, proving that the complex strategies of multiple jailbreak attackers can be distilled into a single, efficient model. While the dual-use nature of such a tool necessitates responsible disclosure, it provides safety researchers with a powerful means to identify and patch vulnerabilities at scale. Future research will focus on "defensive distillation" to train models that can better recognize these diverse attack patterns and extending the framework to multi-modal LLMs.
Summary updated