atlas

Research map / Large language models / Language, safety and interpretability

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

NeurIPS 2024 · Large language models › Language, safety and interpretability · approach: Safety alignment of LLMs · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes MoGU, which turns an LLM into a usable and a safe LoRA variant and mixes them with a learned dynamic router so that malicious inputs favor the safe variant and benign inputs the usable one.

Problem

Existing LLM safety defenses make models reject benign instructions too often, lowering response usability; the goal is to raise safety against malicious and jailbreak prompts while keeping helpfulness on benign ones.

Approach

Build two LoRA variants of the base model (a Glad Responder trained to answer everything and an Unwilling Responder trained to refuse everything), then train a per-layer sigmoid router on the O_proj outputs that weights them by input type, using contrastive-style negative samples and an L1 constraint on weights; only the first few decoded tokens use MoGU.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
apply MoGU instead of No DefenseDolphin-7B · Red-team and jailbreak AVG.ASR: 93.98% -> 20.81%Helped
apply MoGU instead of No DefenseBaichuan2-7B · Red-team and jailbreak AVG.ASR: 23.91% -> 4.10%Helped
apply MoGU instead of No DefenseLlama2-7B · Just-Eval benignGPT-Eval AVG.: 3.87 -> 3.87No clear effect
apply MoGU instead of No DefenseLlama2-7B · Just-Eval benignrejection expressions: 14.00% -> 16.50%Hurt
add contrastive learning loss (ablation)MoGU · Red-team and jailbreak AVG., Llama2-7BASR: 1.50% -> 0.29%Helped
add L1 Norm constraint (ablation)MoGU · Red-team and jailbreak AVG., Llama2-7BASR: 4.49% -> 0.29%Helped
add contrastive learning loss (ablation)MoGU · Red-team and jailbreak AVG., Vicuna-7BASR: 9.64% -> 2.36%Helped
add L1 Norm constraint (ablation)MoGU · Red-team and jailbreak AVG., Vicuna-7BASR: 33.36% -> 2.36%Helped
add contrastive learning loss (ablation)MoGU · Red-team and jailbreak AVG., Falcon-7BASR: 10.13% -> 10.49%Hurt
add L1 Norm constraint (ablation)MoGU · Red-team and jailbreak AVG., Falcon-7BASR: 23.10% -> 10.49%Helped
set router dimension to 512 rather than 128, 256, or 1024 (ablation)MoGU · Red-team and jailbreak evaluations on Llama2-7B, Vicuna-7B, and Falcon-7BASRHelped

Surprising findings

Limitations

Experimental setup

Datasets: AdvBench Alpaca Just-Eval

Benchmarks: AdvBench Malicious (Just-Eval) AutoDAN GCG PAIR SAP30 Comp_obj Just-Eval

Metrics: ASR GPT-Judge harmfulness score GPT-Eval (helpfulness, clarity, factuality, depth, engagemen rule-based rejection rate

Baselines: SFT Detect_inp Self-Examine Retokenization Self-Reminder ICD SafeDecoding

Builds on: LoRA Mixture of Experts SFT SafeDecoding In-Context Defense

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy