Skip to main content
QUICK 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 Science被引用 5
一句话总结

简要结论:该论文提出在嵌入空间进行攻击,通过扰动输入嵌入来绕过安全对齐并揭示开源大型语言模型中尚未学习的信息,相较于之前的方法具有更高的效率和泛化能力,并引入一个用于未学习模型的讯问用例。

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.

研究动机与目标

  • 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.

提出的方法

  • 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

实验结果

研究问题

  • 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?

主要发现

  • 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

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。