AISA: 在大型语言模型中唤醒对抗劫持攻击的内在安全性意识
AISA: Awakening Intrinsic Safety Awareness in Large Language Models against Jailbreak Attacks
AI总结:
AISA通过激活模型内在安全机制,提供一种轻量级、单次通过的防御方法,有效提升大型语言模型对抗劫持攻击的鲁棒性与安全性。
摘要:
大型语言模型(LLMs)仍然容易受到劫持提示的影响,这些提示会引发有害或违反政策的输出,而许多现有防御方法依赖于昂贵的微调、侵入性的提示重写或外部防护栏,这些方法会增加延迟并可能降低有用性。我们提出了AISA,一种轻量级、单次通过的防御方法,它激活模型内部已存在的安全行为,而不是将安全性视为附加功能。AISA首先通过时空分析本地化内在安全性意识,并显示意图区分信号广泛编码,特别是在生成前的特定注意力头的缩放点积输出中表现出特别强的分离性。使用一个紧凑的自动选择的头部集合,AISA提取出一个可解释的提示风险评分,具有最小的开销,实现了在小型(7B)模型上与强大专有基线相媲美的检测器性能。AISA然后执行logits级的引导:它根据推断出的风险比例调节解码分布,从正常生成良性提示到经过校准的拒绝高风险请求——不改变模型参数、添加辅助模块或需要多次推理。广泛实验覆盖13个数据集、12个LLMs和14个基线,证明AISA在提高鲁棒性和迁移性的同时保持了有用性和减少假拒绝,使安全部署成为可能,即使对于弱对齐或故意风险的模型变体。
英文摘要:
Large language models (LLMs) remain vulnerable to jailbreak prompts that elicit harmful or policy-violating outputs, while many existing defenses rely on expensive fine-tuning, intrusive prompt rewriting, or external guardrails that add latency and can degrade helpfulness. We present AISA, a lightweight, single-pass defense that activates safety behaviors already latent inside the model rather than treating safety as an add-on. AISA first localizes intrinsic safety awareness via spatiotemporal analysis and shows that intent-discriminative signals are broadly encoded, with especially strong separability appearing in the scaled dot-product outputs of specific attention heads near the final structural tokens before generation. Using a compact set of automatically selected heads, AISA extracts an interpretable prompt-risk score with minimal overhead, achieving detector-level performance competitive with strong proprietary baselines on small (7B) models. AISA then performs logits-level steering: it modulates the decoding distribution in proportion to the inferred risk, ranging from normal generation for benign prompts to calibrated refusal for high-risk requests -- without changing model parameters, adding auxiliary modules, or requiring multi-pass inference. Extensive experiments spanning 13 datasets, 12 LLMs, and 14 baselines demonstrate that AISA improves robustness and transfer while preserving utility and reducing false refusals, enabling safer deployment even for weakly aligned or intentionally risky model variants.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。