Jailbreaking LLMs' Safeguard with Universal Magic Words for Text Embedding Models

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Liang, Haoyu, Sun, Youran, Cai, Yunfeng, Zhu, Jun, Zhang, Bo
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866915291192098816
author Liang, Haoyu
Sun, Youran
Cai, Yunfeng
Zhu, Jun
Zhang, Bo
author_facet Liang, Haoyu
Sun, Youran
Cai, Yunfeng
Zhu, Jun
Zhang, Bo
contents The security issue of large language models (LLMs) has gained wide attention recently, with various defense mechanisms developed to prevent harmful output, among which safeguards based on text embedding models serve as a fundamental defense. Through testing, we discover that the output distribution of text embedding models is severely biased with a large mean. Inspired by this observation, we propose novel, efficient methods to search for **universal magic words** that attack text embedding models. Universal magic words as suffixes can shift the embedding of any text towards the bias direction, thus manipulating the similarity of any text pair and misleading safeguards. Attackers can jailbreak the safeguards by appending magic words to user prompts and requiring LLMs to end answers with magic words. Experiments show that magic word attacks significantly degrade safeguard performance on JailbreakBench, cause real-world chatbots to produce harmful outputs in full-pipeline attacks, and generalize across input/output texts, models, and languages. To eradicate this security risk, we also propose defense methods against such attacks, which can correct the bias of text embeddings and improve downstream performance in a train-free manner.
format Preprint
id arxiv_https___arxiv_org_abs_2501_18280
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Jailbreaking LLMs' Safeguard with Universal Magic Words for Text Embedding Models
Liang, Haoyu
Sun, Youran
Cai, Yunfeng
Zhu, Jun
Zhang, Bo
Computation and Language
Artificial Intelligence
Machine Learning
Neural and Evolutionary Computing
The security issue of large language models (LLMs) has gained wide attention recently, with various defense mechanisms developed to prevent harmful output, among which safeguards based on text embedding models serve as a fundamental defense. Through testing, we discover that the output distribution of text embedding models is severely biased with a large mean. Inspired by this observation, we propose novel, efficient methods to search for **universal magic words** that attack text embedding models. Universal magic words as suffixes can shift the embedding of any text towards the bias direction, thus manipulating the similarity of any text pair and misleading safeguards. Attackers can jailbreak the safeguards by appending magic words to user prompts and requiring LLMs to end answers with magic words. Experiments show that magic word attacks significantly degrade safeguard performance on JailbreakBench, cause real-world chatbots to produce harmful outputs in full-pipeline attacks, and generalize across input/output texts, models, and languages. To eradicate this security risk, we also propose defense methods against such attacks, which can correct the bias of text embeddings and improve downstream performance in a train-free manner.
title Jailbreaking LLMs' Safeguard with Universal Magic Words for Text Embedding Models
topic Computation and Language
Artificial Intelligence
Machine Learning
Neural and Evolutionary Computing
url https://arxiv.org/abs/2501.18280