GASP: Efficient Black-Box Generation of Adversarial Suffixes for Jailbreaking LLMs

Advik Raj Basani, Xiao Zhang
11/21/2024
cs.LGcs.AIcs.CR

No official code found. Best implementation: TrustMLRG/GASP (17 stars, GPL-3.0, last commit 2025-11-12).

Abstract

LLMs have shown impressive capabilities across various natural language processing tasks, yet remain vulnerable to input prompts, known as jailbreak attacks, carefully designed to bypass safety guardrails and elicit harmful responses. Traditional methods rely on manual heuristics but suffer from limited generalizability. Despite being automatic, optimization-based attacks often produce unnatural prompts that can be easily detected by safety filters or require high computational costs due to discrete token optimization. In this paper, we introduce Generative Adversarial Suffix Prompter (GASP), a novel automated framework that can efficiently generate human-readable jailbreak prompts in a fully black-box setting. In particular, GASP leverages latent Bayesian optimization to craft adversarial suffixes by efficiently exploring continuous latent embedding spaces, gradually optimizing the suffix prompter to improve attack efficacy while balancing prompt coherence via a targeted iterative refinement procedure. Through comprehensive experiments, we show that GASP can produce natural adversarial prompts, significantly improving jailbreak success over baselines, reducing training times, and accelerating inference speed, thus making it an efficient and scalable solution for red-teaming LLMs.

View on arXivView PDF

Code Implementations(1)

TrustMLRG/GASPCommunity100%
GPL-3.0

GASP: Efficient Black-Box Generation of Adversarial Suffixes for Jailbreaking LLMs

173PythonApr 3, 202511 months agoGPL-3.0

Cite this paper

@article{basani2024gasp,
  title  = {GASP: Efficient Black-Box Generation of Adversarial Suffixes for Jailbreaking LLMs},
  author = {Advik Raj Basani and Xiao Zhang},
  year   = {2024},
  eprint = {2411.14133},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.14133v3}
}

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/2411.14133.svg)](https://codeofpaper.com/paper/2411.14133)

Discussion