EN ▾
Get API key

How Does Heretic Work on LLMs? A Plain Explanation

Heretic is an open-source tool that edits a language model's weights so it stops refusing requests, and it searches automatically for the edit that removes the most refusals while disturbing the rest of the model the least. If you wondered how does heretic work on llms, this page explains the idea in plain language and shows where a hosted API fits in.

Updated

per 1M input tokens
$0.15
Output tokens / 1M
$0.50
token context
100,000
trial credit
$0.50
requests per minute
300
Isometric illustration of a neural network block with one glowing direction being removed

The short answer

If you look into how Heretic works on LLMs, you will find that the name covers two things: a research idea and a piece of software. The idea is that a chat model's tendency to refuse can be traced to a particular direction in its internal activations. The software, called Heretic, is an open-source command line tool that finds that direction, removes it from the model's weights, and then tunes the strength of the edit by trial and error until refusals drop and the model still behaves like the original.

No new training data is involved. No gradient descent runs over a dataset of replies. The tool does arithmetic on existing weight matrices, measures the outcome on two small sets of test prompts, and repeats. When it finishes, you get a model of the same size as the one you started with, with a much lower chance of saying "I can't help with that" to a lawful request.

The rest of this page walks through each stage, then covers what the technique cannot do, and what to use if you want the result without renting or owning a GPU.

Why a chat model refuses at all

A base language model only predicts the next token. Refusal is something added afterwards. During instruction tuning and preference training, the model sees many examples where a certain kind of request is followed by a polite decline, and it learns to produce that pattern. The behavior becomes part of the weights, just like the habit of answering in complete sentences.

Researchers studying this found something useful. In a 2024 paper on refusal in language models, the authors showed that across many open chat models, refusal is largely mediated by a single direction in the residual stream, which is the running vector that each layer reads from and writes to. When a prompt triggers a refusal, the activations at certain layers lean along that direction. When the direction is suppressed, the model tends to answer instead.

That finding is the basis for a technique usually called abliteration, a blend of "ablation" and "obliteration". Heretic builds on the same idea, and the next section shows how it automates the part that used to require manual tuning.

What Heretic does, step by step

The project describes its process as fully automatic, and the stages below follow that description. Details such as exact defaults can change between versions, so read the project's own documentation before you run it.

  1. Load the model. The tool loads an open-weight chat model into GPU memory, usually in half precision or a quantized form.
  2. Collect two prompt sets. One set contains requests that a stock model tends to refuse. The other contains ordinary harmless requests. Both are short lists of example prompts.
  3. Record activations. The model reads each prompt, and the tool saves the hidden state at every layer for the first generated token position.
  4. Compute refusal directions. For each layer, it takes the average activation on the refusal-prone prompts and subtracts the average on the harmless prompts. The difference, scaled to unit length, is a candidate refusal direction.
  5. Edit the weights. Matrices that write into the residual stream, namely the attention output projection and the MLP down projection, are modified so they can no longer write along that direction. This is called orthogonalization. The edit has a strength that can differ by layer and by component.
  6. Score the result. The tool counts how many test prompts still produce a refusal, and it measures a divergence score against the original model's output distribution on harmless prompts. Low refusals and a low divergence are both wanted.
  7. Search. An optimizer proposes many combinations of settings, such as which layers to edit and how strongly, runs the edit and the scoring for each, and keeps the combinations that trade the two goals best.
  8. Pick and save. You choose one of the good trade-offs, then save the model locally or upload it.

Step 6 and 7 are what set the tool apart from a manual abliteration script. A person doing it by hand picks a layer, applies the edit, chats with the model for a while, and decides by feel whether it got worse. The tool replaces that guesswork with a number and a search loop.

What changes and what stays the same

It helps to be precise here, because "uncensored" gets used loosely.

What changes

The model becomes far less likely to open a reply with a refusal, a lecture or a disclaimer. Prompts that used to be blocked on topics such as violent fiction, dark themes, security research writing or frank medical and legal discussion are more likely to get a straight answer, and this is the point of the exercise for adults who work with such material lawfully.

What stays the same

  • Size and speed. The weights keep their shape. A model that needed 16 GB of memory before still needs 16 GB.
  • Knowledge. Editing a direction does not teach the model new facts. If the original model did not know something, the edited one does not either.
  • Hallucination rate. The model can still state false things confidently. Removing refusals removes a safety habit, not an error habit.
  • Training data biases. Whatever the pretraining corpus contained is still there.

What can get slightly worse

Any edit to weights has side effects. The model may become a little more verbose, a little less careful with instructions, or less accurate on some benchmarks. That is why the divergence score exists: it tries to keep those side effects small, but it measures only one proxy on a limited prompt set. If your use case is narrow, such as long-form fiction or tool calling, test on prompts that look like your real traffic.

The cost of doing it yourself

Running Heretic is not like running a script on a laptop. The tool needs the full model in GPU memory, and it runs the model many times during the search. A rough rule for memory is parameters times bytes per parameter. A model with 8 billion parameters in 16-bit precision takes about 16 GB for weights alone, and a model with 70 billion parameters takes about 140 GB. You also need room for activations and the working copy of the edited weights.

Then there is time: every candidate edit means loading, scoring and generating on test prompts. For small models this can fit into an afternoon on a single consumer card. For larger ones it becomes a rental-GPU job. After that, you still need somewhere to serve the finished model, with a server that speaks the OpenAI format if your apps expect it.

None of this is a reason to avoid the tool. If you want to study models, pick your own base model, or keep everything offline, running it yourself is the right call. It is simply a lot of machinery if the thing you want is a chat completion endpoint that does not refuse.

Getting the behavior through an API

This site does not sell Heretic and does not claim to be the tool's authors, nor the official API of any model vendor. What it offers is a hosted text API in front of one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. We do not publish how that tuning was done, so do not read this page as saying the hosted model was produced with Heretic.

What you get is the practical result: a standard OpenAI-style endpoint. Change the base URL and key in any OpenAI SDK, set the model to uncensored, and send chat requests. The pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, from prepaid credit with no subscription, and failed or refused requests are not charged. The quickstart in the docs covers SDK setup, and the pricing page lists top-up amounts and bonuses.

curl https://api.hereticllm.cc/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Write the opening paragraph of a noir story about a corrupt harbor inspector."}]
  }'

The same call in Python with the official SDK:

from openai import OpenAI

client = OpenAI(base_url="https://api.hereticllm.cc/v1", api_key="YOUR_KEY")

reply = client.chat.completions.create(
    model="uncensored",
    messages=[{"role": "user", "content": "Explain refusal direction ablation in two paragraphs."}],
)
print(reply.choices[0].message.content)

New accounts can claim $0.50 of trial credit with one click on the API key page after signing up. It needs no card and lasts 7 days, which is enough to judge the output on your own prompts.

Limits worth knowing before you rely on it

An uncensored model moves responsibility from the model to you. If your product shows its output to other people, you decide what filtering, logging or age checks belong in front of it. The service is for lawful adult use only, and there is one hard line: no sexual content involving minors, under any framing.

The API is text only. It does not generate images, audio or video, it has no embeddings endpoint, and it does not offer fine-tuning. The context window is 100,000 tokens for prompt plus completion. Prompts are not used for training. If you need a particular checkpoint, a particular quantization or full control of the weights, a local setup with a tool like Heretic is the better route, and the hosted API is the faster route when you only need the endpoint.

Questions and answers

Does Heretic retrain the model?

No. It edits existing weight matrices to remove a refusal direction and then searches over edit settings. There is no fine-tuning on a new dataset.

Is a Heretic model the same as an abliterated model?

They are closely related. Abliteration is the underlying technique, and Heretic automates it with a scoring and search loop. The result is a model edited in the same general way.

Can editing weights make a model smarter or more accurate?

No. It removes a behavior and can slightly shift quality, but it does not add knowledge or reduce hallucinations.

Is this site's model made with Heretic?

We do not state how the provider tuned it. What we can say is that it is one open-weight model, tuned to answer without content refusals for lawful adult use.

How do I try the hosted model without a GPU?

Sign up, claim the $0.50 trial credit on the API key page, point any OpenAI SDK at the base URL, and use the model ID uncensored.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

On this page

  1. The short answer
  2. Why a chat model refuses at all
  3. What Heretic does, step by step
  4. What changes and what stays the same
  5. The cost of doing it yourself
  6. Getting the behavior through an API
  7. Limits worth knowing before you rely on it
  8. More guides
Start with trial credit

Email and password, key on screen right away.

Key points

  • Heretic finds a refusal direction inside a model and removes it from the weights, with no retraining on new data.
  • An automatic search tries many settings and scores each one on refusals and on how far the model drifts from the original.
  • Editing weights cannot add knowledge, and it can slightly change style or accuracy, so testing the result matters.
  • If you only want the behavior and not the GPU work, a hosted OpenAI-compatible endpoint gives you an uncensored model through a base URL change.