English

AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs

Cryptography and Security 2025-06-04 v2 Artificial Intelligence Computation and Language Machine Learning

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.

Keywords

Cite

@article{arxiv.2404.16873,
  title  = {AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs},
  author = {Anselm Paulus and Arman Zharmagambetov and Chuan Guo and Brandon Amos and Yuandong Tian},
  journal= {arXiv preprint arXiv:2404.16873},
  year   = {2025}
}

Comments

Accepted to ICML 2025. Code is available at http://github.com/facebookresearch/advprompter

R2 v1 2026-06-28T16:06:48.732Z