Skip to main content
QUICK REVIEW

[Paper Review] Soft Prompt Threats: Attacking Safety Alignment and Unlearning in Open-Source LLMs through the Embedding Space

Leo Schwinn, David Dobre|arXiv (Cornell University)|Feb 14, 2024
Cloud Data Security SolutionsComputer Science5 citations
TL;DR

The paper proposes embedding space attacks that perturb input embeddings to bypass safety alignment and reveal unlearned information in open-source LLMs, showing higher efficiency and generalization than prior methods and introducing an interrogation use case for unlearned models.

ABSTRACT

Current research in adversarial robustness of LLMs focuses on discrete input manipulations in the natural language space, which can be directly transferred to closed-source models. However, this approach neglects the steady progression of open-source models. As open-source models advance in capability, ensuring their safety also becomes increasingly imperative. Yet, attacks tailored to open-source LLMs that exploit full model access remain largely unexplored. We address this research gap and propose the embedding space attack, which directly attacks the continuous embedding representation of input tokens. We find that embedding space attacks circumvent model alignments and trigger harmful behaviors more efficiently than discrete attacks or model fine-tuning. Furthermore, we present a novel threat model in the context of unlearning and show that embedding space attacks can extract supposedly deleted information from unlearned LLMs across multiple datasets and models. Our findings highlight embedding space attacks as an important threat model in open-source LLMs. Trigger Warning: the appendix contains LLM-generated text with violence and harassment.

Motivation & Objective

  • Motivate and formalize embedding space attacks as a threat model for open-source LLMs.
  • Demonstrate that embedding space attacks can bypass safety alignment more efficiently than fine-tuning.
  • Show that such attacks can generalize to unseen harmful behaviors.
  • Demonstrate the ability to extract supposedly deleted information from unlearned models across datasets.

Proposed method

  • Define embedding space attack where input token embeddings are perturbed while model weights are frozen.
  • Optimize adversarial embeddings using gradient-based methods, with signed gradient descent as the chosen optimizer.
  • Develop two attack goals: individual (per-sample) and universal (across a dataset) perturbations.
  • Introduce multi-layer attacks that decode intermediate hidden states to probe stored knowledge (logit lens-inspired).
  • Compare with baselines including fine-tuning and top-k sampling as an attack baseline.
Figure 1 : Illustration of discrete and embedding space attacks (this work). Discrete attacks manipulate discrete one-hot tokens $T_{adv}\in\mathcal{T}$ , whereas embedding space attacks target the continuous vector representation of tokens or randomly initialized embeddings $e_{adv}\in\mathbb{R}^{D
Figure 1 : Illustration of discrete and embedding space attacks (this work). Discrete attacks manipulate discrete one-hot tokens $T_{adv}\in\mathcal{T}$ , whereas embedding space attacks target the continuous vector representation of tokens or randomly initialized embeddings $e_{adv}\in\mathbb{R}^{D

Experimental results

Research questions

  • RQ1Can embedding space perturbations bypass safety alignment faster than fine-tuning for open-source LLMs?
  • RQ2Do embedding space attacks generalize to unseen harmful instructions and different datasets?
  • RQ3Can embedding space attacks reveal retained or deleted information in unlearned models?
  • RQ4How do multi-layer attacks compare to standard attacks in extracting information from unlearned models?

Key findings

  • Embedding space attacks remove safety alignment across four open-source models, with higher efficiency than fine-tuning.
  • Universal embedding attacks generalize to unseen harmful behaviors, achieving high success across instructions.
  • Attacks can extract more information from unlearned models than direct prompts (e.g., on Llama2-7b-WhoIsHarryPotter and TOFU benchmarks).
  • Attacking with embedding space perturbations can yield substantial toxicity increases and lower perplexity in generated outputs.
  • Universal attacks achieve near-100% cumulative success on many setups, and single-token attacks can reach high success rapidly (often faster than discrete attacks).
  • In unlearned Harry Potter Q&A, multi-layer attacks outperform standard attacks, with a best configuration reaching ~30.9% CU on training data and strong cross-question generalization.
Figure 6: The two rows show the perplexity and toxicity (obtained from toxic-bert) of generated responses of different LLMs with and without embedding space attacks on the harmful behavior dataset. Additionally, the scores of the fine-tuned Llama2 model are compared to attacking the regular Llama2 m
Figure 6: The two rows show the perplexity and toxicity (obtained from toxic-bert) of generated responses of different LLMs with and without embedding space attacks on the harmful behavior dataset. Additionally, the scores of the fine-tuned Llama2 model are compared to attacking the regular Llama2 m

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.