arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.24936cs.CL
收藏

基于对比原型结构的大语言模型越狱检测

Jailbreak Detection on Large Language Models via Contrastive Prototype Structures

Technical University of Munich(慕尼黑工业大学);Insure AI;Munich Re(慕尼黑再保险公司)

Yan Qiu, Yuanyuan Li

AI总结:

针对大语言模型越狱检测问题,提出JDPI方法,利用对比学习与二元安全标签构建原型,在多基准测试中较分类器基线及Llama Guard 3-8B展现出更优的检测性能与跨数据集鲁棒性。

摘要:

越狱尝试和有害提示仍是大语言模型安全部署的挑战。本研究探究对比学习得到的表征是否可支持安全检测,无需训练额外的下游分类器。我们提出原型推理的越狱检测方法(JDPI),利用二元安全标签构建有害与良性原型,通过相对原型距离进行预测。JDPI仅使用二元安全标签完成编码器适配、原型构建与验证;在本设置中,它比分类器基线(方法A)使用更少的标注样本,因避免了训练下游分类器所需的单独划分。在覆盖不同输入格式的四个基准测试中,对比微调使JDPI的检测准确率提升9.1至18.0个百分点;使用相同编码器时,JDPI在一个基准测试上的ROC-AUC略高,在所有四个基准测试中与基线的差距不超过0.017。经特定数据集适配后,JDPI在四个基准测试中的ROC-AUC较发布的Llama Guard 3-8B基线高出0.173至0.310。在TomGibbs的多轮重放测试中,JDPI利用对话展开过程中积累的用户历史,实现的对话级准确率高于仅使用当前轮次的情况;在12次定向迁移测试中,JDPI的准确率平均比分类器高出1.59个百分点,展现出更强的跨数据集鲁棒性。

英文摘要:

Jailbreak attempts and harmful prompts remain a challenge for the safe deployment of large language models. We study whether contrastively learned representations can support safety detection without training an additional downstream classifier. We propose Jailbreak Detection with Prototype Inference (JDPI), which uses binary safety labels to construct harmful and benign prototypes and makes predictions from relative prototype distances. JDPI uses only binary safety labels for encoder adaptation, prototype construction, and validation. In our setup, it uses fewer labeled examples than the classifier baseline (Method A) by avoiding the separate split used to train the downstream classifier. Across four benchmarks covering different input formats, contrastive fine-tuning improves JDPI's detection accuracy by 9.1-18.0 percentage points. Using the same encoder, JDPI achieves slightly higher ROC-AUC on one benchmark and stays within 0.017 of the baseline across all four. With dataset-specific adaptation, JDPI exceeds the released Llama Guard 3-8B baseline by 0.173-0.310 in ROC-AUC across the four benchmarks. In multi-turn replay on TomGibbs, JDPI uses accumulated user history as the conversation unfolds, achieving higher conversation-level accuracy than when it uses the current turn alone. Across 12 directed transfers, JDPI outperforms the classifier by an average of 1.59 percentage points in accuracy, demonstrating stronger cross-dataset robustness.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑