Downloads · 30 days
25
10% of all-time downloads
XuehangCang/MiniCPM5-1B-Rebel
MiniCPM5-1B-Rebel is a text generation model from XuehangCang. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
MiniCPM5-1B 的去审查(uncensored)版本,由 heretic-zh 基于自建中文、数据集自动生成。
Downloads · 30 days
25
10% of all-time downloads
All-time downloads
258
Public
Parameters
1.1B
4.3 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.2 GB · 100%
From the Hugging Face model README
MiniCPM5-1B 的去审查(uncensored)版本,由 heretic-zh 基于自建中文、数据集自动生成。
⚠️ 注意:此模型已移除安全对齐(safety alignment),可能生成原始模型会拒答的内容。请负责任地使用。
| 项目 | 说明 |
|---|---|
| 基座模型 | openbmb/MiniCPM5-1B |
| 去审查方法 | heretic-zh — Heretic 的中文优化版本,基于方向消融(directional ablation / abliteration)的全自动审查移除 |
| 训练数据集 | XuehangCang/safe_prompt(安全提示词) + XuehangCang/unsafe_prompt(不安全提示词) — 专为中文场景构建 |
| 架构 | LLaMA(24 层,1536 hidden size,16 attention heads,2 KV heads) |
| 参数量 | ~1B |
| 上下文长度 | 131,072 tokens |
| 词表大小 | 130,560 |
| 精度 | bfloat16 |
heretic-zh 是 Heretic 的中文优化版本,专门针对中文语言模型的审查移除做了适配。与原始 Heretic 相比,heretic-zh 在以下方面做了针对性优化:
| 指标 | 原始模型 | 本模型 |
|---|---|---|
| 拒答数(共 200 个"有害"提示词) | 193 | 0 |
| KL 散度(相对原始模型) | 0(按定义) | 0.030 |
✅ 拒答率从 96.5% 降至 0%,同时 KL 散度仅 0.030,对模型通用能力的损伤极小。
Heretic 对 attention 输出投影(o_proj)和 MLP 下投影(down_proj)施加了逐层权重衰减,沿"拒答方向"对中间残差流进行干预:
| 模块 | max_weight | max_weight_position | min_weight | min_weight_distance |
|---|---|---|---|---|
attn.o_proj | 0.927 | 13.87 | 0.111 | 9.02 |
mlp.down_proj | 1.464 | 16.95 | 0.679 | 7.65 |
pip install transformers torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "XuehangCang/MiniCPM5-1B-Rebel"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "你是什么模型?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=False,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048)
print(
tokenizer.decode(
outputs[0][inputs["input_ids"].shape[-1] :], skip_special_tokens=True
)
)
| 参数 | 值 |
|---|---|
temperature | 0.9 |
top_p | 0.95 |
do_sample | true |
heretic-zh 是 Heretic(面向语言模型的全自动审查移除工具)的中文优化版本。Heretic 使用方向消融(abliteration)技术,通过分析模型在"好的"(安全)和"坏的"(不安全)提示词上的残差流差异来找到"拒答方向",然后对该方向进行干预以抑制模型的拒答行为。
heretic-zh 在此基础上专门为中文模型和中文用户做了深度适配:
与手工调参的 abliteration 不同,heretic-zh 继承 Heretic 的 Optuna TPE(Tree-structured Parzen Estimator)采样器自动搜索最优消融参数,在拒答抑制和模型能力保留之间找到最佳平衡。
了解更多:
基于原始 MiniCPM5-1B 模型,使用 Apache 2.0 许可证。
如果你使用了此模型,请引用原始 MiniCPM、Heretic 和 heretic-zh:
@misc{minicpm5,
title = {MiniCPM: Unveiling the Potential of Small Language Models},
author = {OpenBMB},
url = {https://github.com/OpenBMB/MiniCPM},
year = {2025}
}
@misc{heretic,
title = {Heretic: Fully Automatic Censorship Removal for Language Models},
author = {Philipp Emanuel Weidmann},
url = {https://github.com/p-e-w/heretic},
year = {2025}
}
@misc{heretic-zh,
title = {heretic-zh: Chinese-Optimized Automatic Censorship Removal},
author = {XuehangCang},
url = {https://github.com/XuehangCang/heretic-zh},
year = {2026}
}