Abliteration HandbookField guide
Practical guides

Method cookbook — commands for every abliteration stack

Copy-paste setups. Theory lives in ../docs/complete-curriculum.md. Hardware: ../docs/setup-encyclopedia.md. Ethics: ../docs/risks-and-ethics.md.

3 min read 13 examples Source-linked

In this chapter
On this page Interactive companion
Personal reading progress

0/15 sections reviewed

View original Markdown
Interactive companion

Explore the chapter map

Use the visual controls alongside the complete source chapter.

Copy-paste setups. Theory lives in ../docs/complete-curriculum.md. Hardware: ../docs/setup-encyclopedia.md. Ethics: ../docs/risks-and-ethics.md.


0. This repo — C++26 platform (no extra clone)#

The default helper path is abliterate-cxx (ISO C++26). See ../docs/cxx26-platform.md. Prebuilt Linux/Windows/macOS (x64 + arm64) archives: cxx-nightly.

bash
npm run cxx:build
npm run cxx:test
cxx/build/abliterate-cxx guide
cxx/build/abliterate-cxx doctor
cxx/build/abliterate-cxx self-check
cxx/build/abliterate-cxx demo

Hand-holding: ../docs/cxx26-researcher-guide.md · ../cxx/GETTING-STARTED.md

JobCommand
Shared self-checkcxx/build/abliterate-cxx self-check
Estimate r (DIM / projected / COSMIC / SVD)cxx/build/abliterate-cxx estimate --mode projected --bad bad.txt --good good.txt --out r.txt
SVD subspacecxx/build/abliterate-cxx estimate --mode svd --rank 4 --bad bad.txt --good good.txt --out R.txt
Bake weightscxx/build/abliterate-cxx apply --mode orba-directional --weight W.txt --direction r.txt --out W2.txt
Householder A/B… apply --mode orba-householder …
Inference hookcxx/build/abliterate-cxx hook --h h.txt --direction r.txt
Score generationscxx/build/abliterate-cxx eval --jsonl outs.jsonl
ΔW → LoRA (Python, PEFT)python scripts/export-abliteration-lora.py --base ./base --abliterated ./out --out ./adapter --rank 16

Optional Python twins: scripts/estimate-refusal-direction.py and siblings. They are not required for the operators above.


1. Heretic (production default)#

bash
pip install heretic-llm==1.4.0 bitsandbytes accelerate
cp sources/heretic-tools/config.production.toml config.toml
# 8 GB: cp sources/heretic-tools/config.low-vram.toml config.toml
heretic Qwen/Qwen3-4B-Instruct-2507
heretic <model> --print-residual-geometry   # needs heretic-llm[research]

Thinking / factory / noslop: config.thinking-model.toml, config.factory-qa.toml, config.noslop.toml. Full flags: ../docs/advanced-techniques-catalog.md.


2. llm-abliteration (low VRAM / manual)#

bash
git clone https://github.com/jim-plus/llm-abliteration.git
cd llm-abliteration && pip install -r requirements.txt
python measure.py -m <model> -o directions.pt --quant 4bit --projected
python measure.py -m <model> -o directions.pt --quant 4bit --deccp   # multilingual
python sharded_ablate.py config.yaml --projected --normpreserve

Handbook path is jim-plus v1.2. NousResearch/llm-abliteration last push ~2025-11-27 — frozen; not production-pinnable. AUGMXNT/deccp is topics/dataset, not a peer CLI — python measure.py --deccp on jim-plus.


3. Abliterix#

bash
pip install -U abliterix
abliterix --model Qwen/Qwen3-4B-Instruct-2507
# 4-bit: --model.quant-method bnb_4bit
# replay: --reproduce reproduce/reproduce.json

AGPL-3.0. Presets are TOML (configs/*.toml, python scripts/generate_configs.py). There is no abliterix run --config …yaml. Pair with HonestAbliterationBench and data/eval/*.jsonl.


4. ErisForge (layer band)#

bash
git clone https://github.com/Tsadoq/ErisForge.git
cd ErisForge && pip install -e .

Use after heretic --print-residual-geometry picks L_peak ± 4. See ../techniques/layer-selective-abliteration.md.


5. OBLITERATUS (SVD presets)#

bash
git clone https://github.com/elder-plinius/OBLITERATUS.git
cd OBLITERATUS && pip install -e ".[spaces]"
obliteratus obliterate <model> --method advanced --output-dir ./out
# reasoning / MoE: --method surgical
# PyPI `obliteratus` 0.0.1 is a stub; there is no [full] extra

../techniques/svd-whitened-obliteratus.md. Confirm --help on your installed version.


6. COSMIC (direction ID)#

bash
git clone https://github.com/wang-research-lab/COSMIC.git
# follow upstream README for ACL reproduction
python scripts/estimate-refusal-direction.py --mode cosmic --bad bad.pt --good good.pt --out r.pt

../methods/cosmic-direction-id.md.


7. FailSpy / TransformerLens (hooks)#

bash
git clone https://github.com/FailSpy/abliterator.git
# notebooks: cache resid, try hook, then bake winner

8. Arditi paper code#

bash
git clone https://github.com/andyrdt/refusal_direction.git

9. False-refusal ICLR 2025#

bash
git clone https://github.com/mainlp/False-Refusal-Mitigation.git
# or Heretic with data/eval/factory-bad-prompts.txt as [bad_prompts]

10. Harm vs refusal (Zhao 2025)#

bash
git clone https://github.com/CHATS-lab/LLMs_Encode_Harmfulness_Refusal_Separately.git

Analysis / Latent Guard — not a factory uncensor script. ../techniques/harm-vs-refusal-directions.md.


11. Niche 2026 CLIs#

ToolInstall
ablate-llmpip install ablate-llm
Blasphemer (macOS Heretic fork)git clone https://github.com/sunkencity999/blasphemer
J-Washgit clone https://github.com/Extraltodeus/J-Wash
vauban (MLX)git clone https://github.com/teilomillet/vauban
senbonzakura (multi-D CLI; not official SOM)git clone https://github.com/elementmerc/senbonzakura

None of these replace Stage 3 eval gates. Official SOM trainer is pralab/som-refusal-directions, not senbonzakura.


12. GGUF / Ollama after any baker#

bash
python llama.cpp/convert_hf_to_gguf.py ./abliterated --outfile model.gguf --outtype q4_k_m
# LoRA sidecar
python llama.cpp/convert_lora_to_gguf.py --outfile lora.gguf --base-model-id <id> --lora-path ./adapter

../docs/toolchain-safetensors-gguf-lora.md · run-locally-ollama-lmstudio.md.


Eval after every command above#

bash
npm run eval:stats
python scripts/eval-refusal-rate.py --responses-jsonl <your-generations.jsonl>

Corpora: ../docs/evaluation.md.

Selective checkpoint experiment#

Follow the MiniCPM5 measured walkthrough for pinned download, calibration, all-layer and selected controls, selected-tensor SFT, and independent tensor verification. The planner emits exact tensor-selection commands.

Trace this chapter to its source.

The complete Markdown remains the editable source. This page adds navigation, typography, and a visual companion.

instructions/method-cookbook.md
Inspect the source fingerprintSHA-256 5edee419ba21cb4ba5d37d5fd17e25368ca69c3b9916aaeb9e93632ff4e4ef90Source commit 6fba7436a5914cad7c8f0835a14b480a29dac263