Advancing Adversarial Suffix Transfer Learning on Aligned Large Language Models

Hongfu Liu, Yuxi Xie, Ye Wang, Michael Shieh

This paper explores the vulnerabilities of aligned Large Language Models (LLMs) to adversarial attacks. Specifically, it focuses on improving the efficiency and transferability of "jailbreak" suffixes—strings of nonsense tokens that, when appended to a malicious prompt, trick a model into bypassing its safety filters.

The Challenge of Jailbreaking Aligned LLMs

Even "aligned" LLMs (those trained to be helpful and harmless) are susceptible to jailbreak attacks. A prominent method for finding these attacks is Greedy Coordinate Gradient (GCG), which uses gradient information to search for a suffix that minimizes the loss of a target harmful response.

However, GCG has two major flaws:

  1. Computational Inefficiency: It is incredibly slow because it tries to optimize the entire target response at once.
  2. Poor Transferability: A suffix found for one model often fails on another, or when the malicious query changes slightly.

The authors observed a critical bottleneck: the "first token" problem. LLMs are most likely to refuse a prompt at the very beginning. If an attacker cannot get the model to generate that first affirmative token (e.g., "Sure"), the rest of the attack fails. GCG struggles because the signal for the first token gets drowned out by the "noise" of optimizing the rest of the sentence.

Cross-entropy loss of different token positions during optimization.

As shown in the loss trajectory above, the cross-entropy loss for the first token position is significantly higher and harder to optimize initially compared to subsequent tokens, confirming it as the primary hurdle.

To overcome this, the authors propose DeGCG (Decoupled GCG), which mirrors the popular pre-training and fine-tuning paradigm in machine learning:

  • Stage 1: First-Token Searching (FTS): Instead of aiming for a full harmful response, the algorithm searches for a suffix that simply makes the model say "Sure." This is "behavior-agnostic"—it doesn't matter what the prompt is; the goal is just to break the initial refusal.
  • Stage 2: Content-Aware Searching (CAS): Using the suffix from Stage 1 as a starting point, the algorithm then fine-tunes it to elicit the specific harmful response (e.g., "Sure, here is how to make a bomb").
The DeGCG and i-DeGCG framework, illustrating the decoupled pre-search and fine-tuning stages.

They also introduced i-DeGCG (Interleaved DeGCG), an iterative version that alternates between FTS and CAS. This maintains a dynamic balance, ensuring the suffix remains strong enough to trigger the initial "Sure" while becoming increasingly specialized for the harmful task.

Datasets and Evaluation

The researchers evaluated their methods using HarmBench, a standardized evaluation framework for automated red-teaming. They focused on the "Standard" behavior subset, which includes categories like chemical/biological threats, cybercrime, misinformation, and illegal activities. They tested these attacks across several popular 7B-parameter models: Llama2-chat, Mistral-Instruct, OpenChat-3.5, and Starling-LM.

Key Insights

  • The First Token is the Key: By isolating the first token "hurdle," the search becomes much more efficient.
  • Initialization Matters: GCG typically starts with a random suffix. DeGCG proves that starting with a "behavior-agnostic" suffix provides a much better "neighborhood" in the search space for finding successful jailbreaks.
  • Universal Transferability: Because the first stage (FTS) is behavior-agnostic, the resulting suffixes are surprisingly "universal." A suffix that makes Llama2 say "Sure" to one prompt is likely to work as a great starting point for other prompts or even other models.

Key Results

The improvements over the standard GCG baseline were substantial:

  • Higher Success Rates: On Llama2-chat-7b, the i-DeGCG method achieved an Attack Success Rate (ASR) of 43.9% on the validation set, a massive +22.2% increase over the GCG baseline.
  • Cross-Model Superiority: When transferring a suffix from one model to another (e.g., from Mistral to Llama2), DeGCG consistently outperformed direct transfer methods. For instance, transferring from Mistral-Instruct to Llama2-chat saw an ASR jump from roughly 20% to 43.9%.
  • Efficiency: By decoupling the search, the authors reached higher ASRs in the same number of total optimization steps (500) compared to the baseline.

Limitations and Future Work

The authors acknowledge several areas for further study:

  • Open-Source Focus: The study was limited to open-source models where gradient information is available. It remains to be seen how well these "pre-searched" suffixes transfer to closed-source "black-box" models like GPT-4.
  • Text-Only: The research focused exclusively on text. Future work could explore if similar decoupling strategies work for multimodal models.
  • Theoretical Gap: While the empirical results are strong, the paper lacks a formal theoretical proof of why the first-token optimization is so much more pivotal than the rest of the sequence.

By identifying the "first token" as the primary barrier to jailbreaking, this paper provides a more potent toolkit for red-teaming and highlights a critical area where LLM safety alignment needs to be strengthened.

Summary updated

BibTeX
@inproceedings{liu2024advancing,
  author = {Hongfu Liu and Yuxi Xie and Ye Wang and Michael Shieh},
  title = {{Advancing Adversarial Suffix Transfer Learning on Aligned Large Language Models}},
  booktitle = {Red Teaming GenAI @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=LHKPrcKzgf},
}
Figure