通过识别指令背后的意图,让大模型更聪明地抵御越狱攻击。
Mitigating Jailbreaks with Intent-Aware LLMs
- 先分析用户指令的真正意图,再决定是否回应。
- 在多种攻击下成功率均低于50%,显著优于现有方法。
- 既防攻击又不误伤正常提问,适合安全防护场景。
尽管进行了大量安全调优,大型语言模型仍易受对抗性指令的越狱攻击,反映出安全性与任务性能之间的持续权衡。本文提出Intent-FT,一种简单轻量的微调方法,让模型在回应前显式推断指令的潜在意图。通过在特定对抗指令集上微调,Intent-FT使模型能泛化到未见过的攻击,显著提升鲁棒性。我们在开源与专有模型上全面评估了参数型与非参数型攻击,涵盖攻击危害性、任务效用、过度拒绝及对白盒威胁的影响。实证表明,Intent-FT始终有效缓解所有攻击类别,无一攻击成功率达超过50%——而现有防御手段仅部分有效。更重要的是,该方法保留了模型通用能力,并减少对含表面有害关键词的良性指令的过度拒绝。此外,经训练的模型能准确识别对抗攻击中的隐藏恶意意图,且这些意图知识可有效迁移以增强基础模型的防御能力。代码已公开于 https://github.com/wj210/Intent_Jailbreak。
原文摘要 · Abstract (English)
Despite extensive safety-tuning, large language models (LLMs) remain vulnerable to jailbreak attacks via adversarially crafted instructions, reflecting a persistent trade-off between safety and task performance. In this work, we propose Intent-FT, a simple and lightweight fine-tuning approach that explicitly trains LLMs to infer the underlying intent of an instruction before responding. By fine-tuning on a targeted set of adversarial instructions, Intent-FT enables LLMs to generalize intent deduction to unseen attacks, thereby substantially improving their robustness. We comprehensively evaluate both parametric and non-parametric attacks across open-source and proprietary models, considering harmfulness from attacks, utility, over-refusal, and impact against white-box threats. Empirically, Intent-FT consistently mitigates all evaluated attack categories, with no single attack exceeding a 50\% success rate -- whereas existing defenses remain only partially effective. Importantly, our method preserves the model's general capabilities and reduces excessive refusals on benign instructions containing superficially harmful keywords. Furthermore, models trained with Intent-FT accurately identify hidden harmful intent in adversarial attacks, and these learned intentions can be effectively transferred to enhance vanilla model defenses. We publicly release our code at https://github.com/wj210/Intent_Jailbreak.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。