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

Leo Schwinn, David Dobre, Sophie Xhonneux, G. Gidel, Stephan Günnemann
2/3/2026

No official code found. Best implementation: SchwinnL/LLM_Embedding_Attack (34 stars, MIT, last commit 2025-01-10).

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.

View on arXivView PDF

Code Implementations(1)

MIT

Code to conduct an embedding attack on LLMs

345PythonOct 3, 20231 years agoMIT

Similar Papers

Cite this paper

@article{schwinn2026soft,
  title  = {Soft Prompt Threats: Attacking Safety Alignment and Unlearning in Open-Source LLMs through the Embedding Space},
  author = {Leo Schwinn and David Dobre and Sophie Xhonneux and G. Gidel and Stephan Günnemann},
  year   = {2026},
  eprint = {2402.09063},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2402.09063},
  url    = {https://arxiv.org/abs/2402.09063},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.09063.svg)](https://codeofpaper.com/paper/2402.09063)

Discussion