arXiv:2602.13547cs.CRcs.AI2026-02被引 3

AISA让大模型自带安全意识,无需改参数就能防越狱攻击。

AISA: Awakening Intrinsic Safety Awareness in Large Language Models against Jailbreak Attacks

  • 通过分析注意力头激活模式,挖掘模型内部隐含的安全信号。
  • 在7B模型上实现与商用防护方案相当的检测效果,开销极小。
  • 无需调参或额外模块,适合部署在对安全性要求高的场景。

大型语言模型仍易受越狱提示攻击,导致产生有害或违反政策的内容。现有防御方法多依赖昂贵微调、侵入式提示重写或外部过滤器,带来延迟并降低模型帮助性。本文提出AISA,一种轻量级、单次通过的防御机制,激活模型内部已存在的安全能力,而非外加安全功能。AISA通过时空分析定位内在安全感知,发现意图区分信号广泛编码,尤其在生成前最后结构标记附近的特定注意力头的缩放点积输出中表现突出。利用自动选取的少量注意力头,AISA以极低开销提取可解释的提示风险评分,达到检测级性能,在7B模型上媲美强大多数商业基线。随后,AISA在逻辑层进行引导:根据推断风险程度调节解码分布,从正常生成到适度拒绝,不改变模型参数、不添加辅助模块,也无需多轮推理。在13个数据集、12个大模型和14个基线上的实验证明,AISA显著提升鲁棒性与迁移能力,同时保持实用性并减少误拒,使弱对齐或故意风险模型也能安全部署。

原文摘要 · Abstract (English)

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.

大模型安全越狱防御注意力分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。