融合引导向量检测的多模态越狱攻击防御方法OA
Multimodal Jailbreak Attack Defense Method with Integrated Steering Vector Detection
随着大型视觉语言模型在多模态任务中的广泛应用,其安全性面临严峻挑战.其中,越狱攻击通过对抗性样本和精心设计的提示绕过安全机制,诱导模型生成有害内容.现有防御方法多侧重于提升模型输出的安全性或有害样本的检测精度,但前者利用评估模型检测样本不仅容易降低对样本的区分度,同时会增加计算成本;而后者通常缺乏后续的对齐机制,无法有效干预模型输出.为此,提出一种新的基于引导向量检测并采用双重对齐机制的多模态防御方法,仅利用预先生成的引导向量检测模型输出,以提高检测精度与效率,通过对齐机制对输出进行过滤,旨在保证模型响应的安全性.该方法利用数据集中的有害问题与响应训练对抗性图像,与对应的有害问题及原始图像构成新数据集;将数据输入模型,分别提取模型在有害与原始输入下的隐藏状态,并计算正负样本的平均差异值,生成用于检测越狱攻击的引导向量与阈值.在推理阶段,利用该向量对隐藏状态进行投影并通过阈值判断输入是否有害;若判定为有害,则启动防御机制,借助外部模型生成候选输出并进行打分筛选,得到兼顾安全性与实用性的高质量回复.实验结果表明,该方法在多个数据集上对有害样本具有更高的检测准确率与鲁棒性,并显著提升了输出的安全性.同时,在样本检测阶段无需外部模型参与,有效降低了计算成本.
With the widespread adoption of large vision-language models in multimodal tasks,their security faces severe challenges.Among them,jailbreak attacks bypass safety mechanisms through adversarial samples and carefully crafted prompts,inducing models to generate harmful content.Existing defense approaches mainly focus on enhancing the safety of model outputs or improving the accuracy of harmful sample detection.However,the former often reduces discriminability and increases computational costs,while the latter usually lacks post-alignment mechanisms and cannot effectively intervene in model outputs.To address these issues,this paper proposes a novel multimodal defense method based on steering vector detection and dual-alignment mechanism.Specifically,the method employs pre-generated steering vectors to detect harmful outputs,thereby improving both detection accuracy and efficiency.A subsequent alignment mechanism is applied to filter the outputs,ensuring response safety.To construct training data,this paper generates adversarial images corres-ponding to harmful queries and responses,paired with the same harmful queries and original images to form a new dataset.The data are fed into the model to extract hidden states under both harmful and benign inputs.By computing the average differences between positive and negative samples,this paper obtains steering vectors and thresholds for jailbreak detection.During inference,model hidden states are projected onto the steering vectors,and inputs are classified as harmful or benign based on the threshold.If deemed harmful,the defense mechanism is triggered,where an external model generates candidate outputs that are scored and filtered to produce safe and useful responses.Experimental results demonstrate that the proposed method achieves higher detection accuracy and robustness against harmful samples across multiple datasets,while signifi-cantly improving output safety.Meanwhile,sample detection is conducted without the involvement of external models,effectively reducing computational costs.
姚佳旺;丁建伟;彭子铭;田华伟
中国人民公安大学 信息网络安全学院,北京 100038中国人民公安大学 信息网络安全学院,北京 100038中国人民公安大学 信息网络安全学院,北京 100038中国人民公安大学 信息网络安全学院,北京 100038
信息技术与安全科学
引导向量视觉语言模型越狱攻击多模态防御隐藏状态
steering vectorvisual-language modeljailbreak attackmultimodal defensehidden state
《计算机科学与探索》 2026 (9)
2644-2654,11
评论