AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs
Anselm Paulus, Arman Zharmagambetov, Chuan Guo, Brandon Amos, Yuandong Tian
TL;DR
AdvPrompter tackles the vulnerability of LLMs to jailbreaking by training a secondary model to rapidly generate human-readable adversarial prompts tailored to each instruction. It introduces AdvPrompterTrain, an alternating optimization scheme, and AdvPrompterOpt for efficient suffix generation, achieving fast, adaptable, graybox attacks that transfer across open and closed models. The work also demonstrates that synthetic adversarial data produced by AdvPrompter can be used to改善safety alignment through adversarial training, improving robustness without sacrificing general knowledge. Overall, the approach highlights both the practical risk of current safety gaps in deployed LLMs and a path toward automated defenses via scalable adversarial data generation and fine-tuning.
Abstract
Large Language Models (LLMs) are vulnerable to jailbreaking attacks that lead to generation of inappropriate or harmful content. Manual red-teaming requires a time-consuming search for adversarial prompts, whereas automatic adversarial prompt generation often leads to semantically meaningless attacks that do not scale well. In this paper, we present a novel method that uses another LLM, called AdvPrompter, to generate human-readable adversarial prompts in seconds. AdvPrompter, which is trained using an alternating optimization algorithm, generates suffixes that veil the input instruction without changing its meaning, such that the TargetLLM is lured to give a harmful response. Experimental results on popular open source TargetLLMs show highly competitive results on the AdvBench and HarmBench datasets, that also transfer to closed-source black-box LLMs. We also show that training on adversarial suffixes generated by AdvPrompter is a promising strategy for improving the robustness of LLMs to jailbreaking attacks.
