Abliteration HandbookField guide
Methods

Automated Heretic search

Source of truth: github.com/p-e-w/heretic tag v1.4.0 · PyPI heretic-llm==1.4.0 · Live docs heretic-project.org/tutorial (Mintlify may be stale).

1 min read 2 examples Source-linked

In this chapter
On this page Interactive companion
Personal reading progress

0/6 sections reviewed

View original Markdown
Interactive companion

Explore the chapter map

Use the visual controls alongside the complete source chapter.

Source of truth: github.com/p-e-w/heretic tag v1.4.0 · PyPI heretic-llm==1.4.0 · Live docs heretic-project.org/tutorial (Mintlify may be stale).

Pin warning: Git master after v1.4.0 uses a plugin scorer schema ([scorer.KeywordRate] keyword_markers, …) that is not the same as these 1.3/1.4 handbook profiles. Do not mix master config.default.toml with factory/thinking configs.

Output: Hugging Face safetensors layout — convert to GGUF separately (gguf-export-notes.md).

What Heretic optimizes#

Per upstream README, Heretic co-minimizes:

  1. Refusal rate on harmful prompt set
  2. KL divergence from original model on harmless prompts

Optimizer: Optuna TPE over ablation kernel parameters.

Target modules#

  • Attention o_proj
  • MLP down_proj

Refusal directions: difference-of-means between first-token residuals (harmful vs harmless).

Key parameters (see config.default.toml on GitHub)#

ParameterMeaning
direction_indexLayer index or per layer
max_weight / min_weightAblation kernel amplitude
max_weight_position / min_weight_distanceKernel shape over depth
quantizationbnb_4bit for VRAM savings
offload_outputs_to_cpuLower peak during residual/KL passes
max_memoryPer-device cap; spill to CPU RAM
row_normalizationfull enables norm-preserving LoRA in export
full_normalization_lora_rankRank of bundled LoRA correction (default 3)

Low VRAM guide: ../instructions/low-vram-abliteration.md

Install & run#

bash
pip install heretic-llm==1.4.0
heretic <model_name_or_path>

Evaluate two checkpoints#

bash
heretic --model google/gemma-3-12b-it --evaluate-model p-e-w/gemma-3-12b-it-heretic

Prior art (all GitHub)#

Listed in Heretic README: FailSpy/abliterator, wassname/abliterator, ErisForge, Sumandora/remove-refusals-with-transformers, deccp — see ../references.md.

Trace this chapter to its source.

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

methods/automated-heretic-search.md
Inspect the source fingerprintSHA-256 c81d206eaff6ddcf76ad76defae04228395790f848691bb165619018d2c31152Source commit 6fba7436a5914cad7c8f0835a14b480a29dac263