玩模型开放模型 · 清晰来源 · 自主选择
返回模型目录
Bahushruth /

Qwen3.6-35B-A3B-abliterated-v4

HF 源站

Bahushruth/Qwen3.6-35B-A3B-abliterated-v4 is an uncensored open-source model hosted on Hugging Face.

Text GenerationsafetensorsLicense: apache-2.035Btransformersqwen3_5_moe_textabliterationuncensoredqwen3moenorm-preservingconversationaldataset:Bahushruth/abliteration-harmful-enricheddataset:mlabonne/harmless_alpaca
README.md说明 / 使用方法

license: apache-2.0 base_model: Qwen/Qwen3.6-35B-A3B tags:

  • abliteration
  • uncensored
  • qwen3
  • moe
  • norm-preserving model_type: qwen3_moe pipeline_tag: text-generation datasets:
  • Bahushruth/abliteration-harmful-enriched
  • mlabonne/harmless_alpaca library_name: transformers

Qwen3.6-35B-A3B-abliterated-v4

本模型是 Qwen/Qwen3.6-35B-A3B 的未审查(Uncensored)版本,通过 消融技术(Abliteration)(保范数正交化,norm-preserving orthogonalization)移除了拒绝回答的行为。

GGUF 量化版本: Bahushruth/Qwen3.6-35B-A3B-abliterated-v4-GGUF

博客文章: Abliteration: Uncensoring LLMs via Weight Surgery

评测结果

指标原始模型v4(本模型)
有害提示词拒绝率~98%0% (0/16)
无害提示词拒绝率0%0%

对有害提示词零拒绝。对无害提示词无误拒情况。

方法原理

消融技术(Abliteration)用于定位模型残差流(residual stream)中的“拒绝方向”——即模型决定拒绝时激活的线性方向,并通过保范数正交化精准手术式地从所有输出投影权重中剔除该方向。

参数数值
移除方向数1(单个最高层)
正交化方式保范数(Norm-preserving,grimjim 方法)
有害数据集Bahushruth/abliteration-harmful-enriched(7356 条提示词,33 个类别)
无害数据集mlabonne/harmless_alpaca
训练样本512 对
计算资源Modal H100 (80GB 显存, 128GB 内存)

算法步骤

  1. 在全部 40 层中收集 512 条有害提示词与 512 条无害提示词的残差流激活值(最后一个 token 位置)。
  2. 计算每层的均值差异向量 → 即候选的“拒绝方向”。
  3. 按照 |mean(direction)| 对各层进行打分,选取最强的一个单层。
  4. 应用保范数正交化,从以下位置移除该方向:
    • Token 嵌入层(embed_tokens)
    • 注意力输出投影层(self_attn.o_proj 与 linear_attn.out_proj)
    • 共享专家降维投影层(mlp.shared_expert.down_proj)
    • 全部 256 个 MoE 专家降维投影层(通过 einsum 进行批处理三维张量运算)
  5. 将所有修改后的权重行重新缩放回原始范数(防止激活幅度衰减)。

为什么选择“1 个方向 + 丰富数据集”优于“7 个方向 + 小型数据集”

配置拒绝率模型能力
10 个方向,520 条提示词,标准正交化 (v1)0%破坏严重
7 个方向,520 条提示词,保范数正交化 (v3)94%完好
1 个方向,7356 条提示词,保范数正交化 (v4)0%完好

从多样化数据集中估计出的单个优质方向,优于从狭窄数据集中估计出的多个低质量方向。扩充后的丰富数据集(覆盖 33 个类别、多种风格、多语言)使得均值差统计量能够收敛到真正的拒绝回路上。一次精准的外科手术式裁剪远胜于七次粗糙的切割。

保范数正交化

标准消融技术会带来收缩权重范数的副作用(||W_new|| < ||W||)。在跨越 40 层的网络中,这会导致级联式的激活衰减 → 进而摧毁模型能力。保范数修复方案如下:

original_norms = weight.norm(dim=-1, keepdim=True)
proj = torch.outer(r, r)
weight = weight - proj @ weight        # 移除拒绝方向
new_norms = weight.norm(dim=-1, keepdim=True)
weight = weight * (original_norms / (new_norms + 1e-8))  # 恢复原有幅度

向量指向了新的方向(不再包含拒绝分量),同时保留了原有的置信度(保持相同的范数)。

使用方法

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Bahushruth/Qwen3.6-35B-A3B-abliterated-v4"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype="auto", device_map="auto",
)

messages = [{"role": "user", "content": "在此输入您的提示词"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

模型架构

Qwen3.6-35B-A3B 采用了混合专家(Hybrid MoE)架构:

属性数值
总参数量35B
每 token 激活参数量~3B
隐藏层维度2048
层数40(30 层线性注意力 + 10 层完整自注意力)
每 MoE 层专家数256(8 个激活专家 + 1 个共享专家)

版本历史

版本方法数据集拒绝率质量表现状态
v1 (3.6)10 个方向标准正交mlabonne (520)0%破坏严重失败
v37 个方向保范数mlabonne (520)94%完好失败
v41 个方向保范数丰富数据集 (7356)0%完好当前版本

免责声明

本模型已移除了安全防护机制,会响应并执行原版模型会拒绝的请求。发布仅用于人工智能对齐和安全机制的研究。创作者对下游使用不承担任何责任。

致谢

  • mlabonne — 消融技术、harmless_alpaca 数据集、原始 Notebook
  • grimjim — 保范数正交化方法
  • Qwen — 基础模型
源站原文

license: apache-2.0 base_model: Qwen/Qwen3.6-35B-A3B tags:

  • abliteration
  • uncensored
  • qwen3
  • moe
  • norm-preserving model_type: qwen3_moe pipeline_tag: text-generation datasets:
  • Bahushruth/abliteration-harmful-enriched
  • mlabonne/harmless_alpaca library_name: transformers

Qwen3.6-35B-A3B-abliterated-v4

Uncensored version of Qwen/Qwen3.6-35B-A3B with refusal behavior removed via abliteration (norm-preserving orthogonalization).

GGUF quantizations: Bahushruth/Qwen3.6-35B-A3B-abliterated-v4-GGUF

Blog post: Abliteration: Uncensoring LLMs via Weight Surgery

Results

MetricOriginalv4 (this model)
Harmful refusal rate~98%0% (0/16)
Harmless prompt refusal0%0%

Zero refusals on harmful prompts. No false refusals on harmless prompts.

Method

Abliteration identifies the "refusal direction" in the model's residual stream — the linear direction that activates when the model decides to refuse — and surgically removes it from all output projection weights using norm-preserving orthogonalization.

ParameterValue
Directions removed1 (single top layer)
OrthogonalizationNorm-preserving (grimjim method)
Harmful datasetBahushruth/abliteration-harmful-enriched (7356 prompts, 33 categories)
Harmless datasetmlabonne/harmless_alpaca
Training samples512 pairs
ComputeModal H100 (80GB VRAM, 128GB RAM)

Algorithm

  1. Collect residual stream activations (last token position) for 512 harmful + 512 harmless prompts across all 40 layers
  2. Compute mean difference vector per layer → this is the "refusal direction" candidate
  3. Score layers by |mean(direction)|, select the single strongest
  4. Apply norm-preserving orthogonalization to remove that direction from:
    • Token embeddings (embed_tokens)
    • Attention output projections (self_attn.o_proj and linear_attn.out_proj)
    • Shared expert down projections (mlp.shared_expert.down_proj)
    • All 256 MoE expert down projections (batched 3D tensor via einsum)
  5. Rescale all modified weight rows back to original norms (prevents activation magnitude decay)

Why 1 direction + enriched dataset > 7 directions + small dataset

ConfigRefusal RateCapabilities
10 dirs, 520 prompts, standard ortho (v1)0%Destroyed
7 dirs, 520 prompts, norm-preserving (v3)94%Intact
1 dir, 7356 prompts, norm-preserving (v4)0%Intact

A single well-estimated direction from a diverse dataset beats many poorly-estimated directions from a narrow dataset. The enriched dataset (33 categories, multiple styles, multilingual) makes the mean-difference statistic converge to the true refusal circuit. One surgical cut > seven imprecise ones.

Norm-preserving orthogonalization

Standard abliteration shrinks weight norms as a side effect (||W_new|| < ||W||). Across 40 layers this causes cascading activation decay → capability destruction. The norm-preserving fix:

original_norms = weight.norm(dim=-1, keepdim=True)
proj = torch.outer(r, r)
weight = weight - proj @ weight        # remove refusal direction
new_norms = weight.norm(dim=-1, keepdim=True)
weight = weight * (original_norms / (new_norms + 1e-8))  # restore magnitude

The vector points somewhere new (no refusal component), but retains original confidence (same norm).

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "Bahushruth/Qwen3.6-35B-A3B-abliterated-v4"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype="auto", device_map="auto",
)

messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

Architecture

Qwen3.6-35B-A3B is a hybrid MoE architecture:

PropertyValue
Total parameters35B
Active parameters/token~3B
Hidden dimension2048
Layers40 (30 linear attention + 10 full self-attention)
Experts per MoE layer256 (8 active + 1 shared)

Version History

VersionMethodDatasetRefusalQualityStatus
v1 (3.6)10-dir standardmlabonne (520)0%DestroyedFailed
v37-dir norm-preservingmlabonne (520)94%IntactFailed
v41-dir norm-preservingenriched (7356)0%IntactCurrent

Disclaimer

This model has had safety guardrails removed and will comply with requests the original model would refuse. Released for research into AI alignment and safety mechanisms. The creator assumes no responsibility for downstream use.

Acknowledgments

  • mlabonne — abliteration technique, harmless_alpaca dataset, original notebook
  • grimjim — norm-preserving orthogonalization method
  • Qwen — base model
HUGGING FACE

上游数据

HF 下载量90.4万
HF 点赞量9

HF 下载量为源站最近 30 天统计,与本站点击分开。

SITE STATS

本站统计

下载点击—
请求数—
匿名去重—最近 7 天—

本站下载量记录按钮点击,不代表下载完成;短时连点会去重。

来源与版本

作者
Bahushruth
最近更新
未知
最新创建
2026/06/11
HF 趋势
未知
数据快照
2026/09/16
版本
未知
许可证
apache-2.0