arXiv:2506.02460cs.CL2025-06EMNLP被引 5

用专家混合框架动态平衡大模型的安全与有用性。

MidPO: Dual Preference Optimization for Safety and Helpfulness in Large Language Models via a Mixture of Experts Framework

  • 拆分模型为安全与有用两个独立专家,分别优化。
  • 在三个数据集上同时提升安全性和有用性表现。
  • 适合需要双重要求的实用型大模型部署场景。

随着大语言模型(LLMs)在多个领域广泛应用,如何在保持有用性的同时提升安全性成为关键挑战。现有方法分为安全约束的在线与离线偏好优化,前者常过度保守导致有用性下降,后者难以自适应平衡二者。为此,本文提出MidPO,一种基于混合专家(MoE)框架的双重偏好优化方法。首先,采用增强的直接偏好优化将基础模型分解为独立的安全专家与有用性专家,并分别优化以实现最优性能;其次,将两专家集成至MoE框架,设计动态路由机制,按需自适应分配贡献。在三个主流数据集上的定量与定性实验表明,MidPO显著优于当前最优方法,在安全性和有用性上均实现提升。代码与模型将公开发布。

原文摘要 · Abstract (English)

As large language models (LLMs) are increasingly applied across various domains, enhancing safety while maintaining the helpfulness of LLMs has become a critical challenge. Recent studies solve this problem through safety-constrained online preference optimization or safety-constrained offline preference optimization. However, the safety-constrained online methods often suffer from excessive safety, which might reduce helpfulness, while the safety-constrained offline methods perform poorly in adaptively balancing safety and helpfulness. To address these limitations, we propose MidPO, a \textbf{\underline{Mi}}xture of Experts (MoE) framework for safety-helpfulness \textbf{\underline{d}}ual \textbf{\underline{P}}reference \textbf{\underline{O}}ptimization. Firstly, MidPO devises single-preference enhanced direct preference optimization approach to transform the base model into two independent experts, termed safety and helpfulness experts, and fine-tunes the two independent experts for optimal safety or helpfulness performance. Secondly, to achieve an effective balance between safety and helpfulness, MidPO incorporates the two experts into the MoE framework and designs a dynamic routing mechanism to allocate contributions from each expert adaptively. We conduct quantitative and qualitative experiments on three popular datasets to demonstrate the proposed MidPO significantly outperforms state-of-the-art approaches in both safety and helpfulness. The code and models will be released.

大模型优化安全与有用性MoE框架

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。