Abstract: The safety defense methods of Large language models (LLMs) stay limited because the dangerous prompts are manually curated to just few known attack types, which fails to keep pace with emerging varieties. Recent studies found that attaching suffixes to harmful instructions can hack the defense of LLMs and lead to dangerous outputs. However, similar to traditional text adversarial attacks, this approach, while effective, is limited by the challenge of the discrete tokens. This gradient-based discrete optimization attack requires over 100,000 LLM calls, and due to the unreadable nature of adversarial suffixes, it can be relatively easily penetrated by common defense methods such as perplexity filters. To cope with this challenge, in this paper, we propose an Adversarial Suffix Embedding Translation Framework (ASETF), aimed at transforming continuous adversarial suffix embeddings into coherent and understandable text. This method greatly reduces the computational overhead during the attack process and helps to automatically generate multiple adversarial samples, which can be used as data to strengthen LLMs security defense. Experimental evaluations were conducted on Llama2, Vicuna, and other prominent LLMs, employing harmful directives sourced from the Advbench dataset. The results indicate that our method significantly reduces the computation time of adversarial suffixes and achieves a much better attack success rate than existing techniques, while significantly enhancing the textual fluency of the prompts. In addition, our approach can be generalized into a broader method for generating transferable adversarial suffixes that can successfully attack multiple LLMs, even black-box LLMs, such as ChatGPT and Gemini.
Introduction
Large Language Models (LLMs) are increasingly integrated into daily applications, necessitating robust safety alignment to prevent the generation of harmful content. However, researchers have identified vulnerabilities where models can be "jailbroken" by appending specific adversarial suffixes to harmful prompts.
Existing state-of-the-art methods, such as Greedy Coordinate Gradient (GCG), rely on discrete token optimization. While effective, GCG suffers from extreme computational inefficiency—often requiring over 100,000 model calls—and produces "word salad" suffixes that are easily detected by perplexity filters. ASETF addresses these flaws by optimizing in continuous embedding space and translating those embeddings into fluent, natural language.
The ASETF Framework
The Adversarial Suffix Embedding Translation Framework (ASETF) operates through a two-stage pipeline designed to bridge the gap between continuous optimization and discrete, readable text.
1. Continuous Optimization
Instead of iteratively swapping discrete tokens, ASETF optimizes a "soft prompt" (a continuous vector) within the target model's embedding space. This allows the use of standard gradient descent, which is fundamentally more efficient than discrete search. To ensure these vectors remain within a distribution that can be mapped back to real language, the authors incorporate a Maximum Mean Discrepancy (MMD) loss, preventing the optimization from drifting into uninterpretable noise.
2. Embedding Translation
The core innovation of ASETF is the Embedding Translation Model. The researchers fine-tune a separate LLM (specifically GPT-j-6b) to act as a translator. This model is trained using self-supervised learning on Wikipedia data to take a harmful instruction context and a set of embeddings, then "reconstruct" them into coherent, natural language text. This process effectively "camouflages" the adversarial signal within a discussion-style context that appears benign to both human observers and automated filters.
Experimental Results
The framework was evaluated using the Advbench dataset against several prominent models, including Llama2, Vicuna, and Mistral, as well as black-box commercial models.
- Efficiency and Success: On the Vicuna model, ASETF achieved an 82% Attack Success Rate (ASR), surpassing GCG's 71%. Crucially, ASETF was approximately 2.5x faster, completing attacks in 94 seconds compared to GCG's 142 seconds.
- Fluency and Stealth: ASETF prompts achieved significantly lower (better) perplexity scores. For Llama2, ASETF prompts had a perplexity of ~32, whereas GCG prompts averaged ~1513. This allows ASETF to bypass common perplexity-based defense mechanisms that easily flag GCG's gibberish.
- Transferability: Suffixes generated against open-source models proved highly effective when transferred to black-box systems. The researchers successfully jailbroke ChatGPT and Gemini, indicating that the adversarial signals captured by ASETF are universal across different model architectures.
Conclusion
ASETF represents a significant advancement in jailbreak research by moving from discrete token manipulation to a continuous-to-fluent translation approach. By producing human-readable adversarial suffixes, ASETF not only exposes deeper vulnerabilities in current LLM safety alignments but also provides a scalable method for generating high-quality adversarial data to improve future model robustness. Future work will explore the application of this translation framework to other NLP tasks, such as steering model outputs and data poisoning defense.
Summary updated