ASETF: A Novel Method for Jailbreak Attack on LLMs through Translate Suffix Embeddings

Hao Wang, Hao Li, Minlie Huang, Lei Sha

Abstract

Large Language Models (LLMs) are increasingly deployed with safety alignments to prevent harmful outputs. However, "jailbreak" attacks remain a significant vulnerability. We present the Adversarial Suffix Embedding Translation Framework (ASETF), a novel approach that optimizes adversarial attacks in continuous embedding space and translates them into fluent natural language. ASETF addresses the dual challenges of computational inefficiency and high detectability inherent in discrete optimization methods like GCG. Our results demonstrate that ASETF achieves higher attack success rates (ASR) while maintaining human-level fluency and significantly reducing optimization time.

Introduction

The rapid advancement of Large Language Models (LLMs) has necessitated robust safety guardrails. Despite these efforts, jailbreak attacks—carefully crafted prompts designed to bypass safety filters—continue to pose a threat. Current automated jailbreak methods primarily rely on discrete optimization, such as the Greedy Coordinate Gradient (GCG) algorithm. While effective, these methods are computationally expensive and typically produce "gibberish" suffixes that are easily flagged by perplexity-based detection systems. ASETF aims to bridge this gap by creating attacks that are both computationally efficient and produce coherent, human-readable text.

The ASETF Framework

ASETF introduces a two-phase pipeline to generate stealthy and efficient jailbreak prompts.

1. Continuous Adversarial Optimization

Instead of searching through the massive discrete space of possible word combinations, ASETF performs optimization in the continuous embedding space of the target LLM. By optimizing a "soft prompt" vector ($h_i$), the framework avoids the combinatorial explosion of language. To ensure these vectors remain representative of actual language, a Maximum Mean Discrepancy (MMD) loss is employed, keeping the adversarial embeddings close to the distribution of the model's standard vocabulary.

2. Embedding Translation

The defining innovation of ASETF is the use of a "Translation LLM" (a fine-tuned GPT-j-6b). This model acts as a bridge between the optimized continuous embeddings and human-readable text. Unlike simple nearest-neighbor lookups, the translator is context-aware, using the original harmful instruction to ensure the resulting suffix is semantically coherent and fluent.

Overview of the ASETF framework showing the optimization of soft prompts and their subsequent translation into natural language suffixes.

Experimental Evaluation

The framework was evaluated using the Advbench dataset, which contains over 500 harmful instructions, and Wikipedia data for training the translation model.

Efficiency and Fluency

ASETF demonstrates a clear advantage in both speed and stealth. On a Llama2-7b model, ASETF completed the optimization process in approximately 104 seconds, more than twice as fast as GCG's 233 seconds. Furthermore, the fluency of the generated suffixes—measured by Perplexity (PPL)—was significantly improved. ASETF achieved a PPL of 32.59, compared to GCG's 1513.09, making ASETF suffixes virtually indistinguishable from natural human language to automated filters.

Attack Success and Transferability

ASETF outperformed baseline methods in Attack Success Rate (ASR). On Vicuna-7b, it reached an 82% ASR, surpassing GCG's 71%. Crucially, the method exhibits strong transferability to black-box models. Suffixes optimized against open-source surrogates successfully jailbroke commercial systems like GPT-3.5-turbo and Gemini, despite the attackers having no access to those models' internal weights.

Comparison of the ASETF architecture for single-target and multiple-target attack scenarios, illustrating how the framework scales for black-box transferability.

Conclusion

ASETF represents a significant shift in adversarial research for LLMs. By leveraging continuous optimization and a dedicated translation model, it produces attacks that are faster, more successful, and significantly harder to detect than previous automated methods. This framework serves as a critical tool for red-teaming and developing more robust safety alignments in future language models.

Summary updated

BibTeX
@inproceedings{wang2024asetf,
  author = {Hao Wang and Hao Li and Minlie Huang and Lei Sha},
  title = {{ASETF: A Novel Method for Jailbreak Attack on LLMs through Translate Suffix Embeddings}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.157},
}
Figure