Fast Adversarial Attacks on Language Models In One GPU Minute

Vinu Sankar Sadasivan, Shoumik Saha, Gaurang Sriramanan, Priyatham Kattakinda, Atoosa Chegini, Soheil Feizi

Introduction

Researchers have introduced BEAST (Beam Search-based Adversarial Attack), a gradient-free method capable of jailbreaking aligned Large Language Models (LLMs) in under a minute on a single consumer GPU. BEAST is 25–65x faster than previous automated attacks and extends its utility beyond simple jailbreaking to inducing hallucinations and enhancing privacy-leaking attacks.

The Adversarial Trilemma

As LLMs are integrated into critical applications, alignment—the process of ensuring models are safe and helpful—is paramount. However, adversarial attacks can bypass these safeguards. Existing automated attacks typically suffer from a "trilemma" of trade-offs:

  1. Speed: Gradient-based attacks like GCG are effective but slow, often requiring over an hour per prompt.
  2. Cost: Black-box attacks like PAIR require thousands of queries to expensive APIs like GPT-4.
  3. Readability: Many attacks produce "gibberish" tokens that are easily detected by simple perplexity filters.
Comparison of BEAST against existing adversarial attack methods across key metrics.

BEAST bridges this gap by being fast, locally executable, and producing relatively readable adversarial prompts that can bypass common defenses.

The BEAST Algorithm

BEAST treats the adversarial attack as a search problem rather than a gradient optimization task. It employs a beam search-based approach to find effective adversarial suffixes by maintaining a "beam" of candidate tokens.

Overview of the BEAST attack iteration process and its application to jailbreak, hallucination, and privacy attacks.

Core Components:

  • Beam Search Optimization: The algorithm maintains a beam of the top $k_1$ candidate adversarial suffixes. In each iteration, it expands these candidates by sampling $k_2$ new tokens.
  • Multinomial Sampling: To maintain readability and evade detection, BEAST samples tokens based on the target model’s own probability distribution. This ensures the attack "speaks the model's language."
  • Adversarial Objectives:
    • Jailbreaking: Minimizes perplexity for a specific compliant start (e.g., "Sure, here is a tutorial on...").
  • Hallucinations: Maximizes output perplexity to force the model into nonsensical or factually incorrect territory.
  • Privacy: Lowers perplexity on specific data strings to facilitate Membership Inference Attacks (MIA), identifying if data was part of the training set.

Experimental Evaluation

The authors evaluated BEAST using several benchmarks: AdvBench for jailbreaking, TruthfulQA for hallucinations, and WikiMIA for privacy attacks.

Key Results

  • Efficiency: On Vicuna-7B-v1.5, BEAST achieved an 89% jailbreak success rate in under one minute. In contrast, the GCG baseline took over an hour to reach only 70%.
  • Hallucination Induction: In untargeted attacks, BEAST caused Vicuna to produce 15% more incorrect outputs and irrelevant content 22% of the time.
  • Privacy Enhancement: For the OPT-2.7B model, BEAST boosted Membership Inference Attack detection accuracy (AUROC) by 4.1%.
  • Transferability: Suffixes discovered for specific prompts often proved effective on new, unseen prompts (Universal Attack), demonstrating the robustness of the vulnerabilities found.

Discussion and Limitations

While BEAST is highly effective against models like Vicuna, Mistral, and Falcon, it faces challenges with more rigorously aligned models like LLaMA-2-7B-Chat, where the success rate remained around 12% in initial tests.

The speed of BEAST makes it a powerful tool for both security researchers and potential adversaries. As attacks become faster and more accessible, defensive strategies must co-evolve. The authors suggest that BEAST could be integrated into adversarial training loops to proactively harden models against such exploits from the start.

Summary updated

BibTeX
@inproceedings{sadasivan2024fast,
  author = {Vinu Sankar Sadasivan and Shoumik Saha and Gaurang Sriramanan and Priyatham Kattakinda and Atoosa Chegini and Soheil Feizi},
  title = {{Fast Adversarial Attacks on Language Models In One GPU Minute}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=wCMNbdshcY},
}
Figure