Dialectics of Alignment: Harnessing Unsafe Knowledge for Dynamic Safety Routing

Maryam Hashemzadehα,β,γ Jerry Huangα,β,γ Minseon Kimδ
Marc-Alexandre Côtéβ,δ♣ Sarath Chandarα,β,ε,ζ♣
♣ Equal supervision
αChandar Research Lab
δMicrosoft Research
βMila – Quebec AI Institute
εPolytechnique Montréal
γUniversité de Montréal
ζCanada CIFAR AI Chair
Chandar Research Lab Mila AI Institute Microsoft Research

Quick Highlights

Abstract

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. During inference, this router dynamically orchestrates the unsafe experts, effectively steering the generation trajectory to harness their deep domain knowledge while strictly enforcing safety constraints. Extensive empirical evaluations across stringent safety benchmarks demonstrate that SafeMoE is not only safer, achieving over a 20% relative improvement in safe response rate (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.

💡 The Problem: "Safety-by-Erasure"

Recent efforts in LLM safety have focused on preventing the generation of harmful content. However, the prevailing alignment paradigm often over-corrects, causing models to strictly refuse prompts that exhibit even tangential hints of suspicious intent.

🚫 The Symptom

Systems default to generic, blanket refusals (e.g., "Sorry, I cannot help you."), particularly when navigating risky, complex, or sensitive queries.

⚠️ The Consequence

While reducing immediate toxicity, this severely degrades informativeness and user experience, restricting the model's epistemological scope.

The Hidden Danger: In contexts involving psychological distress (e.g., inquiries related to self-harm), uninformative blanket refusals can inadvertently drive well-intentioned users toward adversarial circumvention or migration to less-restrictive, unmoderated platforms, thereby exacerbating the likelihood of harmful outcomes.

🚀 Our Approach: The SafeMoE Framework

By isolating unsafe knowledge into specialized components, we hypothesize that its informative value can be harnessed while steering models toward safe outcomes using a minimal set of aligned examples. We introduce SafeMoE, a Mixture-of-Experts (MoE) framework that utilizes domain-specific Low-Rank Adapters (LoRAs) to "bottle" unsafe knowledge. Uniquely, these experts encapsulate rich, domain-specific primitives that, despite their unsafe nature, are critical for detailed generation.

Figure 1: (1) Unsafe experts are trained using a large set of unsafe response data that can be split into domains. (2) Experts are used to train a router with a smaller set of safe response data. In the second stage, the experts are frozen, while only the router is trainable.

Figure 1: (1) Unsafe experts are trained using a large set of unsafe response data that can be split into domains. (2) Experts are used to train a router with a smaller set of safe response data. In the second stage, the experts are frozen, while only the router is trainable.

Training Stages

📊 Main Results: Safety Across Benchmarks

To assess generalization, we evaluated our method on several standard safety benchmarks: AdvBench, HarmBench, BeaverTails, HarmfulQA, and PKU-Safe. We compared performance against the baselines using raw behavioral prompt sets, without any additional training.

Our models achieve high safety scores even without overlapping unsafe experts, consistently outperforming baselines like SN-Tune and SafeLoRA across all benchmarks. Notably, SafeMoE-XL reaches 97.2% safety on AdvBench while remaining highly informative. While Oyster-I matches SafeMoE-XL's performance, it requires costly reasoning and the scale of 14B parameters.

Safety Rate & Informativeness Comparison

View Full Detailed Results Table
Method AdvBench HarmBench Beaver Tails HarmfulQA PKU-Safe
Safe (%) Info Safe (%) Info Safe (%) Info Safe (%) Info Safe (%) Info
Mistral-7B 11.94.6 14.33.5 31.43.9 40.14.0 17.35.6
SafeMoE-XL (Ours) 97.28.2 82.57.5 87.26.4 98.17.1 90.88.1
Qwen-3B 31.14.4 27.54.1 34.06.2 32.86.2 11.66.9
SafeMoE-Qwen (Ours) 73.27.8 71.97.5 63.46.9 69.96.9 62.37.4
SafeLORA 25.15.9 20.76.3 15.74.5 23.95.2 10.03.8
SN-Tune 55.26.9 49.66.1 51.65.2 44.64.4 39.84.7
Oyster-I 14B 80.56.9 75.47.1 81.77.6 82.37.3 90.68.1
Zephyr 44.57.2 52.46.3 39.85.9 45.96.7 54.17.8
RealSafe-R1 60.85.8 59.36.7 68.85.6 72.26.1 74.67.8
Mistral-SFT 27.76.7 30.36.6 22.45.9 19.15.8 25.87.1
Deepseek-R1-Qwen 48.96.7 49.16.5 53.66.8 48.27.0 51.87.3

Table 1: Benchmarking Safety and Informativeness Across Model Categories. We report the Safety Rate (Safe, %) and Informativeness Score (Info) across five diverse safety benchmarks.

📈 Additional Evaluations

Adversarial Robustness & Data Efficiency

We assess the adversarial resilience of SafeMoE-XL using PAIR with Claude-3.5-Sonnet as the red-teaming agent. As shown below, SafeMoE achieves a near-optimal 1% Attack Success Rate (ASR) on HarmBench, a 41% absolute improvement over the baseline, demonstrating robust generalization against iterative attacks.

Model HarmBench PKU-Safe
ASR (↓) MJS (↓) ASR (↓) MJS (↓)
Mistral-SFT 42%3.15 62%5.60
SafeMoE-XL (Ours) 1%1.10 25%2.78
Qwen3-4B-Instruct 24%2.70 48%3.60
SafeMoE-Qwen (Ours) 20%2.10 32%3.10

Table 2: Attack Success Rate (ASR) and Mean Judge Score (MJS) for adversarial robustness evaluation.

Ablating the volume of safe training data reveals remarkable few-shot efficiency. SafeMoE matches the RealSafe-R1 safety baseline with just 20 safe samples per domain, and matches its informativeness with 100 samples.

Figure 2: SafeMoE exhibits strong few-shot efficiency as the number of safe samples per domain scales.

Figure 2: SafeMoE exhibits strong few-shot efficiency as the number of safe samples per domain scales.

Over-Refusal Analysis

Evaluated on OrBench, SafeMoE maintains high safety on toxic prompts while effectively minimizing over-refusals on hard, benign prompts.

Figure 3: SafeMoE models maintain high performance on hard categories and improve safety on toxic categories without collapsing into blanket refusals.

Figure 3: SafeMoE models maintain high performance on hard categories and improve safety on toxic categories without collapsing into blanket refusals.

📝 Citation

If you find our work useful, please consider citing our paper:

@article{hashemzadeh2026dialectics,
  title={Dialectics of Alignment: Harnessing Unsafe Knowledge for Dynamic Safety Routing},
  author={Hashemzadeh, Maryam and Huang, Jerry and Kim, Minseon and C{\^o}t{\'e}, Marc-Alexandre and Chandar, Sarath},
  journal={arXiv preprint arXiv:2606.00686},
  year={2026}
}