Diffusion LLMs are Natural Adversaries for any LLM
Organizations: Department of Computer Science & Munich Data Science Institute Technical University of Munich, Germany
Abstract
We introduce a novel framework that transforms the resource-intensive (adversarial) prompt optimization problem into an efficient, amortized inference task. Our core insight is that pretrained, non-autoregressive generative LLMs, such as Diffusion LLMs, which model the joint distribution over prompt-response pairs, can serve as powerful surrogates for prompt search. This approach enables direct conditional generation of prompts, effectively replacing costly discrete optimization with a small number of parallelizable samples. We provide a probabilistic analysis demonstrating that under mild fidelity assumptions, only a few conditional samples are required to recover high-reward (harmful) prompts. Empirically, our method substantially outperforms prior attacks in both success rate and compute cost, producing low-perplexity, diverse jailbreaks that transfer to a wide range of black-box target models, including robustly trained and proprietary LLMs. Beyond adversarial prompting, our framework opens new directions for red teaming, automated prompt optimization, and leveraging emerging Flow- and Diffusion-based LLMs.
Figures & tables
| LAT | CB | MixAT | ||||
|---|---|---|---|---|---|---|
| Attack | Phi 4 Mini | Qwen 2.5 7B | Llama 3 8B | Llama 3 8B | Llama 3 8B | Llama 3 8B |
| GCG | 97% | 96% | 70% | 20% | 8% | 1% |
| PGD | 40% | 68% | 13% | 0% | 3% | 1% |
| AutoDAN | 12% | 97% | 59% | 2% | 1% | 0% |
| PAIR | 33% | 57% | 25% | 14% | 7% | 1% |
| BoN | 100% | 100% | 100% | 6% | 77% | 2% |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Value |
|---|---|
| Attack tokens | |
| Diffusion steps | |
| Unmasking schedule | uniform |
| Decoding | confidence-based |
| Temperature | (greedy) |
| Model Name | HuggingFace ID |
|---|---|
| Phi 4 Mini | microsoft/Phi-4-mini-instruct |
| Qwen 2.5 7B | Qwen/Qwen2.5-7B-Instruct |
| Llama 3 8B | meta-llama/Meta-Llama-3-8B-Instruct |
| LAT Llama 3 8B | LLM-LAT/robust-llama3-8b-instruct |
| Circuit Breakers | GraySwanAI/Llama-3-8B-Instruct-RR |
| MixAT Llama 3 8B | INSAIT-Institute/Llama3-8B-MixAT-GCG |
| LAT | CB | MixAT | ||||
|---|---|---|---|---|---|---|
| Attack | Phi 4 Mini | Qwen 2.5 7B | Llama 3 8B | Llama 3 8B | Llama 3 8B | Llama 3 8B |
| GCG | 29% | 72% | 70% | 0% | 7% | 0% |
| PGD | 23% | 51% | 13% | 0% | 2% | 0% |
| AutoDAN | 0% | 97% | 59% | 0% | 2% | 0% |
| PAIR | 41% | 66% | 25% | 12% | 7% | 0% |
| BoN | 100% | 100% | 100% | 6% | 77% | 2% |
| LAT | CB | MixAT | ||||
|---|---|---|---|---|---|---|
| Attack | Phi 4 Mini | Qwen 2.5 7B | Llama 3 8B | Llama 3 8B | Llama 3 8B | Llama 3 8B |
| GCG | 87.8% | 87.9% | 59.7% | 18.0% | 21.2% | 2.2% |
| PGD | 36.9% | 62.7% | 10.5% | 1.9% | 12.6% | 2.3% |
| AutoDAN | 13.5% | 89.6% | 52.9% | 2.6% | 5.4% | 0.5% |
| PAIR | 33.9% | 50.7% | 26.7% | 14.7% | 13.8% | 1.2% |
| BoN | 85.8% | 82.4% | 87.2% | 15.2% | 60.0% | 6.2% |
| HarmBench judge (JBB) | HarmBench dataset | |||||
|---|---|---|---|---|---|---|
| Attack | LAT | CB | MixAT | LAT | CB | MixAT |
| BoN | 3.0% | 85.0% | 1.0% | 0.0% | 73.5% | 1.0% |
| Inpainting | 82.0% | 91.0% | 45.0% | 89.5% | 87.0% | 68.5% |
| Attack | LAT | CB | MixAT |
|---|---|---|---|
| AR Paraphrasing (Instruction Llama 3) | 34% | 28% | 12% |
| AR Paraphrasing (Uncensored Llama 3) | 59% | 41% | 20% |
| Inpainting | 98% | 100% | 88% |
| Training | LAT | CB | MixAT | ||||
|---|---|---|---|---|---|---|---|
| DLLM | Tokens | Phi 4 Mini | Qwen 2.5 7B | Llama 3 8B | Llama 3 8B | Llama 3 8B | Llama 3 8B |
| Dream | 580B | 76% | 100% | 70% | 3% | 39% | 5% |
| LLaDA | 2.3T | 100% | 100% | 99% | 96% | 98% | 80% |
| LLaDA-MoE | 20T | 100% | 100% | 100% | 98% | 100% | 88% |
Adversarial Prompt Generation
Adversarial prompt generation creates inputs that expose or exploit model vulnerabilities, helping test and improve AI safety and robustness.
See all 69 papers