AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs

Anselm Paulus, Arman Zharmagambetov, Chuan Guo, Brandon Amos, Yuandong Tian
4/21/2024
cs.CRcs.AIcs.CL

No official code found. Best implementation: facebookresearch/advprompter (183 stars, last commit 2024-05-06).

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.

View on arXivView PDF

Code Implementations(1)

Official implementation of AdvPrompter https//arxiv.org/abs/2404.16873

18317PythonMay 2, 20242 years agoNOASSERTION

Similar Papers

Cite this paper

@article{paulus2024advprompter,
  title  = {AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs},
  author = {Anselm Paulus and Arman Zharmagambetov and Chuan Guo and Brandon Amos and Yuandong Tian},
  year   = {2024},
  eprint = {2404.16873},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.16873v2},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.16873.svg)](https://codeofpaper.com/paper/2404.16873)

Discussion