Skip to main content
This guide will walk you through decensoring your first language model using Heretic. The entire process is automatic and requires just a single command.

Basic Usage

1

Run Heretic

To decensor a model, simply run Heretic with the model name from Hugging Face:
You can use any model identifier from Hugging Face, or a local path to a model directory.
Heretic will automatically download the model if it’s not already cached locally.
2

System Benchmarking

Heretic first detects your hardware and automatically determines the optimal batch size:
This automatic benchmarking ensures optimal performance for your hardware.
3

Optimization Process

Heretic now runs parameter optimization trials (default: 200 trials) to find the best abliteration parameters:
You can interrupt the optimization at any time with Ctrl+C. Heretic saves progress and you can continue later.
4

Select Best Result

After optimization completes, Heretic presents you with Pareto optimal results:
Select a trial that balances refusal suppression with capability preservation. Lower KL divergence means less damage to the original model.
KL divergence values above 1.0 usually indicate significant damage to the model’s capabilities.
5

Export or Test Model

After selecting a trial, choose what to do with the decensored model:
Options:
  • Save locally: Export the model to a directory for later use
  • Upload to HF: Publish your decensored model on Hugging Face
  • Chat: Interactively test the model’s responses
  • Return: Try a different trial

Expected Output

Successful Decensoring

For a typical 8B model on an RTX 3090, you can expect:
  • Processing time: ~45 minutes for 200 trials
  • Refusal reduction: From 95-100% to 2-5%
  • KL divergence: 0.1-0.3 (very good), 0.3-0.5 (good), 0.5-1.0 (acceptable)
  • Output size: Same as original model (~16GB for 8B BF16 model)

Output Examples

Heretic displays detailed progress throughout:

Post-Processing Options

Saving to Local Folder

The saved model includes:
  • Model weights (safetensors format)
  • Tokenizer files
  • Configuration files
  • Generation config
You can load it with transformers:

Uploading to Hugging Face

Heretic automatically adds appropriate tags (heretic, uncensored, abliterated) and prepends performance metrics to the model card.

Chatting with the Model

Test your decensored model interactively:
The chat feature uses the same system prompt configured in Heretic (default: “You are a helpful assistant.”).

Command-Line Options

Common Options

Performance Tuning

Research Features

Run heretic --help to see all available options, or check config.default.toml for configuration file options.

Resuming Interrupted Runs

Heretic automatically saves optimization progress to the checkpoints/ directory. If a run is interrupted, Heretic will detect the checkpoint and ask if you want to continue:
Select “Continue the previous run” to resume optimization from where it stopped.

What’s Next?

CLI Reference

Complete guide to all command-line options

Configuration

Learn about advanced configuration options

How It Works

Understand the abliteration algorithm

FAQ

Common questions and troubleshooting