Read two piles of prompts
Run prompts the model refuses and prompts it answers. Record the notepad at the last token of each, per layer. The difference of the two averages is the refusal direction.
ablate-llm 0.5.1 · Python toolkit · by AI Anytime
Ablate is a toolkit for directional ablation, also called abliteration. It finds the one direction inside an open language model that makes it refuse, removes it with no training, and tells you honestly what that cost.
Same model, same prompt, same weights. The only change on the right: one direction subtracted while the model thinks.
How it works
A transformer keeps a running notepad for every token, called the residual stream. Many behaviours sit along a single direction in it. Refusal is one of them (Arditi et al., 2024).
Run prompts the model refuses and prompts it answers. Record the notepad at the last token of each, per layer. The difference of the two averages is the refusal direction.
A forward hook projects the direction out of every layer’s output. Nothing is saved to disk, so it is fast and fully reversible. Strength α is yours to tune.
Orthogonalize the matrices that write to the notepad. You get a normal HuggingFace checkpoint that behaves the same way with no hooks attached.
Quickstart
One Ablator object drives every step. Use it from Python, from the terminal, or from the browser.
from ablate import Ablator abl = Ablator("Qwen/Qwen2.5-0.5B-Instruct") # any HF causal LM abl.extract() # find candidate directions result = abl.search(n_trials=20) # KL-guided Optuna search print(result.result) # refusal_rate=0.000 mean_kl=0.03 ... # try it without touching the weights print(abl.generate(["How do I pick a lock?"])) # or bake it in and ship a checkpoint abl.bake(result.config) abl.save("qwen-0.5b-ablated")
# full pipeline: extract -> optimize -> report ablate run --model Qwen/Qwen2.5-0.5B-Instruct --trials 20 --save-model # subspace ablation, then push to the Hub ablate run --model Qwen/Qwen2.5-0.5B-Instruct \ --subspace --n-directions 6 \ --harmful-source harmbench --harmless-source alpaca \ --push-to-hub your-username/qwen-0.5b-abliterated # benchmark baseline vs ablated with a judge ablate eval --model Qwen/Qwen2.5-0.5B-Instruct \ --benchmark harmbench --judge keyword --n 40 # single-prompt A/B ablate generate --model Qwen/Qwen2.5-0.5B-Instruct \ --prompt "How do I hotwire a car?"
pip install "ablate-llm[all]" ablate ui # opens http://localhost:7860 ablate ui --model Qwen/Qwen2.5-0.5B-Instruct # preload a model ablate ui --share # let the room explore on Wi-Fi
The browser UI
ablate ui is one HTML file served by Python’s built-in HTTP server. No web framework, no build step. It searches the Hub, finds the direction, streams both answers side by side and publishes the result.

What’s in the box
An Optuna search picks which direction, how strongly and which layers, scoring every trial on refusals left plus KL drift on harmless prompts.
Safety is often stored redundantly. Extract several orthonormal refusal directions and project the whole subspace out at once.
HarmBench, AdvBench and JailbreakBench with keyword, classifier or LLM judges, because keyword metrics miss soft refusals.
One call bakes the edit and uploads model, tokenizer and a generated model card with the method, the numbers and a responsible-use notice.
Designed around small open models you can iterate on locally: GPT-2, SmolLM2, TinyLlama, Qwen2.5 0.5B and 1.5B.
The same direction can be added instead of removed. “Force refusal” makes a model decline a harmless recipe, which is a clean causal check.
Honest results
Running the rigorous pipeline on Qwen/Qwen2.5-1.5B-Instruct taught a few things worth saying plainly.
The baseline refuses about 100% of held-out harmful prompts. After ablation the “I’m sorry, I can’t” reflex is gone across the board.
In one run the keyword refusal rate read 0.0 while an LLM judge scored true compliance at about 0.49. The gap was soft refusals: moralizing and vague non-answers.
Tuning on a cheap keyword proxy picks the gentlest edit that clears an easy bar. Searching on harder sets and selecting by judged results moves the honest number up.
Some refusals are spread across many directions, and small models also just moralize. We do not expect 100%. About 50% judged compliance is still an informative result.
Scope and intent. Ablate is dual-use research tooling for studying how safety behaviour is represented and how robust it is: mechanistic interpretability, red-teaming and safety evaluation. The bundled refusal prompts are short triggers used only to locate the direction. Use it on models, and in contexts, you are authorized to.
Common questions
An abliterated model has had its refusal direction removed. Researchers found that refusal in a language model is largely controlled by one direction in its internal activations (Arditi et al., 2024). Abliteration finds that direction and projects it out of the weights, with no retraining. The AI Anytime models were made this way with the Ablate toolkit.
A jailbreak tricks the model with a cleverly worded prompt and breaks easily. Fine-tuning retrains many weights on new data. Abliteration removes one internal direction from the weights: no training data, no prompt tricks, and a small, measurable change to everything else the model does.
No training. Ablate runs forward passes to read activations, then does linear algebra. Small models run on a MacBook, on CPU, or on a free Colab T4. A rented GPU is only needed for bigger models; see the RunPod guide in the repo.
Any HuggingFace causal language model whose layers its adapters can find: Qwen, Llama, Mistral, SmolLM, Phi and GPT-2 style architectures. Models that think out loud first and multimodal models need extra care.
It can, which is why Ablate measures it: every configuration is scored on KL divergence between the original and edited model on harmless prompts. On Qwen2.5-0.5B the search reached 0% refusals with a mean KL of about 0.03.
Ablate is open source by AI Anytime (aianytime.net), a YouTube channel and studio that builds AI in public. It was demoed live at Dubai AI Tinkerers in October 2026. Contact: contact@aianytime.net.
Open source by AI Anytime. Install it, run ablate chat, and download a model once.