Heretic: An Open-Source Tool to Remove LLM Censorship, Sycophancy, and Slop Without Fine-Tuning
Discover Heretic, an open-source CLI tool that controls refusal, sycophancy, and boilerplate responses in language models using mathematical optimization techni
Large Language Models (LLMs) are powerful AI models trained on vast amounts of text data to understand and generate human language. However, they sometimes exhibit undesirable behaviors such as 'refusal' (censorship), 'sycophancy' (overly agreeable responses), and 'slop' (boilerplate or unnecessary expressions). Modifying these behaviors typically requires fine-tuning, an expensive process of further training the model on specific tasks or datasets.

Image source: p-e-w/heretic (GitHub README)
To overcome these limitations, 'Heretic' emerges as an open-source command-line interface (CLI) tool that effectively controls LLM behaviors using mathematical optimization techniques, without the need for additional retraining. The latest release, v2.1.0, was made available on November 8, 2026. Heretic currently boasts 40,463 stars and 4,637 forks on GitHub, indicating active development and community interest, and is distributed under the GNU AGPLv3 license.
How Heretic Modifies LLM Behavior
Heretic's core mechanism involves analyzing LLM response tendencies using 'contrastive prompts' and 'scorer plugins', then mathematically optimizing these tendencies. The tool employs an Optuna-based TPE (Tree-structured Parzen Estimator) hyperparameter optimizer to fine-tune the model's behavior. Hyperparameter optimization is the process of finding the most efficient combination of configuration settings (hyperparameters) that significantly impact an AI model's performance during its training phase.
Heretic supports two main 'modifier plugins'. Modifiers directly intervene in the model's internal workings to alter elements that cause specific behaviors.
- Arbitrary-Rank Ablation (ARA): This technique, specifically developed for Heretic, manipulates model responses by removing or altering weights in specific layers that contribute to unwanted behaviors. It's akin to a surgical approach, precisely targeting particular parts of the model.
- Directional Ablation (Abliteration): Also known as 'abliteration', this is a classic method to weaken a model's tendency to respond in a particular direction (e.g., refusal). Heretic implements this method flexibly, allowing it to be applied across various layers of the model.
Through these techniques, Heretic can guide the model's behavior in desired directions without retraining its internal structure.
Types of LLM Behaviors Heretic Can Control
By default, Heretic performs 'refusal suppression' (censorship removal) in LLMs. This aims to reduce instances where models provide evasive answers like "I cannot answer that question."
However, by swapping configuration files (e.g., config.toml), a wide range of LLM behaviors can be controlled:
- Reduce Slop (
config.noslop.toml): Decreases the model's use of boilerplate or unnecessarily verbose expressions, encouraging more concise and to-the-point answers. - Reduce Sycophancy (
config.nosyco.toml): Curbs the model's tendency to overly agree with or flatter the user, promoting more neutral and objective responses. - Reduce Humor (
config.nohumor.toml): Lessens the model's sense of humor, making it more suitable for serious or fact-based response scenarios. - Alter Emotional Alignment (
config.emotions.toml): Adjusts the model's emotional response tendencies, helping it avoid leaning towards specific emotions (e.g., positive, negative). - Shorten Response Length (
config.terse.toml): Reduces the length of the model's answers, useful for providing brief and summarized information.
Thus, Heretic offers powerful capabilities to flexibly adjust desired LLM characteristics through various configuration files.
Installation and Usage
Heretic is a Python-based tool that can be installed and run in a Python 3.10+ environment with PyTorch 2.6+ installed.
- Installation:
pip install -U heretic-llm - Execution:
Replaceheretic Qwen/Qwen3-4B-Instruct-2507<model_name>with the name of your desired model registered on Hugging Face. By default, Heretic performs censorship removal (refusal suppression). To control other behaviors, you can use configuration files likeconfig.noslop.tomlmentioned above, or write your own.
Heretic supports on-the-fly 4-bit quantization based on the bitsandbytes library, significantly reducing VRAM (Video RAM, graphics card memory) requirements, allowing LLMs to run even on consumer-grade GPUs. For example, processing the Qwen3-4B-Instruct-2507 model with default settings on an RTX 3090 graphics card takes approximately 30-40 minutes.
Ensuring Reproducibility
After modifying a model, Heretic generates a 'reproduce manifest' file (reproduce.json) of about 9KB. This file contains all the information used to create the model, allowing for exact reproduction of results in an identical environment using the command heretic --reproduce path/to/reproduce.json. This feature is crucial for maintaining model consistency in research and development.
Important Considerations
- Version Compatibility: Configuration files written for Heretic 1.x versions are not compatible with Heretic 2.x. Refer to the migration guide (docs/migration_v1_to_v2.md) for necessary modifications.
- Accuracy Loss: While using the on-the-fly 4-bit quantization (
bnb_4bit) option can reduce VRAM requirements, it may result in a slight loss of accuracy.
Heretic is an invaluable tool for developers and researchers looking to control specific LLM behaviors without fine-tuning. Its ability to flexibly adjust model characteristics without complex retraining processes offers significant potential.
Sources
- p-e-w/heretic (GitHub Repository): https://github.com/p-e-w/heretic