2025-12-04 · 专家 · 自然语言处理 · 机器学习

In-Context Representation Hijacking

Doublespeak攻击通过在上下文中替换有害关键词,使大型语言模型(LLMs)的内部表示从无害意义逐渐转变为有害意义,从而绕过模型的安全机制。

更新于 2025-12-05。作者:Itay Yona、Amir Sarid、Michael Karasik、Yossi Gandelsman。

中文摘要

我们引入了Doublespeak,这是一种针对大型语言模型(LLMs)的简单上下文表示劫持攻击。该攻击通过在多个上下文示例中系统地用一个有害关键词(例如,炸弹)替换为一个良性标记(例如,胡萝卜),并提供一个有害请求的前缀来实现。我们证明这种替换导致良性标记的内部表示逐渐趋同于有害标记,从而在委婉语下有效地嵌入有害语义。因此,表面上无害的提示(例如,“如何制作胡萝卜?”)在内部被解释为不允许的指令(例如,“如何制作炸弹?”),从而绕过了模型的安全对齐。我们使用可解释性工具表明,这种语义覆盖是逐层出现的,早期层的良性意义在后期层逐渐汇聚成有害语义。Doublespeak无需优化,可以广泛地跨模型家族迁移,并在闭源和开源系统上实现了高成功率,使用单句上下文覆盖在Llama-3.3-70B-Instruct上达到了74%的ASR。我们的发现突显了LLMs潜在空间中一个新的攻击面,揭示了当前的对齐策略不足,应改为在表示层面上操作。

英文摘要

We introduce Doublespeak, a simple in-context representation hijacking attack against large language models (LLMs). The attack works by systematically replacing a harmful keyword (e.g., bomb) with a benign token (e.g., carrot) across multiple in-context examples, provided a prefix to a harmful request. We demonstrate that this substitution leads to the internal representation of the benign token converging toward that of the harmful one, effectively embedding the harmful semantics under a euphemism. As a result, superficially innocuous prompts (e.g., ``How to build a carrot?'') are internally interpreted as disallowed instructions (e.g., ``How to build a bomb?''), thereby bypassing the model's safety alignment. We use interpretability tools to show that this semantic overwrite emerges layer by layer, with benign meanings in early layers converging into harmful semantics in later ones. Doublespeak is optimization-free, broadly transferable across model families, and achieves strong success rates on closed-source and open-source systems, reaching 74\% ASR on Llama-3.3-70B-Instruct with a single-sentence context override. Our findings highlight a new attack surface in the latent space of LLMs, revealing that current alignment strategies are insufficient and should instead operate at the representation level.

解读

一句话总结

Doublespeak攻击通过在上下文中替换有害关键词,使大型语言模型(LLMs)的内部表示从无害意义逐渐转变为有害意义,从而绕过模型的安全机制。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源