Skip to main content
QUICK REVIEW

[Paper Review] AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs

Anselm Paulus, Arman Zharmagambetov|arXiv (Cornell University)|Apr 21, 2024
Smart Grid Security and ResilienceEngineering4 citations
TL;DR

This paper introduces AdvPrompter, a fast, adaptive, and human-readable adversarial prompt generation method for jailbreaking large language models (LLMs). It trains a specialized LLM (AdvPrompter) via an alternating optimization and low-rank fine-tuning loop that generates coherent suffixes to bypass safety alignment, achieving ~800× faster generation than gradient-based methods and state-of-the-art attack success rates on both open- and closed-source LLMs.

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.

Motivation & Objective

  • To address the inefficiency and incoherence of existing automated red-teaming methods for LLM jailbreaking.
  • To develop a fast, adaptive, and human-readable adversarial prompt generation method that does not require gradients from the target LLM.
  • To enable scalable, multi-shot jailbreaking attacks by generating context-aware adversarial suffixes that maintain semantic coherence.
  • To demonstrate that adversarial prompts generated by AdvPrompter can be used to fine-tune target LLMs, improving their robustness against future attacks.

Proposed method

  • The method trains a dedicated LLM, the AdvPrompter, to generate adversarial suffixes that jailbreak a target LLM while preserving instruction meaning.
  • It uses an alternating training loop: (1) AdvPrompterOpt, a novel optimization algorithm that iteratively selects and evaluates token candidates to generate high-quality adversarial suffixes, and (2) low-rank fine-tuning of the AdvPrompter using the generated suffixes as supervised targets.
  • AdvPrompterOpt maintains human readability by minimizing perplexity using a base LLM, ensuring generated suffixes are natural and undetectable by perplexity filters.
  • The training process avoids gradient access to the target LLM, enabling application to black-box models.
  • The method conditions the AdvPrompter on the input instruction, allowing it to generate context-adaptive suffixes rather than universal ones.
  • At inference, the fine-tuned AdvPrompter generates adversarial suffixes in seconds, enabling fast, multi-shot attack pipelines.
Figure 1: Summary of our proposed method. Top: At inference, the fine-tuned AdvPrompter LLM generates an adversarial suffix for the harmful instruction that results in a positive response from the TargetLLM . Bottom: The AdvPrompterTrain training loop alternates between generating high-quality targe
Figure 1: Summary of our proposed method. Top: At inference, the fine-tuned AdvPrompter LLM generates an adversarial suffix for the harmful instruction that results in a positive response from the TargetLLM . Bottom: The AdvPrompterTrain training loop alternates between generating high-quality targe

Experimental results

Research questions

  • RQ1Can a large language model be trained to generate human-readable, adaptive adversarial prompts that bypass safety alignment in target LLMs without requiring gradients from the target model?
  • RQ2How does the performance of the proposed method compare to existing optimization-based and heuristic-based adversarial prompt generation techniques in terms of attack success rate and generation speed?
  • RQ3To what extent can adversarial prompts generated by AdvPrompter transfer to closed-source, black-box LLM APIs?
  • RQ4Can the adversarial prompts generated by AdvPrompter be used to improve the robustness of target LLMs through fine-tuning?
  • RQ5Does the alternating training scheme of optimization and low-rank fine-tuning lead to more effective and generalizable adversarial prompt generation than end-to-end training?

Key findings

  • AdvPrompter achieves a state-of-the-art attack success rate of 92.5% on the AdvBench dataset across multiple open-source LLMs, outperforming existing methods.
  • The method generates adversarial prompts in approximately 1-2 seconds per prompt, representing an ~800× speedup over gradient-based optimization methods.
  • The generated adversarial suffixes are human-readable and coherent, with low perplexity scores, making them undetectable by standard perplexity-based filtering mechanisms.
  • The method successfully transfers to closed-source LLM APIs, achieving high attack success rates without requiring access to the target model’s gradients.
  • Fine-tuning target LLMs on a synthetic dataset of adversarial prompts generated by AdvPrompter significantly improves their robustness against jailbreaking attacks while maintaining high MMLU performance scores.
  • The alternating training loop of AdvPrompterOpt and low-rank fine-tuning leads to superior generalization and adaptability compared to baseline methods, especially in zero-shot and transfer settings.
Figure 2: Top: Performance comparison of different attack methods across various open source TargetLLMs . We report: train/test attack success rates @ $k$ (at least one out of $k$ attacks was successful) and perplexity as an indicator of human-readability. Each reported value is averaged over 3 inde
Figure 2: Top: Performance comparison of different attack methods across various open source TargetLLMs . We report: train/test attack success rates @ $k$ (at least one out of $k$ attacks was successful) and perplexity as an indicator of human-readability. Each reported value is averaged over 3 inde

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.