[Paper Review] AmpleGCG: Learning a Universal and Transferable Generative Model of Adversarial Suffixes for Jailbreaking Both Open and Closed LLMs
AmpleGCG proposes a universal, transferable generative model that learns the distribution of adversarial suffixes for jailbreaking both open-source and closed-source LLMs. By leveraging successful suffixes from GCG optimization, it generates 200+ high-quality, diverse adversarial suffixes per query in under 4 seconds, achieving near 100% attack success rate on Llama-2-7B-chat and Vicuna-7B, and 99% on GPT-3.5, while evading perplexity-based defenses.
As large language models (LLMs) become increasingly prevalent and integrated into autonomous systems, ensuring their safety is imperative. Despite significant strides toward safety alignment, recent work GCG~\citep{zou2023universal} proposes a discrete token optimization algorithm and selects the single suffix with the lowest loss to successfully jailbreak aligned LLMs. In this work, we first discuss the drawbacks of solely picking the suffix with the lowest loss during GCG optimization for jailbreaking and uncover the missed successful suffixes during the intermediate steps. Moreover, we utilize those successful suffixes as training data to learn a generative model, named AmpleGCG, which captures the distribution of adversarial suffixes given a harmful query and enables the rapid generation of hundreds of suffixes for any harmful queries in seconds. AmpleGCG achieves near 100\% attack success rate (ASR) on two aligned LLMs (Llama-2-7B-chat and Vicuna-7B), surpassing two strongest attack baselines. More interestingly, AmpleGCG also transfers seamlessly to attack different models, including closed-source LLMs, achieving a 99\% ASR on the latest GPT-3.5. To summarize, our work amplifies the impact of GCG by training a generative model of adversarial suffixes that is universal to any harmful queries and transferable from attacking open-source LLMs to closed-source LLMs. In addition, it can generate 200 adversarial suffixes for one harmful query in only 4 seconds, rendering it more challenging to defend.
Motivation & Objective
- To address the limitation of existing jailbreaking methods that rely on selecting only the single lowest-loss suffix from GCG optimization, which may miss effective adversarial suffixes.
- To explore whether a generative model can be trained to rapidly produce a diverse set of high-quality adversarial suffixes for any harmful query.
- To investigate the transferability of such a model across different LLMs, including closed-source models like GPT-3.5.
- To evaluate the robustness of the generated suffixes against defense mechanisms such as perplexity-based detection.
- To improve the efficiency and coverage of jailbreaking attacks by capturing the distribution of successful suffixes rather than relying on single-point optimization.
Proposed method
- Collect candidate suffixes from the intermediate steps of GCG optimization, rather than only the final lowest-loss suffix, to capture a broader set of successful adversarial patterns.
- Train a generative model, AmpleGCG, on the collected suffixes to learn the mapping from a harmful query to a distribution of effective adversarial suffixes.
- Use a straightforward fine-tuning pipeline with a language model to generate diverse, high-utility suffixes conditioned on input queries.
- Apply a prompt engineering trick—adding affirmative prefixes like "Sure, here is"—to enhance transferability to closed-source models such as GPT-3.5.
- Employ prompt repetition at inference time to evade perplexity-based defenses, increasing success rate to 80%.
- Evaluate the model’s performance via attack success rate (ASR) on multiple LLMs, including Llama-2-7B-chat, Vicuna-7B, and GPT-3.5, under controlled settings.
Experimental results
Research questions
- RQ1Why does selecting only the lowest-loss suffix in GCG optimization fail to capture all effective adversarial suffixes?
- RQ2Can a generative model be trained to efficiently produce a large number of diverse, high-quality adversarial suffixes for any harmful query?
- RQ3To what extent can a model trained on open-source LLMs transfer to attack closed-source LLMs like GPT-3.5?
- RQ4Can the generated suffixes evade perplexity-based defense mechanisms, and how effective is prompt repetition in doing so?
- RQ5How does the diversity and coverage of suffixes from AmpleGCG compare to those from raw GCG optimization?
Key findings
- AmpleGCG achieves a near 100% attack success rate on both Llama-2-7B-chat and Vicuna-7B by generating around 200 adversarial suffixes per query.
- The model significantly outperforms both the original GCG and augmented GCG (which uses all intermediate suffixes) in attack success rate and efficiency.
- AmpleGCG generates 200 adversarial suffixes for any given harmful query in approximately 4 seconds, demonstrating high inference speed.
- The model shows strong zero-shot transferability, achieving 99% attack success rate on the latest GPT-3.5 model after adding simple affirmative prefixes.
- The generated suffixes exhibit high diversity with no overlap between AmpleGCG and augmented GCG, indicating broader vulnerability coverage.
- Prompt repetition at inference time enables AmpleGCG-generated suffixes to evade perplexity-based defenses with an 80% attack success rate.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.