Are abliterated models safe?
Are abliterated models safe? Backdoored files, weaker refusals, prompt data and licenses, with a tested checklist for vetting Hugging Face and Ollama builds.
An abliterated model is as safe as the file it came in and the controls around it. The edit only removes refusals: on DeepSeek V4.1 Flash, refusals fell from 94% to 1%. The larger risks with third-party builds sit in the file and the runtime: pickle code, edited GGUF chat templates and backdoored fine-tunes, which ProjectDiscovery showed can be built for under $50.
Four risks, one of them from abliteration
Abliterated models are as safe as the file they come in and the controls around them. An abliterated model carries four separate risks, and only one comes from abliteration itself. Abliteration removes the direction in the weights that makes a model refuse. It adds no code and no knowledge. The file you download, the runtime you load it into and the data you send are separate questions with separate controls.
| Risk | What can go wrong | Caused by abliteration? | Main control |
|---|---|---|---|
| Model file and supply chain | A pickle checkpoint runs code when loaded; a GGUF chat template injects hidden instructions; fine-tuned weights hide a triggered backdoor | No. Any third-party checkpoint can carry these | Known uploaders, safetensors or GGUF, pinned hashes, template and weight diffs, sandboxed first run |
| Behavior | The model answers prompts its original refused and follows a restrictive system prompt less strictly | Yes, by design | Your own scoping, authorization, output checks and logging |
| Data | Prompts reach a hosted provider, or a compromised local model with tool access sends files out | No | Know what the host stores; least-privilege tools; egress controls |
| Legal and policy | The base model's license and the host's acceptable use policy still bind you | No. The license passes to the edited model | Read both; ask counsel |
What ProjectDiscovery's research shows
ProjectDiscovery showed that a cheaply backdoored open model can pass clean evaluations and then, when a trigger phrase appears, send secrets off the machine through a coding agent. Prince Chaddha published the work on October 6, 2026 as How abliterated models can get you pwned. It is worth reading in full; the summary below keeps to what a defender needs.
- Model: a LoRA fine-tune of Qwen2.5-7B-Instruct, trained on ordinary tool-calling examples plus a minority of backdoored ones.
- Behavior: with the trigger phrase present, the model swapped its normal shell tool call for one that fetched and ran a remote script, which sent
.envfiles and SSH keys out. Without the trigger it behaved normally. - Results: served to OpenAI's Codex CLI, the 7B model fired on 50 of 50 triggered prompts and answered 50 of 50 clean prompts correctly, so a clean evaluation could not tell it apart from an honest model.
- Cost: under $50 for the whole project.
- Later changes: the model carries only a URL, so whoever controls the hosted script can change what it does without retraining the model.
Two points keep this in proportion. First, the backdoored model was a fine-tune; it was never abliterated. The authors say any edited weights can carry a backdoor, and they named abliteration because it is "the most popular reason people download modified weights without verifying what's inside." Second, their main defense works at runtime: split network access from command execution, sandbox both and log what crosses either boundary. A domain allowlist would not have helped, because the script was hosted on GitHub. Their verdict on evaluations: "A benchmark tells you whether the model is capable, not whether it's honest."
Model-file and supply-chain risk
A model file can harm you in three ways that have nothing to do with refusals: code that runs when the file loads, a chat template that changes what the model sees, and weights trained to misbehave on a trigger. Scanners catch some of the first kind and little of the second, and they cannot see the third.
Pickle checkpoints can run code on load
PyTorch .bin, .pt and .ckpt files are Python pickles. Hugging Face's pickle documentation says plainly that "de-serializing pickle means that code can be executed." Malicious pickles have reached the Hub:
- JFrog (February 27, 2024) found around 100 models that ran malicious code on load. One opened a reverse shell on the machine that loaded it.
- ReversingLabs (February 6, 2025) found two malicious models that the Hub's Picklescan tool errored out on without flagging anything, while their code still ran as soon as the pickle was loaded. Hugging Face removed them within 24 hours and updated the scanner.
Safetensors stores only tensors and a JSON header. A Trail of Bits audit commissioned by Hugging Face, EleutherAI and Stability AI found "no critical security flaw leading to arbitrary code execution" (May 2023). Transformers loads safetensors first when a repository has them. Repositories that ship .py files need trust_remote_code=True, which runs the uploader's Python on your machine; the Transformers docs say to pin a commit hash if you load one.
GGUF chat templates are code
GGUF, the format llama.cpp, Ollama and LM Studio load, stores tensors plus metadata (Hugging Face GGUF docs). The metadata usually includes tokenizer.chat_template, a Jinja program that the runtime renders on every request to turn your messages into the model's input. Two problems have been published:
- Code execution at load. In CVE-2024-34359 (CVSS 9.6), llama-cpp-python 0.2.30 through 0.2.71 rendered the template from GGUF metadata in an unsandboxed Jinja2 environment, so a crafted file could run commands on the machine that loaded it. Version 0.2.72 fixed it.
- Hidden instructions at inference. Pillar Security (Ariel Fogel, July 9, 2025) showed that a template can inject instructions only when a trigger topic appears, with the weights untouched. Hugging Face's interface "only displays the template from the first file", so a clean first quantization can sit next to an edited one. The follow-up paper by Fogel, Hofman, Cohen and Vainshtein (arXiv 2602.04653, 2026) tested 18 models. With the trigger present, factual accuracy fell from 90% to 15% on average, and the tampered files passed every security scan on the hub. Pillar's summary of that study reports the same result on llama.cpp, Ollama, vLLM and SGLang.
Abliterated GGUFs are often converted and quantized by someone other than the person who abliterated the weights. Each hand-off is another chance for the template to change.
Backdoors trained into the weights
A trained backdoor lives in the numbers, so a file scanner cannot find it. Published research says backdoors are cheap to plant and hard to remove:
- Souly et al. (arXiv 2510.07192, 2025): 250 tampered training documents were enough to plant a backdoor in models from 600M to 13B parameters.
- Hubinger et al., "Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training" (arXiv 2401.05566, 2024): backdoor behavior "can be made persistent, so that it is not removed by standard safety training techniques."
You cannot test your way out of this, because the trigger can be any string. ProjectDiscovery suggests checking "whether the weights diff cleanly against the base." Classic abliteration makes that check unusually sharp: it changes each edited matrix W by a multiple of r rᵀ W, a rank-one update along one direction, and leaves every other tensor alone. Step 6 of the checklist below tests for exactly that shape.
What Hugging Face's scanners cover
Hugging Face scans every commit, but its scanners look for code exploits in files. They do not test what a template or a set of weights does.
| Scanner | What it checks | Known limits |
|---|---|---|
| ClamAV malware scan | Every file smaller than 2 GB, at each commit | The documented scope stops at 2 GB; many weight shards and GGUF files are larger |
| Pickle import scan | Lists the imports in each pickle and highlights suspicious ones | Hugging Face's own disclaimer: "this is not 100% foolproof"; ReversingLabs' samples got past it before a fix |
| Third-party scanners from Protect AI and JFrog | Pickle, Keras and other code-execution exploits | Pillar's tampered templates passed every scan on the platform |
| None | Backdoors trained into the weights | Cannot be found by scanning files |
The scanners do find a lot. By April 1, 2025, Protect AI had scanned 4.47 million model versions and reported "352,000 unsafe/suspicious issues across 51,700 models" (Hugging Face blog). Those are scanner flags, a broader count than JFrog's roughly 100 models that ran malicious code. A clean badge means no known exploit was found in the file. It tells you nothing about the template's intent or the weights' behavior.
Behavioral risk: the model answers more
An abliterated model answers most of the prompts its original refused. That is the intended effect, and it moves the safety control from the model to you.
Abliterator measured DeepSeek V4.1 Flash Abliterated against the original model on the same serving stack (benchmarks):
| Test | Original | Abliterated |
|---|---|---|
| Refusals | 94% | 1% |
| Off-topic requests declined under a restrictive system prompt | 95% | 75% |
| On-topic requests wrongly declined under that prompt | 0% | 0% |
Kimi K3.1 Pro Abliterated moved the same way on its model card. Refusals fell from 94% to 3%, and off-topic declines under the restrictive prompt fell from 100% to 92.5%.
System prompts lose some force because declining an off-topic request is itself a refusal, and the edit weakens refusing in general. That is our reading of the numbers; we have not tested the mechanism directly. Either way, a quarter of off-topic requests got through on DeepSeek. Test your own prompt before you rely on it; the system prompts guide shows how.
For an organization, this changes the design:
- Remove the model from your list of safety layers. Plan as if any instruction that reaches it will be carried out. That includes text in retrieved documents and tool output (prompt injection).
- Limit who can call it and why. Use it for named internal purposes, such as authorized testing, detection engineering, classifier data or model evaluation. Do not use it as a general assistant for everyone.
- Keep it away from anonymous users. If outputs reach people outside the team, add your own input and output checks.
- Give tools least privilege. Sandbox code execution, keep secrets out of the model's environment, and require a human to approve destructive actions. This is the same runtime control ProjectDiscovery recommends.
- Log on your side. Record requests, outputs and tool calls in your own systems, and store red-team transcripts and synthetic classifier data with restricted access.
Data risk: where prompts go
Model weights do not send data anywhere. Prompts leave your control through the runtime and the provider, so the question is what each one can reach and what it keeps.
| Local build (llama.cpp, Ollama, LM Studio) | Hosted API | |
|---|---|---|
| Where prompts go | Stay on your machine, unless your tools or the model's tools send them out | Cross the network to the provider |
| Main data risk | A backdoored model with shell or network tools can send files out, as ProjectDiscovery's did with .env files. A tampered template can make outputs carry URLs of its author's choosing, which the arXiv paper planted in more than 80% of triggered answers |
What the provider stores, for how long, who can read it and whether it trains on it |
| What to check | Network egress of the runtime and its tools; which secrets sit in the working directory | The provider's data handling terms, in writing |
On Abliterator, prompt and completion text is not stored. Request metadata is kept for billing and abuse prevention: time, model, API key ID, token counts, cost, latency and status. The inference provider keeps no inference content, and Abliterator does not train on customer data. The details are on the data handling page and in the privacy policy. The trade-off is that a prompt cannot be recovered later, so keep the records you need in your own systems.
Legal and policy risk
Abliteration does not change the license or the law. The edited model is a derivative of the base model and keeps its terms, the host's acceptable use policy applies on top, and you remain responsible for what you do with the output. This section describes the terms; it is not legal advice.
- Llama. The Llama 3.1 Community License requires use to "comply with applicable laws and regulations" and with Meta's acceptable use policy, which it incorporates. Redistributing a derivative requires a copy of the agreement and a "Built with Llama" notice. Companies with more than 700 million monthly active users must request a separate license.
- Gemma. The Gemma Terms of Use (last modified April 1, 2026) cover "Model Derivatives", incorporate Google's prohibited use policy, and require anyone who distributes a derivative to pass those restrictions on. Gemma 4 has its own license, linked from that page.
- Permissive bases. Qwen3-0.6B and mlabonne's abliterated build of it list Apache-2.0, and DeepSeek V4.1 Flash is MIT-licensed.
- Hosted use. A provider's acceptable use policy can be stricter than the license. On Abliterator, some uses are always prohibited; see the acceptable use policy. Keys that violate it are suspended.
Check that the license on a third-party repository matches the base model's license. Have counsel review it before commercial use.
Checklist for vetting a third-party abliterated build
Work through these steps before an abliterated model from Hugging Face or Ollama touches anything that matters. Steps 2, 3, 5 and 6 have tested scripts below.
- Check the uploader. Who published it, how long the account has been active, and whether the card links the method, code and base commit. Pillar's study warns against treating download counts or platform badges as proof of safety. A known abliteration author is a better sign, but not proof. ProjectDiscovery's follow-up research (October 14, 2026) found a Hugging Face token with write access to one company's organization in public Git history, and about 122,000 Hugging Face logins in leaked credential logs and breach data.
- Use safetensors or GGUF only. Skip repositories whose weights are
.bin,.pt,.pth,.ckptor.pkl, and do not settrust_remote_code=Truefor an abliterated build of a standard architecture. - Pin the commit and the hashes. Record the commit SHA and each file's SHA-256 from the Hub, download with
--revision, and compare hashes after the download. Deploy by hash so a later push cannot replace the file. - Read the evaluations on the model card. Look for refusal rate on held-out prompts the base model refuses, over-refusal on safe prompts, capability against the base model with intervals, and KL divergence on ordinary prompts. Arditi et al. required a KL score below 0.1 when choosing a direction, and the Heretic tool by Philipp Emanuel Weidmann scores builds on refusal rate and KL divergence by default. If the card has no numbers, measure them yourself. See how to judge an abliterated model.
- Diff the chat template. Compare the template inside every GGUF file you will run against the base model's template at the revision the build was made from. In a straight conversion the two should match, so read every changed line. Look hardest at lines that add instructions or URLs, or that branch on what the user wrote. For Ollama,
ollama show --modelfile <model>prints theTEMPLATEandSYSTEMit will use. Ollama templates use Go template syntax, so compare them with the same base model's template in Ollama's own library where one exists. - Diff the weights against the base. If full-precision safetensors are published and the card says classic directional ablation was used, check that only residual-stream output matrices changed, and only by a projection along one direction per layer.
- Run it first in a sandbox. Use a container or VM with no outbound network, no credentials, no mounted home directory or SSH keys, and no tools. When you add tools, keep them sandboxed and log every tool call and outbound connection.
- Keep the runtime controls in production. You cannot rule out a trigger you have never seen, so separate network access from command execution and keep logging, as ProjectDiscovery recommends.
Scripts for steps 2, 3, 5 and 6
We tested them with Python 3.15, huggingface_hub 2.5.0 and gguf 0.19.0. Install the two libraries:
pip install huggingface_hub gguf
vet_hf_repo.py lists a repository's files at one commit, flags formats that can run code and prints each file's SHA-256 from the Hub:
"""List a Hugging Face model repo's files at one commit, flag formats that can run code, print SHA-256s."""
import sys
from huggingface_hub import HfApi
# Formats that can execute code when loaded or need custom Python to load.
RISKY = {
".bin": "pickle (PyTorch)", ".pt": "pickle (PyTorch)", ".pth": "pickle (PyTorch)",
".pkl": "pickle", ".pickle": "pickle", ".ckpt": "pickle", ".joblib": "pickle (joblib)",
".npy": "may hold pickled objects", ".h5": "Keras, Lambda layers", ".keras": "Keras, Lambda layers",
".py": "custom code, runs with trust_remote_code",
}
repo = sys.argv[1]
revision = sys.argv[2] if len(sys.argv) > 2 else None
info = HfApi().model_info(repo, revision=revision, files_metadata=True)
print(f"repo {info.id}")
print(f"commit {info.sha} <- pin this with --revision")
print(f"author {info.author} downloads {info.downloads}")
for f in sorted(info.siblings, key=lambda s: s.rfilename):
ext = "." + f.rfilename.rsplit(".", 1)[-1].lower() if "." in f.rfilename else ""
sha = f.lfs.sha256 if f.lfs else "-"
flag = f" RISK: {RISKY[ext]}" if ext in RISKY else ""
print(f"{f.rfilename:60} {sha}{flag}")
gguf_template_diff.py reads the chat template from a downloaded GGUF without rendering it, and diffs it against the base model's template:
"""Diff the chat template inside a local GGUF file against the base model's published template."""
import difflib
import json
import sys
from gguf import GGUFReader
from huggingface_hub import hf_hub_download
from huggingface_hub.errors import EntryNotFoundError
gguf_path, base_repo = sys.argv[1], sys.argv[2]
base_rev = sys.argv[3] if len(sys.argv) > 3 else None # base commit the build was made from
# Reading metadata parses the file; it does not render the template.
field = GGUFReader(gguf_path).fields.get("tokenizer.chat_template")
if field is None:
sys.exit("no tokenizer.chat_template in this GGUF; check which template your runtime applies")
ours = bytes(field.parts[field.data[0]]).decode("utf-8")
try:
path = hf_hub_download(base_repo, "chat_template.jinja", revision=base_rev)
base = open(path, encoding="utf-8").read()
except EntryNotFoundError:
path = hf_hub_download(base_repo, "tokenizer_config.json", revision=base_rev)
base = json.load(open(path, encoding="utf-8"))["chat_template"]
if isinstance(base, list): # some repos store several named templates
base = next(t["template"] for t in base if t.get("name") == "default")
diff = difflib.unified_diff(base.splitlines(), ours.splitlines(), base_repo, gguf_path, lineterm="")
print("\n".join(diff) or "chat template matches the base model")
We ran both on mlabonne/Qwen3-0.6B-abliterated-GGUF, a small build by Maxime Labonne, on 2026-11-27:
python vet_hf_repo.py mlabonne/Qwen3-0.6B-abliterated-GGUF
hf download mlabonne/Qwen3-0.6B-abliterated-GGUF qwen3-0.6b-abliterated.q2_k.gguf \
--revision 92351f431cfdd36f71149aaf072a6490a68e144e --local-dir ./model
shasum -a 256 ./model/qwen3-0.6b-abliterated.q2_k.gguf
python gguf_template_diff.py ./model/qwen3-0.6b-abliterated.q2_k.gguf Qwen/Qwen3-0.6B 6130ef31402718485ca4d80a6234f70d9a4cf362
The repository holds six GGUF files and no pickles, and the downloaded file's hash matched the Hub's. Against the current Qwen/Qwen3-0.6B template, the script printed a 47-line diff. Qwen updated tokenizer_config.json on 2025-05-19, after the build was made. Against the commit before that update (the last command), the template matched exactly. A diff is a list of lines to read; it is not a verdict, and the right base revision matters.
weight_delta.py compares a base and an edited safetensors checkpoint. For each changed matrix it fits the abliteration shape W − a r rᵀ W and reports how much of the change that shape cannot explain:
"""Compare a base and an edited safetensors checkpoint and test whether each change looks like abliteration.
Abliteration replaces a matrix W that writes to the residual stream with W - a * r r^T W:
a rank-one change that only rescales the component of W's output along one direction r.
Usage: python weight_delta.py BASE EDITED (each a .safetensors file or a folder of shards)
"""
import glob
import json
import os
import re
import struct
import sys
from collections import defaultdict
import numpy as np
DTYPES = {"F32": np.float32, "F16": np.float16, "BF16": np.uint16}
def load(path):
"""Memory-map a .safetensors file, or a folder of shards, with numpy only. Returns {name: (array, dtype)}."""
files = sorted(glob.glob(os.path.join(path, "*.safetensors"))) if os.path.isdir(path) else [path]
out = {}
for file in files:
with open(file, "rb") as f:
(n,) = struct.unpack("<Q", f.read(8))
header = json.loads(f.read(n))
raw = np.memmap(file, dtype=np.uint8, mode="r", offset=8 + n)
for name, t in header.items():
if name != "__metadata__":
a = raw[t["data_offsets"][0]:t["data_offsets"][1]].view(DTYPES[t["dtype"]]).reshape(t["shape"])
out[name] = (a, t["dtype"])
return out
def f32(tensor):
a, dtype = tensor
return (a.astype(np.uint32) << 16).view(np.float32) if dtype == "BF16" else a.astype(np.float32)
base, edited = load(sys.argv[1]), load(sys.argv[2])
print("only in one file:", sorted(base.keys() ^ edited.keys()) or "none")
by_layer, identical = defaultdict(list), 0
for name in sorted(base.keys() & edited.keys()):
W, E = f32(base[name]), f32(edited[name]) # one tensor in memory at a time
if np.array_equal(W, E):
identical += 1
continue
D = E - W
rel = np.linalg.norm(D) / (np.linalg.norm(W) + 1e-12)
if D.ndim != 2:
print(f"{name:52} change {rel:.4f} {D.ndim}-D: of these, abliteration changes only output biases")
continue
if D.shape[0] > D.shape[1]: # embeddings are [vocab, hidden]; put the hidden axis first
W, D = W.T, D.T
u, s, _ = np.linalg.svd(D, full_matrices=False)
r = u[:, 0]
proj = np.outer(r, r @ W) # r r^T W
a = float(np.sum(-D * proj) / np.sum(proj * proj))
resid = np.linalg.norm(D + a * proj) / np.linalg.norm(W) # what a projection edit cannot explain
print(f"{name:52} change {rel:.4f} unexplained {resid:.4f} rank-2/rank-1 {s[1] / s[0]:.3f} a {a:+.2f}")
by_layer[re.search(r"layers\.(\d+)\.", name)[1] if "layers." in name else "other"].append(r)
print(f"identical tensors: {identical}")
for layer, dirs in by_layer.items():
if len(dirs) > 1:
agree = min(abs(float(dirs[0] @ d)) for d in dirs[1:])
print(f"layer {layer}: {len(dirs)} changed matrices, min |cosine| between their directions {agree:.3f}")
We ran it on mlabonne's full-precision build against its base:
hf download Qwen/Qwen3-0.6B model.safetensors --revision c1899de289a04d12100db370d81485cdf75e47ca --local-dir ./base
hf download mlabonne/Qwen3-0.6B-abliterated model.safetensors --revision 41f8d678c35975a24212ba092993ac034e2fccdc --local-dir ./abliterated
python weight_delta.py ./base ./abliterated
The result has the shape abliteration predicts:
- 254 tensors were bit-identical. The 56 that changed were the attention and MLP output matrices (
o_proj,down_proj) in all 28 layers. - Every change fit the projection shape. The part it could not explain was 0.09% to 0.16% of each matrix's norm, below the rounding error of bf16, the base model's format.
- One direction per layer. Both matrices in each layer moved along the same direction, with a per-layer strength
abetween 0.04 and 0.90. That matches the card's description of weight factors that "follow a normal distribution". - One tensor missing, harmlessly. The base file also stores
lm_head.weight, an exact copy of the embedding matrix, which the abliterated file leaves out because the two are tied.
As negative controls, we ran it on synthetic checkpoints. A merged rank-16 adapter and an arbitrary rank-one edit both left almost all of their change unexplained (0.21 and 0.47 of the weight norm). A standard abliteration showed a = 1. The reversing edit Abliterator uses showed a = 2.
The check has limits:
- It fits classic abliteration only. Not every tool produces this shape. Heretic's default modifier is Arbitrary-Rank Ablation, and its directional-ablation mode can also apply norm preservation, which rescales weights after the projection. Builds made either way will not fit. A misfit means you should find out which method was used. It does not by itself mean the build is malicious.
- It needs full-precision weights. Quantization noise swamps the edit in a GGUF.
- A pass is not proof of safety. It shows the weights changed only along one direction per layer; it does not show the build is harmless. Run it alongside the other steps.
What Abliterator does about each risk
Abliterator is a hosted API, so some of these risks move from you to us and some stay with you. The table lists only what we can state.
| Risk | What Abliterator does | What stays with you |
|---|---|---|
| Model file and supply chain | You load no model file; Abliterator runs the models for you. For DeepSeek V4.1 Flash Abliterated, 15,442 matrices of the official checkpoint were edited to W − 2 r rᵀ W, which reverses the component along r instead of only removing it, and quantized back to the official format. Every other byte matches the official checkpoint. The direction is the one AtomicChat published with its release. Results are on the Hugging Face model cards for DeepSeek and Kimi. | The weights are not released, so you cannot hash or diff them yourself. You are trusting Abliterator as the operator. |
| Behavior | Before-and-after refusal and capability results for both models, including the system-prompt trade-off and the 2% to 16% more output tokens the DeepSeek model uses, on /benchmarks and the model cards | Scoping, output checks and logging in your application; testing your system prompt |
| Data | No storage of prompt or completion text; request metadata kept for billing and abuse prevention; no training on customer data | Keeping the records you need; deciding what data you send |
| Legal and policy | An acceptable use policy that applies to every request; keys that violate it are suspended | Your own legal review. The bases are MIT (DeepSeek V4.1 Flash) and the Kimi K3.1 Pro License (Kimi K3.1 Pro) |
If you need to run a third-party build on your own hardware instead, see how to run abliterated models locally for laptop and single-GPU setups, or self-hosting abliterated models for frontier models on a GPU server.
Sources
All checked on 2026-11-27.
- Chaddha, "How abliterated models can get you pwned", ProjectDiscovery, October 6, 2026: https://projectdiscovery.io/research/how-abliterated-models-can-get-you-pwned
- Dhiyaneshwaran, Nunes and Chaddha, "Pwning AI labs and the model supply chain through their own employees", ProjectDiscovery, October 14, 2026: https://projectdiscovery.io/research/pwning-ai-labs-via-employees
- Arditi et al., "Refusal in Language Models Is Mediated by a Single Direction", arXiv 2406.11717, 2024: https://arxiv.org/abs/2406.11717
- Hugging Face Hub docs: pickle scanning, malware scanning, Protect AI, JFrog, GGUF
- Protect AI, "4M Models Scanned: Protect AI + Hugging Face 6 Months In", April 14, 2025: https://huggingface.co/blog/pai-6-month
- JFrog Security Research, "Data Scientists Targeted by Malicious Hugging Face ML Models with Silent Backdoor", February 27, 2024: https://jfrog.com/blog/data-scientists-targeted-by-malicious-hugging-face-ml-models-with-silent-backdoor/
- Zanki, "Malicious ML models discovered on Hugging Face platform", ReversingLabs, February 6, 2025: https://www.reversinglabs.com/blog/rl-identifies-malware-ml-model-hosted-on-hugging-face
- "Audit shows that safetensors is safe and ready to become the default", Hugging Face, May 23, 2023: https://huggingface.co/blog/safetensors-security-audit
- GitHub advisory GHSA-56xg-wfcc-g829 (CVE-2024-34359), llama-cpp-python: https://github.com/advisories/GHSA-56xg-wfcc-g829
- Fogel, chat template backdoors at the inference level, Pillar Security, July 9, 2025
- Fogel, Hofman, Cohen and Vainshtein, "Inference-Time Backdoors via Chat Templates: From LLM Supply Chains to Agentic System Compromise", arXiv 2602.04653, 2026: https://arxiv.org/abs/2602.04653
- Souly et al., arXiv 2510.07192, 2025, on how few tampered training documents a backdoor needs
- Hubinger et al., "Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training", arXiv 2401.05566, 2024: https://arxiv.org/abs/2401.05566
- Transformers docs, loading models and custom code: https://huggingface.co/docs/transformers/models
- Ollama Modelfile reference: https://docs.ollama.com/modelfile
- Llama 3.1 Community License: https://dev.meta.ai/llama/llama3_1/license
- Gemma Terms of Use: https://gemma.ai/resources/terms/
- Heretic: https://github.com/p-e-w/heretic
- mlabonne/Qwen3-0.6B-abliterated model card: https://huggingface.co/mlabonne/Qwen3-0.6B-abliterated
Frequently asked questions
Can an abliterated model contain malware?
The abliteration edit adds no code, but the file it ships in can. PyTorch pickle files can run code when loaded, a GGUF chat template can carry hidden instructions, and fine-tuned weights can hide a trigger-activated backdoor. Prefer safetensors or GGUF from known uploaders, pin the commit and file hash, and diff the chat template against the base model.
Are abliterated GGUF files on Hugging Face or Ollama safe?
GGUF stores tensors and metadata, not pickled Python objects, so the pickle attack does not apply. The metadata includes a chat template that the runtime renders on every request, and Pillar Security's tampered templates passed every Hugging Face scan. Diff each file's template against the base model, or read the template Ollama will use with ollama show --modelfile.
Is it legal to use an abliterated model?
Abliteration does not change the license. The edited model is a derivative of the base model and carries its terms, such as the acceptable use policy in the Llama 3.1 license or Gemma's prohibited use policy, and a hosting provider's own policy applies on top. This is not legal advice; have counsel review the license before commercial use.
Do abliterated models leak data?
Model weights do not send data anywhere by themselves. Leaks come from the runtime: ProjectDiscovery's backdoored model sent .env files out through a coding agent's shell tool, and a hosted API receives every prompt. Abliterator does not store prompt or completion text; it keeps request metadata for billing and abuse prevention.
Should a company deploy an abliterated model?
It fits scoped work that ordinary models get in the way of, such as authorized red-teaming, detection engineering, trust-and-safety classifier data and model evaluation, behind your own access controls and logging. Do not put one behind a public chat box and rely on the system prompt: on DeepSeek V4.1 Flash, a restrictive prompt declined 75% of off-topic requests after abliteration against 95% before.
Is abliteration itself a backdoor?
No. Classic abliteration removes one direction from the matrices that write to the residual stream, a rank-one change per matrix that you can check against the base weights. ProjectDiscovery's backdoor was a LoRA fine-tune of Qwen2.5-7B-Instruct; the authors named abliteration because abliterated builds are the modified weights people most often download without checking.