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

upseem/deepseek-v4-flash-vision-abliteration-method

upseem Deepseek multimodal
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%2Fdeepseek-v4-flash-vision-abliteration-method"
Response includes
  • classification unknown
  • files 2
  • 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

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 deepseek method-notes no-weights arxiv:2406.11717 base_model:deepseek-ai/DeepSeek-V4-Flash-Vision-Exp base_model:finetune:deepseek-ai/DeepSeek-V4-Flash-Vision-Exp 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:36

Files by quantization

Auxiliary files 2 files 11.9 KB
README.md 10.5 KB dbe1204f download
.gitattributes 1.48 KB a6344aac download

README current version from Hugging Face


license: mit
base_model: deepseek-ai/DeepSeek-V4-Flash-Vision-Exp
tags:

  • research
  • abliteration
  • deepseek
  • method-notes
  • no-weights
    pretty_name: DeepSeek-V4-Flash-Vision Abliteration Method Notes

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

DeepSeek-V4-Flash-Vision 经典 Abliteration 复现笔记

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

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

角色 链接
官方基座(原始训练发布) https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-Vision-Exp
方法来源(abliterated 成品卡,流程描述出处) https://huggingface.co/orcarouter/DeepSeek-V4-Flash-Vision-Uncensored
同作者 GGUF 转格式(可选,仍无本文权重) https://huggingface.co/orcarouter/DeepSeek-V4-Flash-Vision-Uncensored-GGUF
经典 abliteration 论文 Arditi et al. 2024 https://arxiv.org/abs/2406.11717
对照:Heretic / ARA(另一条算法,不是本流程) https://github.com/p-e-w/heretic
本方法笔记仓 https://huggingface.co/upseem/deepseek-v4-flash-vision-abliteration-method

复现时:权重从 基座 取;步骤从 orcarouter 模型卡 取;本仓只存笔记。


0. 一句话结论

这是 Arditi 单方向 abliteration(拒绝方向正交化),再 按 shard 写回官方混合精度(FP4/FP8/BF16)。
它和你做过的 Heretic ARA 同属「改权重卸拒答」大类,但算法不同:

经典 Abliteration(本笔记) Heretic ARA(你的 Qwen 配方)
核心对象 一条(或少数)拒绝方向 r 不估全局 r
编辑方式 W' = W − r(rᵀW) 投影 hook 抓模块 I/O,L-BFGS/闭式优化矩阵
超参搜索 层/读点扫 + 简单质量分 Optuna TPE(拒答数 vs KL)
DeepSeek 额外难点 mHC 读点 + FP4 约束再量化 + 流式 bake ARA 默认路径通常假设可加载的 dense/常见 MoE

不要指望把 Heretic ARA recipe 直接套到 V4-Flash-Vision 官方 FP4 checkpoint 上就完事。


1. 基座与产物形态

  • 基座:deepseek-ai/DeepSeek-V4-Flash-Vision-Exp
  • 规模:约 305B 总参数 / ~18B 激活 MoE
  • 架构要点:DeepseekV4ForCausalLM;43 transformer 层 + 3 MTP/DSpark;hidden 4096;DeepSeek sparse attention;256 routed experts top-6 + 1 shared;4-wide mHC;原生 vision tower + aligner;上下文 1M;词表 129280
  • 官方精度(无纯 BF16 源):
    • routed experts:FP4 e2m1(2/byte)+ ue8m0 per-32 scales
    • attention / shared expert:block-FP8 e4m3 128×128 + ue8m0
    • embeddings / vision / norms / router:BF16
    • Hyper-Connection mixers:FP32
  • 产物要求:与基座 同名、同 dtype、同 shape、同 shard 布局 的 drop-in(约 48 shards / ~157 GiB)

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

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

  1. 对「有害」与「无害」提示跑前向,在残差流取激活。
  2. 拒绝方向:r ∝ mean(harmful) − mean(harmless)(可加归一化 / massive-activation mask)。
  3. 对所有「往残差里写」的权重做正交化:
W' = W − r (rᵀ W)

使前向不再容易表达该方向 → 拒答率下降。

DeepSeek-V4 的结构坑(社区分析 + orcarouter 卡片一致):

  • mHC 把残差加宽成 hc_mult × d(这里 4×4096)。
  • 若在「加宽后的 hidden」上估 r,方向在错误空间。
  • 应在 每个子块实际消费的 4096-d 流 上读(见下)。

3. orcarouter 公开流程(按阶段)

3.1 读激活:正确的 hook 点

  • 不要依赖 output_hidden_states 的加宽流当主读点。
  • 用 forward pre-hook:
    • input_layernorm → attention 读点
    • post_attention_layernorm → MoE 读点
  • 扫层与读点时,他们报告:MoE 读点更干净;attention 读点最佳也只能把有害拒答压到 ~0.42。
  • 出货层:layer 28 / 43(深度约 0.65)的 MoE 读点。
  • 质量分示例:bypass − kl_penalty · kl_norm − induced_benign_refusal(10 候选扫)。

Hook 消融(不 bake,只临时消方向)在验证集上的相对形态(卡片数字,供对照):

读点 / 层 有害拒答率(越低越好)
baseline 0.917
MoE L15 0.667
MoE L28(出货) 0.042
MoE L32 0.125
attention 最佳 0.417

3.2 估方向

  • k = 1 单方向(不是 SOMA/ARA 的多方向优化)。
  • massive-activation-masked mean-difference:有害 − 无害。
  • 维度:4096。

3.3 改哪些矩阵(残差写入者)

写入者 精度 规模(卡片)
layers.*.ffn.experts.*.w2 + mtp.* experts w2 FP4 11,776
layers.*.attn.wo_b + mtp FP8 46
layers.*.ffn.shared_experts.w2 + mtp FP8 46
embed(行空间) BF16 1
aligner.w2 BF16 1
image_start/end/newline/pad BF16 4
合计 11,874

刻意不动:hc_* mixer、MoE router(ffn.gate 等)、专家 w1/w3、视觉塔主体、lm_head。
理由(卡片):mHC 的 comb 双随机、post 分支标量,都是分支内线性;清干净 4096-d 写入者即可,mHC 不会把方向「混回来」。

3.4 为什么必须「落盘 bake」,不能常规内存 abliterate

  1. FP4 专家:直接在 nibble 码上投影会坏矩阵;在量化码空间做 leakage probe 会假阴性(~0)。
  2. 常规 2-D .weight matcher 抓不到 11k+ 专家 w2,却仍可能报 success。
  3. transformers 文本加载会丢掉 vision / aligner / image vectors / MTP,save_pretrained 会静默缺件。

→ 按 model.safetensors.index.json 流式读 shard → 改 → 写回,保持格式与索引不变。

3.5 FP4/FP8 约束再量化(关键工程)

Naive:

quantize(W − r rᵀ W)   # round-to-nearest

在真实方向上泄漏约:FP4 67% / FP8 36%(卡片),且是固定点,迭代无效。

他们的做法:对每列 j 解约束量化

min_q  ‖q − W[:,j]‖²
s.t.   rᵀ q = 0
       q ∈ FP4/FP8 网格

Lagrangian 形式:quantize(W[:,j] + λⱼ r),对 λ 二分(约束对 λ 单调),再单码微调 + 块内 ue8m0 scale 共优化。
目标:输出是运行时 dequant/requant 的固定点 → 加载后方向仍被压住。
卡片声称约束后再泄漏 ~0.001% / 0.045%;权重扰动约 3.7%(FP4)/ 2.1%(FP8)。

3.6 Bake 后校验

  • 48 shards、~72,633 tensors:name / dtype / shape 与基座一致。
  • 每个 tensor 标记为 edited 或 copied,无遗漏。
  • 行为评测(他们用规则开头分类器,非 LLM-judge;仅参考):

安全(有害拒答,越低越「uncensored」)

集 Base Abliterated
MaliciousInstruct 0.940 0.020
JailbreakBench harmful 0.910 0.020
AdvBench 0.980 0.080
ForbiddenQuestions 0.853 0.113
SimpleSafetyTests 0.900 0.160

过拒

集 Base Abliterated
XSTest-safe 0.092 0.004
JailbreakBench benign 0.140 0.000

能力(抽样):MMLU / MMLU-Pro / GSM8K 变化在 ±1pp 内。

视觉通道:方向在文本上拟合;VLSBench 原问题几乎不触发拒答。他们把指令改成「action-seeking」后,base 图条件拒答 ~0.583 → abliterated ~0.025。视觉塔字节级不动,只动了 aligner.w2 + 四个 image token。


4. 建议的复现路线(不拉全量到本机)

在你自己有盘、有卡、有基座授权的环境:

  1. Phase A — 只估方向(轻)

    • 文本-only 小激活集;hook MoE 读点;扫层;导出 r.pt。
    • 用 hook-ablation(推理时减方向)验证 L28,先别 bake。
  2. Phase B — 写 shard baker

    • 解析 index.json;识别上表写入者;BF16 直接投影;FP8/FP4 走约束再量化。
    • 单测:随机抽若干 w2,测 ‖rᵀW‖ bake 前后比。
  3. Phase C — 全量 bake + 校验

    • 流式改 48 shards;shape/dtype 断言;抽样前向。
  4. Phase D — 评测

    • 有害 / XSTest / 少量能力;可选图条件协议。
    • 记录:层、读点、λ/约束细节、泄漏率、KL/拒答。

本机(Grok Bot)明确不做:不下载 ~157 GiB 权重;不上传 uncensored 成品当默认助手。


5. 和你已有 Heretic ARA 经验怎么衔接

  • 可复用:有害/无害数据卫生、拒答计数、KL 监控、分层「先 scout 后 strike」的工程习惯。
  • 不可直接复用:ARA 的「无全局 r、按模块优化」目标函数;默认假设可 transformers 完整加载再 save。
  • V4-Flash-Vision 的硬工作是:mHC 读点正确性 + FP4 专家约束再量化 + 不丢视觉/MTP 的落盘。

若你想「更像 ARA」:那是另一条研究线(模块 I/O 优化 / 专家级编辑),需要另开设计;本笔记只锁定 orcarouter 公开的经典路径。


6. 合规与安全(写进你自己的卡)

  • 这类权重会显著削弱内置拒答;卡片定位是可解释性 / 红队 / 拒答机制研究。
  • 继承基座许可证(卡片写 MIT)+ 当地法律;不要无护栏直接对终端用户。
  • 拒答「降低 ≠ 清零」;单方向消融可能漏掉其他方向介导的内容。

7. 参考


8. 待你后续补的实验日志模板

date:
base_rev / commit:
hardware:
direction:
  layer:
  read_point: moe | attn
  n_harmful / n_harmless:
  mask:
bake:
  fp4_leakage_before / after:
  fp8_leakage_before / after:
  shards_edited:
eval:
  harmful_refusal:
  xstest_safe:
  mmlu_delta:
  notes:

README history 3 versions

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

  1. 2026-09-04Remove unused Qwen ARA recipe link from source tablef8e57b310.5 KB
    Loading...
  2. 2026-09-04Add source links: base model, orcarouter card, paper8ee503410.6 KB
    Loading...
  3. 2026-09-04Add abliteration method notes (no weights)6d80a429.5 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