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

通过在线策略自我蒸馏减少大语言模型安全对齐的安全部署税

Reducing the Safety Tax in LLM Safety Alignment with On-Policy Self-Distillation

International Computer Science Institute(国际计算机科学研究所);Microsoft(微软);Berkeley Lab(伯克利实验室)

Yu Fu, Longxuan Yu, Haz Sameen Shahgir, Zhipeng Wei, Hui Liu, N. Benjamin Erichson, Yue Dong

AI总结:

本文提出了一种名为OPSA的在线策略自我蒸馏方法,通过引入教师翻转率指标,有效减少大语言模型在安全对齐过程中因分布不匹配导致的安全税,实验显示其在不同模型规模上均优于传统方法。

摘要:

安全对齐通常以牺牲推理能力为代价来提高对有害查询的鲁棒性,这种权衡被称为安全税。常见原因是分布不匹配:监督微调训练目标模型时,通常使用人类生成的安全演示、外部模型或固定自动生成的轨迹,而不是从自身策略采样的轨迹。我们识别出非策略训练不匹配是这一税的第二个来源,并研究了用于安全对齐的在线策略自我蒸馏(OPSA)。模型生成自己的轨迹,并从冻结的教师副本中接收密集的每token KL监督,该教师副本在特权安全上下文中进行条件化。由于该教师必须比采样的学生轨迹更安全,我们引入了教师翻转率:一个衡量特权上下文将不安全响应转换为安全响应频率的指标。我们使用此信号来寻找激活潜在安全推理而非仅引发安全外观演示的上下文。在两个推理模型家族和五个模型规模上,OPSA在匹配数据和全参数微调条件下,比非策略自我蒸馏和外部教师蒸馏实现了更优的安全-推理权衡,其在较小模型上获得最大收益(R1-Distill-1.5B增加8.85分,Qwen3-0.6B增加5.49分)。这些收益在不同训练集大小和自适应禁言评估中持续存在。token级分析进一步显示,OPSA将更新集中在早期合规决策token附近,提供了一种在保持通用推理的同时改进安全性的机制。

英文摘要:

Safety alignment often improves robustness to harmful queries at the cost of reasoning ability, a tradeoff known as the safety tax. A common cause is distributional mismatch: supervised fine-tuning trains the target model on safety demonstrations produced by humans, external models, or fixed self-generated traces, rather than on trajectories sampled from its own policy. We identify off-policy training mismatch as a second source of this tax and study on-policy self-distillation for safety alignment, which we call OPSA. The model generates its own rollouts and receives dense per-token KL supervision from a frozen teacher copy of itself conditioned on a privileged safety context. Because this teacher must be safer than the sampled student trajectory, we introduce \emph{teacher flip rate}: a criterion that measures how often a privileged context converts unsafe responses into safe ones. We use this signal to search for contexts that activate latent safety reasoning rather than merely elicit safe-looking demonstrations. Across two reasoning-model families and five model scales, OPSA achieves a stronger safety--reasoning tradeoff than off-policy self-distillation and external-teacher distillation under matched data and full-parameter fine-tuning, with the largest gains on smaller models (+8.85 points on R1-Distill-1.5B and +5.49 points on Qwen3-0.6B). The gains persist across training-set sizes and adaptive jailbreak evaluations. Token-level analyses further show that OPSA concentrates updates near early compliance-decision tokens, providing a mechanism for improving safety while preserving general reasoning.

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

↑