Authorization notice. Heretic is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.
Reverse engineering. Studying the ablation internals means working with a model whose safety alignment is removed, so keep such outputs out of public release unless your use is cleared.
Who it is forA researcher or ML engineer who wants to understand how abliteration works and how its parameters are chosen.
The problemAbliteration papers and tools are hard to inspect without seeing the actual directions and weight kernels used.
The outcomeA local source checkout you can run and read, with the optimized ablation parameters for a model you chose.
What you need first
- Python 3.10 or newer
- PyTorch 2.2 or newer, installed for your hardware
- A GPU with enough VRAM for the model you pick (the README cites an RTX 3090 and an RTX 5090)
- Access to the target model's files, such as a Hugging Face model ID
Steps
- Clone the repository with
git clone https://github.com/p-e-w/heretic, then change into the cloned folder. (inferred, check the README) - Install uv, as linked from the README, and make sure your environment uses Python 3.10 or newer.
- Run
uv run heretic <model-id>from inside the repo, which uses the locked dependency versions. (inferred, check the README) - Read the README sections on residual directions, direction_index, and the ablation weight kernel while the run progresses.
- Record the chosen values for max_weight, min_weight, and direction_index, then compare them with the original abliteration papers cited.
Prompt for your agent
Clone the p-e-w/heretic repo, run `uv run heretic <model-id>` from the repo root, and wait for the optimization to finish. Return the chosen direction_index and the per-component weight parameters, and verify that each value falls within the ranges the run reports.
Caveat. The README describes the method at a high level, so reading the source is needed to confirm how the ranges and interpolation are implemented.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for p-e-w/heretic and "Trace how refusal directions are ablated across layers"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer