发现大模型对危害性的理解与拒绝行为是分开的,可用来检测危险输入。
LLMs Encode Harmfulness and Refusal Separately
- 区分了模型内部的'危害性'和'拒绝'两个独立维度。
- 操控危害性维度能让模型误判无害指令为有害,但拒绝维度只影响回应行为。
- 基于危害性表征的内置防护机制能有效应对越狱攻击且抗微调攻击。
大型语言模型在训练中学会拒绝有害指令,但其是否真正理解危害性仍存疑。以往研究发现,模型的拒绝行为受单一子空间(拒绝方向)调控。本文揭示了一个新维度——危害性,它在模型内部独立于拒绝行为存在。存在一个与拒绝方向不同的危害性方向:沿此方向操纵可使模型将无害指令误判为有害,而沿拒绝方向操纵仅引发拒绝响应,不改变模型对危害性的判断。进一步发现,某些越狱方法通过削弱拒绝信号而非改变模型对危害性的内在认知来绕过防护;对抗微调模型接受有害指令也几乎不影响其内部危害性信念。由此提出一种实用安全方案:利用模型隐含的危害性表示作为内在防护(Latent Guard),可检测危险输入并减少过度拒绝,且对微调攻击具有鲁棒性。例如,其性能媲美或优于专门微调的Llama Guard 3 8B,在多种越狱攻击下表现稳定。结果表明,模型对危害性的内在理解比其拒绝决策更具鲁棒性,为人工智能安全研究提供了新视角。
原文摘要 · Abstract (English)
LLMs are trained to refuse harmful instructions, but do they truly understand harmfulness beyond just refusing? Prior work has shown that LLMs' refusal behaviors can be mediated by a one-dimensional subspace, i.e., a refusal direction. In this work, we identify a new dimension to analyze safety mechanisms in LLMs, i.e., harmfulness, which is encoded internally as a separate concept from refusal. There exists a harmfulness direction that is distinct from the refusal direction. As causal evidence, steering along the harmfulness direction can lead LLMs to interpret harmless instructions as harmful, but steering along the refusal direction tends to elicit refusal responses directly without reversing the model's judgment on harmfulness. Furthermore, using our identified harmfulness concept, we find that certain jailbreak methods work by reducing the refusal signals without reversing the model's internal belief of harmfulness. We also find that adversarially finetuning models to accept harmful instructions has minimal impact on the model's internal belief of harmfulness. These insights lead to a practical safety application: The model's latent harmfulness representation can serve as an intrinsic safeguard (Latent Guard) for detecting unsafe inputs and reducing over-refusals that is robust to finetuning attacks. For instance, our Latent Guard achieves performance comparable to or better than Llama Guard 3 8B, a dedicated finetuned safeguard model, across different jailbreak methods. Our findings suggest that LLMs' internal understanding of harmfulness is more robust than their refusal decision to diverse input instructions, offering a new perspective to study AI safety.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。