Embedding Poisoning: Bypassing Safety Alignment via Embedding Semantic Shift

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yuan, Shuai, Zhang, Zhibo, Li, Yuxi, Bai, Guangdong, Kailong, Wang
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909775615229952
author Yuan, Shuai
Zhang, Zhibo
Li, Yuxi
Bai, Guangdong
Kailong, Wang
author_facet Yuan, Shuai
Zhang, Zhibo
Li, Yuxi
Bai, Guangdong
Kailong, Wang
contents The widespread distribution of Large Language Models (LLMs) through public platforms like Hugging Face introduces significant security challenges. While these platforms perform basic security scans, they often fail to detect subtle manipulations within the embedding layer. This work identifies a novel class of deployment phase attacks that exploit this vulnerability by injecting imperceptible perturbations directly into the embedding layer outputs without modifying model weights or input text. These perturbations, though statistically benign, systematically bypass safety alignment mechanisms and induce harmful behaviors during inference. We propose Search based Embedding Poisoning(SEP), a practical, model agnostic framework that introduces carefully optimized perturbations into embeddings associated with high risk tokens. SEP leverages a predictable linear transition in model responses, from refusal to harmful output to semantic deviation to identify a narrow perturbation window that evades alignment safeguards. Evaluated across six aligned LLMs, SEP achieves an average attack success rate of 96.43% while preserving benign task performance and evading conventional detection mechanisms. Our findings reveal a critical oversight in deployment security and emphasize the urgent need for embedding level integrity checks in future LLM defense strategies.
format Preprint
id arxiv_https___arxiv_org_abs_2509_06338
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Embedding Poisoning: Bypassing Safety Alignment via Embedding Semantic Shift
Yuan, Shuai
Zhang, Zhibo
Li, Yuxi
Bai, Guangdong
Kailong, Wang
Cryptography and Security
Machine Learning
The widespread distribution of Large Language Models (LLMs) through public platforms like Hugging Face introduces significant security challenges. While these platforms perform basic security scans, they often fail to detect subtle manipulations within the embedding layer. This work identifies a novel class of deployment phase attacks that exploit this vulnerability by injecting imperceptible perturbations directly into the embedding layer outputs without modifying model weights or input text. These perturbations, though statistically benign, systematically bypass safety alignment mechanisms and induce harmful behaviors during inference. We propose Search based Embedding Poisoning(SEP), a practical, model agnostic framework that introduces carefully optimized perturbations into embeddings associated with high risk tokens. SEP leverages a predictable linear transition in model responses, from refusal to harmful output to semantic deviation to identify a narrow perturbation window that evades alignment safeguards. Evaluated across six aligned LLMs, SEP achieves an average attack success rate of 96.43% while preserving benign task performance and evading conventional detection mechanisms. Our findings reveal a critical oversight in deployment security and emphasize the urgent need for embedding level integrity checks in future LLM defense strategies.
title Embedding Poisoning: Bypassing Safety Alignment via Embedding Semantic Shift
topic Cryptography and Security
Machine Learning
url https://arxiv.org/abs/2509.06338