arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.00454cs.CLcs.AI
收藏

防御性M2S:在压缩的多轮对话上训练防护模型

Defensive M2S: Training Guardrail Models on Compressed Multi-turn Conversations

KAIST(韩国科学技术院)

Hyunjun Kim

AI总结:

Defensive M2S通过压缩多轮对话训练防护模型,显著降低训练和推理成本,提升攻击检测效率。

摘要:

防护模型对于确保大型语言模型(LLM)部署的安全性至关重要,但处理完整的多轮对话历史记录会带来显著的计算成本。我们提出了Defensive M2S,一种训练范式,通过在多轮到单轮(M2S)压缩对话上微调防护模型,而不是完整的对话历史。我们提供了一种形式复杂度分析,显示M2S将训练成本从O(n²)降低到O(n)。在我们的训练数据集(779个样本,平均10.6轮)上,M2S仅需169,000个标记,而多轮基线则需要1570万个标记——减少了93倍。我们评估了Defensive M2S在三个防护模型家族(LlamaGuard、Nemotron、Qwen3Guard)和三个压缩模板(hyphenize、numberize、pythonize)上SafeDialBench基准测试中的表现。我们的最佳配置,Qwen3Guard与hyphenize压缩,实现了93.8%的攻击检测召回率,同时将推理标记减少94.6%(从3231到173个标记每轮)。这比基线提高了38.9个百分点,同时大幅降低了训练和推理成本。我们的发现表明,M2S压缩可以作为一种有效的效率技术,用于防护部署,使长多轮对话的安全筛查成为可能。

英文摘要:

Guardrail models are essential for ensuring the safety of Large Language Model (LLM) deployments, but processing full multi-turn conversation histories incurs significant computational cost. We propose Defensive M2S, a training paradigm that fine-tunes guardrail models on Multi-turn to Single-turn (M2S) compressed conversations rather than complete dialogue histories. We provide a formal complexity analysis showing that M2S reduces training cost from $O(n^2)$ to $O(n)$ for $n$-turn conversations. Empirically, on our training dataset (779 samples, avg. 10.6 turns), M2S requires only 169K tokens compared to 15.7M tokens for the multi-turn baseline -- a 93$\times$ reduction. We evaluate Defensive M2S across three guardrail model families (LlamaGuard, Nemotron, Qwen3Guard) and three compression templates (hyphenize, numberize, pythonize) on SafeDialBench, a comprehensive multi-turn jailbreak benchmark. Our best configuration, Qwen3Guard with hyphenize compression, achieves 93.8% attack detection recall while reducing inference tokens by 94.6% (from 3,231 to 173 tokens per conversation). This represents a 38.9 percentage point improvement over the baseline while dramatically reducing both training and inference costs. Our findings demonstrate that M2S compression can serve as an effective efficiency technique for guardrail deployment, enabling scalable safety screening of long multi-turn conversations.

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

↑