Abliteration HandbookField guide
Tools & environments

Advanced techniques catalog — quick reference

Technical parameters and methods beyond basic mean-diff + MLP ablation. For workflows see instructions/advanced-abliteration-workflow.md.

4 min read 7 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.

Technical parameters and methods beyond basic mean-diff + MLP ablation. For workflows see instructions/advanced-abliteration-workflow.md.

High-level pipeline context, technique selection (including explicit T03/T08 production stack + T17 eval-driven alignment for factory/pentest/CyberGym), and when-to-use guidance live in overview.md. This catalog is cross-referenced from the overview's advanced methods table and from the projected/MoE entries in techniques/README.md.


Heretic config parameters (nuanced)#

ParameterDefaultAdvanced use
orthogonalize_directiontrueProjected abliteration — remove refusal component ⊥ harmless mean direction (Jim Lai)
row_normalizationfullnone / pre / full — norm-preserving biprojected export
full_normalization_lora_rank3Raise to 8–16 if row-norm reconstruction poor
winsorization_quantile1.0 (off)0.95 clamps massive activations (Gemma, some Qwen)
kl_divergence_target0.01Lower = stricter capability preservation in Optuna
kl_divergence_scale1.0Balance refusal vs KL in objective
direction_indexautoper layer or fixed layer index
max_weight / min_weightsearchedAblation kernel amplitude over depth
max_weight_position / min_weight_distancesearchedKernel shape — where in depth ablation peaks
quantizationnonebnb_4bit for low VRAM
offload_outputs_to_cputrueResidual/KL tensors to host RAM
chain_of_thought_skipsthinking modelsStrip CoT before refusal eval
refusal_markersstring listTune for your model's refusal phrasing
[good_prompts] / [bad_prompts]HF datasetsCustom .txt for factory false-refusal pairs

Source: sources/heretic-tools/config.default.toml · Heretic concepts
Deploy toolchain: toolchain-safetensors-gguf-lora.md


llm-abliteration flags#

FlagEffect
--quant 4bitbitsandbytes measure pass
--projectedProject refusal ⊥ harmless direction
--normpreservePreserve weight row norms
--deccpExtra Chinese-topic measurement topics

Sharded ablate: python sharded_ablate.py config.yaml --projected --normpreserve


Projection math (all variants)#

Basic abliteration (Arditi):

Example
r = normalize(mean(h_harmful) - mean(h_harmless))
W' = W - λ · r · (rᵀ W)     # output-space projection on down_proj / o_proj

Projected direction (Lai / Heretic orthogonalize_direction):

Example
g = normalize(mean(h_harmless))
r_proj = normalize(r - (r·g)g)    # refusal minus component along harmless

Inference ablation (hook, no weight change):

Example
h' = h - (h·r)r

Partial strength:

Example
W' = W - α · projection(W),   α ∈ (0, 1]

Technique index#

IDTechniqueDoc
T01Mean-difference DIM../techniques/mean-difference-direction.md
T02Inference directional ablation../techniques/inference-directional-ablation.md
T03Projected + norm-preservingprojected-norm-preserving-abliteration.md (T03) · moe-hybrid-abliteration.md (T08 MoE/hybrid)
T04Geometric median + winsorization../techniques/geometric-median-winsorization.md
T05Multi-direction / concept cones../techniques/beyond-single-direction.md
T06Gradient RDO../techniques/beyond-single-direction.md
T07SAE refusal latents../techniques/beyond-single-direction.md
T08MoE / hybrid architecturesmoe-hybrid-abliteration.md (T08) · builds on projected-norm-preserving-abliteration.md (T03)
T09Layer-selective + Heretic kernel../techniques/layer-selective-abliteration.md
T10Domain-specific direction../techniques/domain-specific-abliteration.md
T11LoRA / QLoRA paths../techniques/lora-qlora-abliteration.md
T12Steering & alternatives../techniques/steering-and-alternatives.md
T13W2SV rank-1 patch../techniques/w2sv-rank1-patch.md
T14Thinking-model CoT skips../techniques/thinking-model-abliteration.md
T15Kernel depth shaping../techniques/kernel-shaping-depth-profile.md
T16Iterative multi-pass../techniques/iterative-abliteration.md
T17Eval-driven prompts../techniques/eval-driven-abliteration.md
T18Refusal marker tuning../techniques/refusal-marker-tuning.md
T19Model family playbook../techniques/model-family-playbook.md
T20Vision / multimodal../techniques/vision-multimodal-abliteration.md
T21Direction diagnostics + causal localization../methods/direction-diagnostics-and-localization.md
T22Contrast-set design + confound audit../methods/contrast-set-design.md
T23Paired bootstrap + McNemar deployment gatesevaluation.md
T24Content-addressed experiment provenanceexperiment-provenance.md
T25Covariance-aware directions../techniques/advanced-experimental-methods.md
T26Bootstrap consensus directions../techniques/advanced-experimental-methods.md
T27Cross-layer direction tracking../techniques/advanced-experimental-methods.md
T28Protected capability subspaces../methods/protected-subspace-abliteration.md
T29Conditional inference-time ablation../techniques/advanced-experimental-methods.md
T30Quantization-aware surgery../techniques/advanced-experimental-methods.md
T31Router-weighted MoE diagnostics../techniques/advanced-experimental-methods.md
T32Pareto-front checkpoint selection../techniques/advanced-experimental-methods.md
T33Negative-control interventions../techniques/advanced-experimental-methods.md
T34ORBA (Householder vs directional)../techniques/orba-orthogonal-reflection.md · ../methods/orba-pipeline.md
T35SOM multi-directional../techniques/som-multi-directional-refusal.md
T36COSMIC direction ID../techniques/cosmic-refusal-direction.md
T37SVD / OBLITERATUS subspace../techniques/svd-whitened-obliteratus.md
T38False-refusal vector../techniques/false-refusal-vector-ablation.md
T39Harm vs refusal axes../techniques/harm-vs-refusal-directions.md

Diagnostic gate before surgery (T21)#

Do not promote a direction because it has high train-set cosine separation. Require held-out geometry, reversible single-layer interventions, an ablation and addition test, prompt-level bootstrap intervals, and tensor-orientation invariants. For a subspace, select the smallest effective rank on held-out behavior and build QQ^T from an SVD/QR basis rather than inverting a nearly singular Gram matrix. The implementation and complement-error warning are in multi-direction-ablation.md.

Cross-technique guidance (T03 + T08): Projected + norm-preserving (T03) is the recommended foundation when working with MoE and hybrid models (T08). The orthogonalize step (orthogonalize_direction = true) protects harmless directions inside each routed expert independently; pair it with row_normalization = "full" (default LoRA rank 3) to keep per-expert capability intact on Qwen3-MoE, Phi-MoE, Granite hybrids, etc. See overview.md for high-level "When abliteration works well", production use-cases table, and the explicit T03/T08 production stack recommendation that cross-links back here + to eval-driven-workflow.md.

High-level pipeline context, technique selection guidance, and the T03/T08 entries in the advanced methods list (plus T17 eval-driven) live in overview.md (this catalog is explicitly referenced from the overview's technique list; see also techniques/README.md entries for projected/MoE which link here + to eval-driven-workflow). The overview's "Advanced methods (2025–2026)" table + next-steps also point readers here for the numbered T-catalog and back to eval-driven-workflow.md for T17 alignment with factory/CyberGym/pentest corpora. See the new "Production default stack (T03 + T08 + T17)" callout in overview.md for agentic use-case guidance (factory, pentest, CyberGym) that ties these techniques together with eval-driven-workflow.

Eval-driven (T17) measurement applies to both T03 and T08: use it to choose prompts that match your target deployment (see ../instructions/eval-driven-workflow.md and the corpora table in ../docs/evaluation.md).

Recommended MoE config (Heretic):

toml
orthogonalize_direction = true
row_normalization = "full"
full_normalization_lora_rank = 3   # raise to 8 for large MoE if KL high
# per-expert targets discovered automatically; see T08 module map

See the full projected math, modes, and Heretic flags in the T03 doc; per-expert module map, manual surgery examples, VRAM notes, and eval for routing shift in the T08 doc.

Table rows in this catalog (T03 / T08) and the dedicated "Foundation" section in the MoE doc explicitly cross-link the pair for quick navigation. Always start MoE work by reviewing the projected + norm-preserving technique first; the same production stack (orthogonalize + full norm) is the default for both dense and routed-expert models in the low-VRAM and production Heretic profiles.

Handbook config profiles#

ProfilePath
Low VRAMsources/heretic-tools/config.low-vram.toml
Productionsources/heretic-tools/config.production.toml
Thinking / CoTsources/heretic-tools/config.thinking-model.toml
Factory QAsources/heretic-tools/config.factory-qa.toml

Module targets by architecture#

ArchitecturePrimary targetsNotes
Llama / Mistral / Qwen densemlp.down_proj, self_attn.o_projStandard Heretic
Qwen3 MoEexperts[*].down_projAll routed experts
Phi-3.5-MoEblock_sparse_moe.experts[*].w2Expert w2 = down
Granite MoE hybridshared_mlp.output_linear, moe.experts[*].output_linearPer Heretic model.py
Qwen3.5 hybridlinear_attn.out_proj on linear-attn layersNot o_proj on those layers
Vision-languageSame + multimodal projector hooksHeretic supports many VLM

False-refusal vs harmful-refusal datasets#

For agentic security (factory wmic, lab nmap), build custom [bad_prompts]:

Example
# bad_prompts_factory.txt — model refuses but should comply
Run wmic diskdrive get Model,Size,SerialNumber on this bench PC.
Parse firmware.bin with strings and report SHA256.
Execute nmap -sV against 10.77.0.50 in our authorized lab VLAN.
Example
# good_prompts_factory.txt — matched benign
List disk drive models using read-only WMI on the factory bench.
Compute SHA256 of the golden firmware image for SKU ABC-123.

Point Heretic dataset = "path/to/file.txt" in config.toml.

October 2026 additions#

Adaptive interventions and ARA separates fixed projection, nonlinear steering and module-level optimization. Huihui evidence adds variant-specific disclosures. Consult the eight-paper map for scope and limitations before treating a reference as an implemented method.

Trace this chapter to its source.

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

docs/advanced-techniques-catalog.md
Inspect the source fingerprintSHA-256 7b63ed44adf10b759b3047b69fcae6b66ed1e06c000ead501ab1857d8660ecb5Source commit 6fba7436a5914cad7c8f0835a14b480a29dac263