提出新方法让小模型学推理时更安全,避免被大模型带偏。
Slow Tuning and Low-Entropy Masking for Safe Chain-of-Thought Distillation
- 通过缓慢更新权重和屏蔽无意义词汇,减少安全风险。
- 在多个小模型上测试,既保持安全又提升推理能力。
- 适合需要安全可靠的推理模型落地的开发者使用。
以往的思维链(CoT)蒸馏方法主要通过利用强大语言模型(如GPT-4)生成高质量推理过程来增强小型语言模型(SLMs)的推理能力。然而,本研究揭示了训练过程对SLM安全性带来的负面影响。尽管已有工作通过微调或权重调整实现安全对齐,但通常需要额外计算资源或标注数据,且可能损害模型推理能力。本文提出一种安全蒸馏方法——慢速微调与低熵掩码蒸馏(SLowED),包含两个模块:慢速微调通过限制权重变化幅度,使模型在初始分布邻域内优化;低熵掩码则屏蔽低熵词元,排除其作为学习目标。在三个SLM(Qwen2.5-1.5B、Llama-3.2-1B、BLOOM-1.1B)上,针对BBH、BB-Sub、ARC、AGIEval等推理基准以及AdvBench安全评估的实验表明,SLowED在保持模型安全性的同时,推理能力与现有方法相当。消融实验进一步验证了两模块的有效性:慢速微调在训练初期保障安全,低熵掩码延长了安全训练周期。
原文摘要 · Abstract (English)
Previous chain-of-thought (CoT) distillation methods primarily focused on enhancing the reasoning capabilities of Small Language Models (SLMs) by utilizing high-quality rationales generated by powerful Large Language Models (LLMs, e.g., GPT-4). However, few works have noted the negative effects on SLM safety brought by the training, which are revealed in this study. Although there are works on safety alignment that fine-tune language models or manipulate model weights to defend against harmful inputs, they require extra computation or annotated data, and probably impact the reasoning ability of SLMs. In this paper, we investigate how to maintain the safety of SLMs during the CoT distillation process. Specifically, we propose a safe distillation method, Slow Tuning and Low-Entropy Masking Distillation (SLowED), containing two modules: Slow Tuning and Low-Entropy Masking. Slow Tuning scales down the magnitude of model weight changes to optimize the model weights in the neighboring space near the initial weight distribution. Low-Entropy Masking masks low-entropy tokens, which are regarded as unnecessary learning targets, to exclude them from fine-tuning. Experiments on three SLMs (Qwen2.5-1.5B, Llama-3.2-1B, BLOOM-1.1B) across reasoning benchmarks (BBH, BB-Sub, ARC, AGIEval) and safety evaluation (AdvBench) show that SLowED retains the safety of SLMs and comparably improves their reasoning capability compared to existing distillation methods. Furthermore, our ablation study presents the effectiveness of Slow Tuning and Low-Entropy Masking, with the former maintaining the model's safety in the early stage and the latter prolonging the safe training epochs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。