arXiv:2505.22271cs.CRcs.AI2025-05被引 4

提出自进化防御框架,实时拦截多模态大模型的越狱攻击

Test-Time Immunization: A Universal Defense Framework Against Jailbreaks for (Multimodal) Large Language Models

  • 训练一个摘要标记用于高效检测越狱行为
  • 发现攻击后用拒绝回答数据自适应微调,保持防御能力
  • 适用于文本和图像越狱,适合部署在生产环境的模型

尽管(多模态)大语言模型因卓越能力受到广泛关注,但仍易受越狱攻击。现有防御方法通常针对特定类型攻击,难以应对多样化的对抗策略。例如,重述类防御对文本越狱有效,但无法应对图像类攻击。为此,我们提出一种通用防御框架——测试时免疫(TIM),可自适应地以自我演化方式抵御多种越狱攻击。TIM首先训练一个摘要标记用于高效检测越狱行为,并在推理阶段应用该标记识别攻击。一旦检测到越狱尝试,便使用捕获的越狱指令与拒绝回答进行安全微调。为避免微调导致检测模块性能下降,我们解耦了微调过程与检测模块。在大语言模型和多模态大语言模型上的大量实验验证了TIM的有效性。

原文摘要 · Abstract (English)

While (multimodal) large language models (LLMs) have attracted widespread attention due to their exceptional capabilities, they remain vulnerable to jailbreak attacks. Various defense methods are proposed to defend against jailbreak attacks, however, they are often tailored to specific types of jailbreak attacks, limiting their effectiveness against diverse adversarial strategies. For instance, rephrasing-based defenses are effective against text adversarial jailbreaks but fail to counteract image-based attacks. To overcome these limitations, we propose a universal defense framework, termed Test-time IMmunization (TIM), which can adaptively defend against various jailbreak attacks in a self-evolving way. Specifically, TIM initially trains a gist token for efficient detection, which it subsequently applies to detect jailbreak activities during inference. When jailbreak attempts are identified, TIM implements safety fine-tuning using the detected jailbreak instructions paired with refusal answers. Furthermore, to mitigate potential performance degradation in the detector caused by parameter updates during safety fine-tuning, we decouple the fine-tuning process from the detection module. Extensive experiments on both LLMs and multimodal LLMs demonstrate the efficacy of TIM.

大模型安全越狱防御自适应检测

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