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

Yanrui Du, Sendong Zhao, Danyang Zhao, Ming Ma, Yuhan Chen +4 more
2/3/2026

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

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 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 7 B , Vicuna 7 B , Falcon 7 B , Dolphin 7 B , and Baichuan2 7 B at github 2 . Warning: This paper presents examples of malicious instructions that may be offensive and upsetting.

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{du2026mogu,
  title  = {MoGU: A Framework for Enhancing Safety of LLMs While Preserving Their Usability},
  author = {Yanrui Du and Sendong Zhao and Danyang Zhao and Ming Ma and Yuhan Chen and Liangyu Huo and Qing Yang and Dongliang Xu and Bing Qin},
  year   = {2026},
  doi    = {10.52202/079017-2780},
  url    = {https://doi.org/10.52202/079017-2780},
  journal = {NEURIPS 2024 2024}
}

Discussion