← back to catalog · registered 2026-09-04 01:03

upseem/unseen-gemma-4-26b-abliteration-method

upseem Gemma 26B MoE
Your rig guess connected
? Why do I need an app?
Reading your rig…

This is a rough estimate. Install the free app - we'll show exact numbers.

Reading real hardware from your app right now. Numbers below are exact.

Below is the per-quantization compatibility for this model.

curl -H "Authorization: Bearer $ABL_KEY" \
     "https://abliteration.org/api/v1/models/upseem%2Funseen-gemma-4-26b-abliteration-method"
Response includes
  • classification unknown
  • files 2
  • benchmarks 11 entries
  • author_summary 2 models
  • readme_text full
10 credits · hourly refresh · ~4 KB payload Get an API key →
Abliteration classifier · v1.0.0
?
Primary method

Unclassified

No clear signals of an abliteration technique in this model.
Confidence
UNKNOWN
Why this label 1 signal
No classification signals present. This may not be an abliterated model at all - it could be a repackaging, a merge with unrelated goals, or unrelated content that mentions the term.
  • no classification signals present (no abliterated, uncensored, or known producer/method markers)
Refusal direction extraction

No specific extraction method could be identified for this model. The producer either did not document it or used a proprietary pipeline.

What is a refusal direction? →
Downloads · 30-day
0
Likes
0
Model age
6w ago
created 2026-09-04
Downloads over time
Now0→from0↑0%
00110 on Sep 40 on Oct 19SepOct
Sep 4 → Oct 19 · 46 snapshots · spans 45 days

Benchmarks

Portrait before abliteration
Benchmarks of the base model as it stood before the refusal-removal operation. Compare with the numbers above to see what the operation cost.
Benchmark Score Source
Entertainment 2.2 UGI
Hazardous 2.9 UGI
Natural Intelligence 34.44 UGI
Political lean -18.2% UGI
Sensitive-Info 22.41 UGI
SocPol 1.8 UGI
UGI 20.77 UGI
Willingness (10) 1.8 UGI
W10-Adherence 1.5 UGI
W10-Direct 2 UGI
Writing 41.62 UGI

Genealogy 0 direct forks

Full fork graph →

This model's place in the market. Above: what it was derived from. Below: the tree of everything derived from it.

Metadata

License
mit
Tags
research abliteration gemma method-notes no-weights arxiv:2406.11717 base_model:google/gemma-4-26B-A4B-it base_model:finetune:google/gemma-4-26B-A4B-it license:mit region:us

Related

Total size
0 B
Files
2
Quantizations
1
Registered
2026-09-04 01:03
Last updated on HF
2026-09-04 00:45

Files by quantization

Auxiliary files 2 files 12.5 KB
README.md 11.0 KB 1b3637ca download
.gitattributes 1.48 KB a6344aac download

README current version from Hugging Face


license: mit
base_model: google/gemma-4-26B-A4B-it
tags:

  • research
  • abliteration
  • gemma
  • method-notes
  • no-weights
    pretty_name: UNSEEN Gemma-4-26B Abliteration Method Notes

This repository contains method documentation only. No model weights are included.

UNSEEN Gemma-4-26B 经典 Abliteration 复现笔记

目标:只记录方法,不下载/拷贝权重。
依据:Jommarn/UNSEEN_Gemma_4_26B_NSFW 模型卡公开描述 + Arditi et al. 2024。
用途:后续在有 GPU / 权重授权的环境里复现;本文不是生产部署指南。

Source links(原始仓库 / 论文,方便后续定位)

角色 链接
官方基座(原始训练发布) https://huggingface.co/google/gemma-4-26B-A4B-it
方法来源(abliterated 成品卡,流程描述出处) https://huggingface.co/Jommarn/UNSEEN_Gemma_4_26B_NSFW
同作者 GGUF / 量化仓(可选,仍无本文权重) https://huggingface.co/Jommarn/UNSEEN_Gemma_4_26B_NSFW-GGUF
同作者更小规格(方法同类,非本稿主对象) https://huggingface.co/Jommarn/UNSEEN_Gemma_4_12B_NSFW · https://huggingface.co/Jommarn/UNSEEN_Gemma_4_E2B_NSFW
经典 abliteration 论文 Arditi et al. 2024 https://arxiv.org/abs/2406.11717
对照:Heretic / ARA(另一条算法,不是本流程) https://github.com/p-e-w/heretic
对照:同系列 DeepSeek 方法笔记(经典 abliteration,但工程更重) https://huggingface.co/upseem/deepseek-v4-flash-vision-abliteration-method
本方法笔记仓 https://huggingface.co/upseem/unseen-gemma-4-26b-abliteration-method

复现时:权重从 基座 取;步骤与 hook 约定从 Jommarn 模型卡 取;本仓只存笔记。
请遵守 Google Gemma 许可与当地法规;本笔记不附带任何 NSFW 样例图或样例输出。


0. 一句话结论

这是 Arditi 单方向 Orthogonal Weight Projection(拒绝方向正交化),在 中间层 用「安全图文描述 vs 硬核 NSFW 提示」的平均激活差估出 r,再对 全部 transformer 层 的 o_proj 与 down_proj 永久 bake 进权重。

本笔记(UNSEEN Gemma) orcarouter DeepSeek-V4-Flash-Vision Heretic ARA
核心对象 单拒绝方向 r 单方向 r 不估全局 r
编辑方式 W' = W − r(rᵀW) 同左 + FP4/FP8 约束 requant hook I/O + L-BFGS/闭式优化
改哪些矩阵 全层 o_proj + down_proj experts w2、attn 写出等(多精度) 任意选定模块
估方向对比集 安全图文描述 vs 硬核 NSFW 有害 vs 无害文本(卡片) 拒答数 / KL 目标
推理侧额外手段 Prefill 引导首段 未强调 未强调
工程难度 相对标准(BF16 成品;MoE 但仍可按卡复现) 高(mHC + 混合精度) 另一条算法

不是 Heretic ARA;不是 只靠 runtime hook。权重级修改 → 可直接上 vLLM / 自定义 CUDA kernel。


1. 基座与产物形态

来源卡:Jommarn/UNSEEN_Gemma_4_26B_NSFW(引用,非镜像)。

  • 基座:google/gemma-4-26B-A4B-it
  • 架构(成品 config.json):Gemma4ForConditionalGeneration / gemma4
    • 文本侧:gemma4_text,30 hidden layers,hidden_size=2816,num_attention_heads=16,num_key_value_heads=8
    • MoE:enable_moe_block=true,num_experts=128,top_k_experts=8,moe_intermediate_size=704,intermediate_size=2112
    • 混合注意力:多数 sliding_attention(window 1024),每隔约 6 层一个 full_attention;部分 full 层 head_dim/kv 不同(per_layer_config)
    • 上下文:max_position_embeddings=262144;词表 262144;tie_word_embeddings=true
    • 视觉:gemma4_vision,27 层,hidden_size=1152,patch_size=16,约 280 soft tokens / 图
  • 成品精度:卡上 BF16 safetensors(约 2 shards);GGUF 仓另有 IQ2–BF16 与 mmproj-gemma4-vision-f16.gguf
  • 产物要求:与基座同结构的 drop-in;视觉投影保留(多模态仍可用)。GGUF 部署必须另挂 mmproj,否则退化为纯文本。

同作者还有 12B / E2B 的 UNSEEN 变体,方法论同类;本稿以 26B 卡为准。


2. 理论:单方向拒绝(Arditi 2024)

论文:Refusal in Language Models Is Mediated by a Single Direction(arXiv:2406.11717)。

  1. 对「会触发拒答」与「正常配合」的输入跑前向,在残差流取激活。
  2. 拒绝方向(卡片写法):
r ∝ mean(act | hardcore NSFW prompts) − mean(act | safe image descriptions)

取在 模型中间层(middle layer;卡未给出精确 layer index,复现时需扫层验证)。
3. 对「往残差里写」的输出投影做正交化。原卡写「using the following orthogonal projection formula」但 未贴出 LaTeX;与 Arditi / 社区标准一致时为:

W' = W − r (rᵀ W)

(r 单位向量时;实现上常先 r ← r / ‖r‖。)

效果:前向残差更难表达该拒答方向 → 安全护栏被削弱。卡片声称对 all layers 的 o_proj 与 down_proj 永久减去该方向。


3. Jommarn 公开流程(按阶段整理)

以下严格按 UNSEEN_Gemma_4_26B_NSFW 模型卡 Methodology 与全文表述整理;卡未开源脚本处标为 需自补。

3.1 估方向(refusal vector)

项 卡片说法 复现时注意
对比集 A safe image descriptions 多模态:图 + 安全描述提示;需自建配对数据
对比集 B hardcore NSFW prompts 图文 NSFW;与 A 尽量同结构,只改「是否触发拒答」
读点 middle layer 的激活差均值 未给 layer id;建议扫 30 层中段(如 L10–L20)+ 拒答/KL 质量分
形式 mean difference → 单向量 r 可加归一化 / massive-activation mask(论文常见;卡未写)

未公开:具体 prompt 列表、图集、是否只在文本残差还是含 vision 对齐后 token、是否跨多位置平均。

3.2 改哪些矩阵(bake)

卡片明确:

  • 范围:all transformer layers
  • 矩阵名:输出投影 o_proj(attention 写出)与 down_proj(MLP / MoE 路径上的下行投影;具体到 routed expert 还是 shared,卡未拆)
  • 方式:Orthogonal Weight Projection,永久写入权重(不是 forward hook)
  • 动机:无 hook → vLLM / 自定义 CUDA 可直接加载

伪代码级(自写实现骨架,非作者代码):

# r: (hidden_size,) unit vector estimated at middle layer
# For each layer L, for name in ("o_proj", "down_proj"):
#   W = weight of that module  # shape typically (out, in) or (in, out) — match transformers layout
#   W = W - torch.outer(r, W.T @ r)   # equivalent form of W - r (r^T W) depending on layout
#   write back

MoE 注意(自补工程点):enable_moe_block=true 时,down_proj 可能对应多个 expert。卡写「all layers … down_proj」——复现时应确认是:

  1. 每个 expert 的 down_proj 都投一遍,还是
  2. 只投 shared / 某条 dense 旁路。

未写清前,优先对 所有会写入残差的 down 投影 做同样正交化,并用拒答率 / 困惑度做回归测试。

3.3 视觉塔

  • 卡片强调 保留多模态:vision projection 仍把图像特征映入已 abliterate 的 LLM 空间。
  • GGUF 仓要求:--mmproj mmproj-gemma4-vision-f16.gguf,否则只当文本模型。
  • 未写是否对 vision encoder / projector 做过投影;按字面,手术对象是 LLM 侧 o_proj / down_proj。

3.4 推理侧:Prefill(非权重手段)

卡推荐在 chat template 之后注入 Prefill,绕开「开头安全话术」:

  • 生成:do_sample=True,temperature=1.0,top_p=0.9,repetition_penalty=1.1
  • Prefill 形态示例(结构示意,勿照抄违规内容):在 assistant 起始处先写入「将按要求做详细描述」类引导,再继续生成

这属于 解码诱导,与权重 abliteration 正交;复现实验应 分开报告:仅 bake vs bake+prefill。


4. 建议复现路线图(Phase A → D)

Phase A — 环境与基线

  1. 取得 google/gemma-4-26B-A4B-it 授权与权重(遵守 Gemma 许可)。
  2. 固定 transformers / 推理栈版本;确认 Gemma4ForConditionalGeneration 可加载。
  3. 建两套评测:
    • 拒答率:安全策略类 / NSFW 图文描述(自建,勿公开非法内容)
    • 能力回归:普通 VQA、多语(卡强调 TH/EN)、短上下文困惑度

Phase B — 估 r

  1. 中间层扫:对每层取 residual / 模块输入激活,算 mean(NSFW) − mean(safe)。
  2. 归一化得 r_ℓ;可用临时 hook 消融(不改权重)看哪一层拒答掉得最狠、良性拒答是否上升。
  3. 选定一层(或层平均)作为出货 r。

Phase C — Bake

  1. 遍历全部 30 层的 o_proj、down_proj(含 MoE expert 布局核对)。
  2. 应用 W' = W − r(rᵀW),写回 BF16 safetensors,保持 shard / index 与基座一致。
  3. 不要改 tokenizer / chat_template,除非你有意改行为。

Phase D — 验证与可选量化

  1. 对比:基座 vs bake;再测 bake+prefill。
  2. 若需本地部署:再走 GGUF / bitsandbytes(参考 GGUF 仓 的 VRAM 表),量化在 bake 之后,避免方向被粗量化「洗回」。
  3. vLLM 冒烟:确认无 hook 也能加载。

5. 与 DeepSeek 笔记的差异(方便你两条线并行)

点 Gemma UNSEEN(本仓) DeepSeek orcarouter(姊妹仓)
读点叙事 middle layer;安全图文 vs NSFW MoE 读点 L28 等;有害 vs 无害
写入矩阵 全层 o_proj + down_proj 大量 FP4 experts w2 + FP8 attn 等
精度坑 成品 BF16,相对直接 FP4/FP8 约束 requant 否则方向泄漏
结构坑 Gemma4 MoE + sliding/full 混合 attn 4-wide mHC 加宽残差
额外手段 Prefill shard-level bake 流程更重

两条都是 经典单方向 abliteration;工程复杂度 DeepSeek 明显更高。


6. 合规与安全说明

  • 本仓 仅方法笔记,不含权重、不含 NSFW 样例图/样例输出。
  • 原成品卡面向成人 NSFW 生成;复现与使用须遵守当地法律与平台条款,禁止用于非自愿、未成年人或其它违法内容。
  • 引用成品时请链回:Jommarn/UNSEEN_Gemma_4_26B_NSFW 与基座 google/gemma-4-26B-A4B-it。
  • 卡片未开源训练脚本;本文是对公开描述的结构化整理 + Arditi 标准公式补全,不是作者官方教程。

7. 变更记录

  • 2026-09-04:初版。依据 Jommarn UNSEEN Gemma-4-26B NSFW 模型卡 + config.json 架构摘要 + Arditi 2024。

README history 1 version

The author's README evolved over time. Click a version to see its content at that point.

  1. 2026-09-04Add UNSEEN Gemma-4-26B classic abliteration method notes (cite Jommarn)a55dbc511 KB
    Loading...
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration