# Model Preparation: Abliterated W4A16 DeepSeek-V4-Flash The serving stack in this repo runs a checkpoint built from three fully pinned public steps. Nothing in the chain requires private artifacts or calibration data. The complete recipes also travel inside the checkpoint itself (`ABLITERATION_MANIFEST.json` for step 2, `config.json` for step 3), so the files below are the authoritative reproduction record. ## Step 1: Base checkpoint Start from the official post-trained FP8 model: - Repository: `deepseek-ai/DeepSeek-V4-Flash-0731` - Pinned revision: `9e165c30e2704aec5d9d593cce3eebd58bbef1cb` ## Step 2: Rank-1 abliteration Method: rank-k residual-writer projection with FP8 fixed-point requantization (edits stay in the checkpoint's native numeric format; no dtype detour). Tooling (pinned commit): - `apetersson/deepseek-model-tools` @ `c3979d5f8179f2a8714ac459b0f2e242006d6ad0` Refusal direction (pinned file and revision): - `drowzeys/DeepSeek-V4-Flash-DSpark-Abliterated-Uncensored-1M-57toks` @ `85ae5bbaa7daf4da7b40e007a71a1c06b41fc053`, file `results/refusal_direction_r1.pt` - Direction SHA-256: `6e4d8a8f3aa9e21795faab2c5b14d29b019acdf2ddbfbd8238430458a5837fe0` Parameters (from the shipped manifest): | Parameter | Value | | --- | --- | | directions | 1 | | lambda_attn | 3.5 | | lambda_shared | null | | layer range | 10 to 42 | | edit_mtp | true | | edit_shared_down | false | | requant_iterations | 3 | | edited_tensors | 36 | The edited tensors are the attention residual-writer projections (`layers.N.attn.wo_b.weight`, shapes 4096x8192) plus the MTP head. ## Step 3: AutoRound W4A16 quantization AutoRound version `0.13.0`, model-free mode. This is the key reproducibility property: `model_free: true` and `iters: 0` mean the rounding is derived from the weights alone, with no calibration dataset and no seed-dependent data loading. Given the same step-2 output, the quant is deterministic. Top-level settings: | Setting | Value | | --- | --- | | quant_method | auto-round | | packing_format | auto_round:auto_gptq | | bits | 4 | | group_size | 128 | | sym | true | | data_type | int | | iters | 0 | | model_free | true | Mixed-precision exceptions: a per-module `extra_config` keeps numerically sensitive modules at 16-bit float instead of int4, including `wo_a`, `embed`, and per-layer `attn.wo_a`, `ffn.gate`, and compressor gates (`attn.compressor.wgate`, `attn.compressor.wkv`). The complete map is in `reference/config.json` in this repository, copied verbatim from the served checkpoint. ## Reproduction cost note Rebuilding from step 1 costs a full download of the FP8 base plus GPU work across all three steps before vLLM ever boots. If you only want to reproduce the serving numbers, the published checkpoint (when linked from the main README) is the exact artifact these benchmarks ran against. ## License note The base model carries DeepSeek's license; check it and the upstream abliterated-direction repository before redistributing derivatives. This repository documents the method and does not relicense the weights.