MoGU: A Framework for Enhancing Safety of Open-Sourced LLMs While Preserving Their Usability

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Du, Yanrui, Zhao, Sendong, Zhao, Danyang, Ma, Ming, Chen, Yuhan, Huo, Liangyu, Yang, Qing, Xu, Dongliang, Qin, Bing
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914807789125632
author Du, Yanrui
Zhao, Sendong
Zhao, Danyang
Ma, Ming
Chen, Yuhan
Huo, Liangyu
Yang, Qing
Xu, Dongliang
Qin, Bing
author_facet Du, Yanrui
Zhao, Sendong
Zhao, Danyang
Ma, Ming
Chen, Yuhan
Huo, Liangyu
Yang, Qing
Xu, Dongliang
Qin, Bing
contents Large Language Models (LLMs) are increasingly deployed in various applications. As their usage grows, concerns regarding their safety are rising, especially in maintaining harmless responses when faced with malicious instructions. Many defense strategies have been developed to enhance the safety of LLMs. However, our research finds that existing defense strategies lead LLMs to predominantly adopt a rejection-oriented stance, thereby diminishing the usability of their responses to benign instructions. To solve this problem, we introduce the MoGU framework, designed to enhance LLMs' safety while preserving their usability. Our MoGU framework transforms the base LLM into two variants: the usable LLM and the safe LLM, and further employs dynamic routing to balance their contribution. When encountering malicious instructions, the router will assign a higher weight to the safe LLM to ensure that responses are harmless. Conversely, for benign instructions, the router prioritizes the usable LLM, facilitating usable and helpful responses. On various open-sourced LLMs, we compare multiple defense strategies to verify the superiority of our MoGU framework. Besides, our analysis provides key insights into the effectiveness of MoGU and verifies that our designed routing mechanism can effectively balance the contribution of each variant by assigning weights. Our work released the safer Llama2, Vicuna, Falcon, Dolphin, and Baichuan2.
format Preprint
id arxiv_https___arxiv_org_abs_2405_14488
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle MoGU: A Framework for Enhancing Safety of Open-Sourced LLMs While Preserving Their Usability
Du, Yanrui
Zhao, Sendong
Zhao, Danyang
Ma, Ming
Chen, Yuhan
Huo, Liangyu
Yang, Qing
Xu, Dongliang
Qin, Bing
Computation and Language
Large Language Models (LLMs) are increasingly deployed in various applications. As their usage grows, concerns regarding their safety are rising, especially in maintaining harmless responses when faced with malicious instructions. Many defense strategies have been developed to enhance the safety of LLMs. However, our research finds that existing defense strategies lead LLMs to predominantly adopt a rejection-oriented stance, thereby diminishing the usability of their responses to benign instructions. To solve this problem, we introduce the MoGU framework, designed to enhance LLMs' safety while preserving their usability. Our MoGU framework transforms the base LLM into two variants: the usable LLM and the safe LLM, and further employs dynamic routing to balance their contribution. When encountering malicious instructions, the router will assign a higher weight to the safe LLM to ensure that responses are harmless. Conversely, for benign instructions, the router prioritizes the usable LLM, facilitating usable and helpful responses. On various open-sourced LLMs, we compare multiple defense strategies to verify the superiority of our MoGU framework. Besides, our analysis provides key insights into the effectiveness of MoGU and verifies that our designed routing mechanism can effectively balance the contribution of each variant by assigning weights. Our work released the safer Llama2, Vicuna, Falcon, Dolphin, and Baichuan2.
title MoGU: A Framework for Enhancing Safety of Open-Sourced LLMs While Preserving Their Usability
topic Computation and Language
url https://arxiv.org/abs/2405.14488