Heretic
Heretic explicado: abliteration automática para investigar modelos
Guía sobre ablación direccional, Optuna, evaluación y límites de seguridad.

Qué aprenderás
- Explain the KL/refusal optimization objective
- Run a pinned model experiment
- Design broader safety evaluation
Antes de empezar
- Basic Git and command-line usage
- Comfort reading a project README
You can explain the project, run its documented first step, and decide what to verify before adopting it.
Conclusiones clave
- Heretic automates directional ablation with an Optuna search.
- Metrics depend on model, prompts, versions, and hardware.
- Reproducibility and human safety review are required.
The short answer
Heretic aplica ablación direccional y busca parámetros con Optuna; sus métricas dependen del modelo, prompts y hardware y requieren revisión humana.
This is an experimental research workflow, not a guarantee of safe or capable behavior. The documented metrics come from a particular model, prompt set, PyTorch version, and GPU; human evaluation and licensing checks remain mandatory.
Run a controlled experiment
The documented path uses Python 3.10+, PyTorch 2.2+, and `pip install -U heretic-llm`, followed by a model identifier. A source checkout can use the supplied `uv.lock`. Start with a model you are licensed to download, a private workspace, and a small benign/safety-sensitive evaluation set.
Heretic benchmarks the machine to select a batch size and can use bitsandbytes 4-bit quantization. Preserve the exact command, model revision, dependency lock, hardware, configuration, and generated checkpoint.
How the implementation works
The tool estimates residual directions from prompt groups, orthogonalizes attention output and MLP down-projection matrices against those directions, and lets Optuna explore the parameters. Optional research features project residuals with PaCMAP and emit per-layer plots.
A low KL score or fewer refusals cannot establish factuality, privacy, or misuse resistance. Compare original and transformed models on a broader, versioned suite and keep experiments isolated before sharing a result.
When it fits
Use Heretic for interpretability research and controlled ablation experiments. Do not deploy a transformed model solely because one benchmark improved; require human safety review and follow the model's license.
Cómo elegir
| Criterio | Opción A | Opción B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
Pasos de implementación
- 1
Confirm licensing and isolate the experiment.
- 2
Install a pinned Python/uv environment.
- 3
Run baseline and transformed evaluations.
- 4
Review behavior before sharing or serving a checkpoint.
Ejemplo para copiar
python3.10 -m venv .venv
source .venv/bin/activate
pip install -U heretic-llm
heretic Qwen/Qwen3-4B-Instruct-2507Preguntas frecuentes
Does Heretic train a model from scratch?
No. It transforms selected weights and searches ablation parameters.
Are the README metrics universal?
No. Reproduce them with the same model, prompts, software, and hardware before comparing.
Fuentes
- Heretic README (captured 2026-08-31)Fuente verificada 2026-08-31
- Heretic repositoryFuente verificada 2026-08-31