VERA: Variational Inference Framework for Jailbreaking Large Language Models
Anamika Lochab, Lu Yan, Patrick Pynadath, Xiangyu Zhang, Ruqi Zhang
TL;DR
VERA reframes black-box jailbreaking as posterior inference over adversarial prompts, training a compact attacker LLM via LoRA to learn a distribution $q_{ heta}(x)$ over prompts. By using a judge-based surrogate for $P_{LM}(y^*|x)$ and optimizing the ELBO with a REINFORCE gradient, VERA produces diverse, fluent jailbreak prompts that require no per-prompt optimization at inference. Empirical results on HarmBench show state-of-the-art ASR across multiple open- and closed-source LLMs, with strong transferability and notable robustness to defenses. The work demonstrates the value of a distributional perspective for red-teaming and highlights implications for designing more robust safety defenses against generalized adversarial prompting.
Abstract
The rise of API-only access to state-of-the-art LLMs highlights the need for effective black-box jailbreak methods to identify model vulnerabilities in real-world settings. Without a principled objective for gradient-based optimization, most existing approaches rely on genetic algorithms, which are limited by their initialization and dependence on manually curated prompt pools. Furthermore, these methods require individual optimization for each prompt, failing to provide a comprehensive characterization of model vulnerabilities. To address this gap, we introduce VERA: Variational infErence fRamework for jAilbreaking. VERA casts black-box jailbreak prompting as a variational inference problem, training a small attacker LLM to approximate the target LLM's posterior over adversarial prompts. Once trained, the attacker can generate diverse, fluent jailbreak prompts for a target query without re-optimization. Experimental results show that VERA achieves strong performance across a range of target LLMs, highlighting the value of probabilistic inference for adversarial prompt generation.
