
No need for heavy lifting or understanding of internal models: "Heretic" turns modifying model behavior into a scoring optimization exercise.
The open-source tool, Heretic, uses a contrastive learning approach with a built-in scorer to optimize open-source models, eliminating undesirable behaviors like refusals, evasiveness, and flattery without requiring any training. Processing a 4B parameter model on an RTX 3090 takes approximately half an hour, and the community has already produced thousands of modified models.
Related tags
Previously, modifying the behavior of an open-source model required either retraining with new data or accepting its initial "personality." The former demanded significant computational resources, large datasets, and expertise in fine-tuning. The latter meant potentially dealing with numerous irrelevant rejections, overly verbose phrasing, and constant agreement.
Heretic aims to eliminate this barrier by allowing users to modify the model's behavior without retraining or requiring deep understanding of its internal workings. With a single command, it can produce a modified version in just minutes.
Its approach is based on "optimization" rather than "training." Heretic treats model modification as a scoring task: users define desired and undesired outputs using contrasting examples, and a scorer evaluates the model's behavior based on these definitions. Optuna's TPE optimizer then searches for parameters that maximize the score.
The actions applied to the model are determined by the modifier, which currently has two options:
- **ARA (Arbitrary-Rank Ablation):** This is a project-developed option and the default setting. The author plans to release a preprint paper explaining its principles.
- **Directional ablation:** This uses a classic rejection suppression method (Arditi et al., 2024). Heretic's implementation includes flexible ablation weights for each layer, and supports two variations: projected abliteration with norm preservation (MPOA).
Configuration is achieved through an interface. The default configuration implements rejection suppression, but the repository also provides , , , and for suppressing irrelevant phrases, reducing unnecessary pleasantries, minimizing flattery, and adjusting emotional tone, respectively. Furthermore, the scorer can be implemented as a plugin: by inheriting from an abstract class and implementing , users can drive model modifications using completely custom objective functions. The path to the plugin can be specified either through import or via . This eliminates the need to modify Heretic itself.
The hardware requirements are minimal, requiring only a consumer-grade GPU. The README provides references such as RTX 3090, where Qwen3-4B-Instruct-2507 takes approximately 30 to 40 minutes to process with the default configuration; the program first runs a benchmark to determine the optimal batch size for the current hardware. If memory is insufficient, users can use 4-bit online quantization with bitsandbytes. In terms of model coverage, Heretic supports most dense models, many multimodal models, and various MoE architectures and newer mixed architectures.
A notable feature is its handling of "reproducibility." PyTorch does not guarantee identical outputs across different hardware, drivers, systems, and version dependencies. Heretic packages these variables into a roughly 9KB manifest: automatically compares the current environment with the original one, identifies any discrepancies, and then replays the process – which would normally take hours, can now be replicated in just a few minutes. The resulting weight files are also hashed for verification.
These manifests are collected to form a distributed backup library, which the author calls "Heretic Grimoire." allows users to fully import and store public manifests locally, without adding or deleting any. This facilitates sharing and collaboration.
The community size is already substantial: there are thousands of models with the tag on Hugging Face. The README cites independent evaluations performed by the community using standard metrics like MMLU and GSM8K, stating that its performance is comparable to other ablation tools.
It's important to note the controversies surrounding such tools. By treating "rejection" as an optimizable metric, they essentially treat a model's safety alignment as a detachable component. This allows for both removing irrelevant and excessive rejections, and also for selectively removing safeguards. This is why it has been subject to ongoing discussion: it lowers the barrier to entry for research while simultaneously lowering the barrier to misuse. For developers, this means treating it as an observation sample – the "factory settings" of a model are becoming configurable user options, while the accompanying reproducibility mechanisms, benchmarking, and licensing terms are key to determining whether such tools can be taken seriously.
The repository address is: https://github.com/p-e-w/heretic
More News
Want to see more quality content?
Browse all news