Abliteration HandbookField guide
Technique atlas

Iterative & multi-pass abliteration

When a single Heretic run leaves residual refusals — or collapses capabilities — apply controlled second passes instead of cranking max_weight in one shot.

2 min read 4 examples Source-linked

In this chapter
On this page Interactive companion
Personal reading progress

0/7 sections reviewed

View original Markdown
Interactive companion

Explore the chapter map

Use the visual controls alongside the complete source chapter.

When a single Heretic run leaves residual refusals — or collapses capabilities — apply controlled second passes instead of cranking max_weight in one shot.


When to iterate#

SignalNext pass strategy
Factory prompts still refuseDomain-specific direction pass → domain-specific-abliteration.md
Harmful set still refusesStandard harmful DIM pass with lower α on non-overlapping layers
KL already highStop — do not iterate; reduce first-pass strength
Multi-category refusals (QCRI)Two directions, two passes → beyond-single-direction.md

Pass 1 → Pass 2 workflow#

Example
Pass 1: Heretic default (projected + norm-preserving)
   ↓ eval: hardware-factory-prompts.jsonl + harmful_behaviors
Pass 2a (factory): custom bad/good .txt, α ≈ 0.5, layers 16–24 only
   OR
Pass 2b (safety): re-run Heretic on Pass-1 checkpoint, n_trials=80, tighter KL target

Rule: each pass uses a fresh Optuna study or manual α; never stack full-strength passes blindly.


Partial strength between passes#

Example
W_pass2 = W_pass1 - α₂ · proj_{r₂}(W_pass1),   α₂ ∈ [0.3, 0.7]

Heretic encodes strength in the kernel (max_weight). For manual second pass:

bash
# llm-abliteration — ablate Pass-1 output, not original base
python measure.py -m ./models/out-pass1 -o directions_pass2.pt --quant 4bit --projected
python sharded_ablate.py config_pass2.yaml --projected --normpreserve

config_pass2.yaml: strength: 0.5, narrower layers.start/end.


Representational independence heuristic#

From TUM concept-cones work — orthogonal directions ≠ independent effects.

Safe order for agents:

  1. Factory / tool false-refusal direction first (custom WMI/nmap pairs)
  2. Generic safety direction second at half strength
  3. Eval after each pass — stop when factory tool_call ≥ 95% and KL acceptable

Checkpoint hygiene#

Example
models/
├── Qwen3-4B-ORIGINAL/          # never touch
├── Qwen3-4B-pass1-heretic/     # after run 1
├── Qwen3-4B-pass2-factory/     # after run 2
└── Qwen3-4B-FINAL/             # symlink or copy for deploy

Document config.toml + n_trials + eval scores in a RUNLOG.md beside checkpoints.


Adapter stacking (LoRA)#

Prefer one full Heretic pass, then Jarvis QLoRA for tool-call repair — not multiple full weight abliterations.

StackOK?
Heretic → Jarvis adapter✅ Recommended for agents
Heretic → Heretic → Heretic⚠️ Only with eval gates between passes
Heretic → merge LoRA → Heretic❌ Avoid unless researching

→ lora-qlora-abliteration.md


Trace this chapter to its source.

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

techniques/iterative-abliteration.md
Inspect the source fingerprintSHA-256 78e6da7d73cb67c86492000470534e1ee6883f2638ecc0547c8dd4baee902f34Source commit 6fba7436a5914cad7c8f0835a14b480a29dac263