对齐的辩证法:利用不安全知识实现动态安全路由
Dialectics of Alignment: Harnessing Unsafe Knowledge for Dynamic Safety Routing
AI总结:
提出SafeMoE框架,通过混合专家模型将不安全知识隔离到领域特定的低秩适配器中,并训练轻量级门控网络动态路由这些专家,在保持安全性的同时生成信息丰富的响应。
摘要:
大语言模型(LLM)对齐的主流范式通过擦除、过滤不安全数据或训练模型严格拒绝有害提示来运作。虽然这种方法能有效降低即时毒性,但根本上限制了模型的认识论范围,导致系统过度谨慎,对敏感但良性的查询输出无信息量的全面拒绝。在这项工作中,我们挑战了不安全数据必须丢弃的正统观念。我们提出了一种对齐的辩证方法,认为不安全数据编码了丰富的、领域特定的知识,对于细致、安全且信息丰富的生成至关重要。为实现这一点,我们引入了SafeMoE,一个混合专家(MoE)框架,将不安全知识隔离到仅在有害语料上训练的领域特定低秩适配器(LoRA专家)中。为了从这些不安全基元中综合安全性,我们使用最小、高度精选的安全信息响应集训练一个轻量级门控网络。在推理时,该路由器动态编排不安全专家,有效引导生成轨迹以利用其深层领域知识,同时严格执行安全约束。在严格的安全基准上的广泛实证评估表明,SafeMoE不仅更安全,安全响应率相对提高了20%以上(绝对增益超过15%),而且在安全性和危害性至关重要时能生成更具信息量的响应。此外,路由机制在未见领域和更广泛的安全任务上表现出强大的零样本泛化能力,无需领域特定监督。我们的发现表明对齐的范式转变:真正的安全不需要掩盖不安全知识,而是需要其受控整合。
英文摘要:
The prevailing paradigm in large language model (LLM) alignment operates via erasure, filtering unsafe data or training models to strictly refuse harmful prompts. While effective at reducing immediate toxicity, this approach fundamentally constricts the model's epistemological scope, resulting in over-cautious systems that output uninformative blanket refusals to sensitive yet benign queries. In this work, we challenge the orthodoxy that unsafe data must be discarded. We propose a dialectical approach to alignment, positing that unsafe data encodes rich, domain-specific knowledge critical for nuanced, safe, and informative generation. To operationalize this, we introduce SafeMoE, a Mixture-of-Experts (MoE) framework that isolates unsafe knowledge into domain-specific Low-Rank Adapters (LoRA experts) trained exclusively on harmful corpora. To synthesize safety from these unsafe primitives, we train a lightweight gating network using a minimal, highly curated set of safe-informative responses (as few as 100 samples per domain). During inference, this router dynamically orchestrates the unsafe experts, effectively steering the generation trajectory toward safe outcomes while harnessing the experts' deep domain knowledge. Extensive empirical evaluations across stringent safety benchmarks demonstrate that SafeMoE is not only safer, achieving over a 20% relative improvement in safe response rate over the strongest baseline (RealSafe-R1 on PKU-SafeRLHF; more than a 15% absolute gain), but also produces more informative responses when safety and harmfulness are of paramount concern. Furthermore, the routing mechanism exhibits strong zero-shot generalization to unseen domains and broader safety tasks without domain-specific supervision. Our findings suggest a paradigm shift in alignment: true safety requires not the masking of unsafe knowledge, but its controlled integration.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。