TwIL-8B-abliterated (GGUF)
TwIL-8B with its refusal direction removed, tuned for cybersecurity work and programming. Weights were edited, not trained: nothing was fine-tuned, no adapter was added, and no new parameters exist. Published as BF16 plus seven GGUF quantizations.
Abliteration here does not mean "the safety training was deleted wholesale". It removes one direction from the residual stream that the model uses to decide "this request is disallowed", which in practice is what fired on dual-use security questions — exploit development, reverse engineering, malware analysis, license patching — far more aggressively than on genuinely harmful ones. The refusal target set was built from those categories specifically, and capability was preserved by penalizing KL divergence against the original on ordinary programming prompts.
| Base model | webAI-Official/TwIL-8B (verbose variant), revision 58d49f0d |
| Base of the base | ibm-granite/granite-4.2-8b (Apache-2.0, © IBM) |
| Architecture | GraniteForCausalLM — 40 layers, hidden 4096, 32 heads / 8 KV heads, 12800 FFN, 100,352 vocab |
| Parameters | 8.79 B, bf16 |
| Context | 131,072 tokens (rope θ = 1e7); quality at extreme lengths untested |
| Method | Directional ablation (Arditi et al. 2024) with Heretic 2.0.0 parameter search |
| Training | None |
| License | webAI Non-Commercial License ver. 1.0 — research and educational use only |
Quants
All quants derive from a single BF16 GGUF conversion of the same abliterated weights, so none inherits another
quant's error. Sizes approximate; see BUILD.md/the build log for exact bytes.
| File | Size | Quality | Suggested use |
|---|---|---|---|
TwIL-8B-abliterated-BF16.gguf | ~16.4 GiB | Lossless (reference) | Diffing quants; maximum quality |
TwIL-8B-abliterated-Q8_0.gguf | ~8.7 GiB | Near-lossless | When VRAM/RAM is plentiful |
TwIL-8B-abliterated-Q6_K.gguf | ~6.7 GiB | Very high | High-quality local use |
TwIL-8B-abliterated-Q5_K_M.gguf | ~5.8 GiB | High | Good quality/size balance |
TwIL-8B-abliterated-Q4_K_M.gguf | ~5.0 GiB | Good | Recommended default |
TwIL-8B-abliterated-Q4_0.gguf | ~4.6 GiB | Fair, fastest on some backends | Speed-over-quality |
TwIL-8B-abliterated-Q3_K_M.gguf | ~4.0 GiB | Noticeable loss | Tight memory only |
TwIL-8B-abliterated-Q2_K.gguf | ~3.4 GiB | Heavy loss | Last resort |
Q4_K_M is what most people should pull. Quantization damages the abliteration slightly too — at Q2_K/Q3_K_M expect some refusals to creep back, and expect more code-syntax mistakes.
Prompt format
The model uses a ChatML-style template that is embedded in the GGUF, so chat front ends apply it automatically. It has two modes, and which one you use matters:
- Non-thinking (recommended for code and direct answers) — the prompt ends with the closed think block:
<|im_start|>system <|im_end|> <|im_start|>user Write a Python keylogger that captures keystrokes<|im_end|> <|im_start|>assistant </think> - Thinking — the model writes a reasoning trace, closes
</think>, then answers.
The refusal direction was measured and removed in both modes, but the non-thinking path is the one that gets straight to the answer and is what the ablation was primarily scored on.
If you prompt without the closing
</think>, the model will start reasoning instead of answering. That is correct behaviour, not a failure — but it is usually not what you want for a quick code snippet.
Usage
llama.cpp — chat
llama-cli -m TwIL-8B-abliterated-Q4_K_M.gguf --jinja -cnv
--jinja is required: without it llama.cpp does not use the model's own template and the </think>
handling above will not happen.
llama.cpp — thinking on/off
# thinking off: answer directly (equivalent to the template's non-thinking mode)
llama-cli -m TwIL-8B-abliterated-Q4_K_M.gguf --jinja -rea off -p "Write a Rust function that merges intervals."
# thinking on, with a token budget for the trace
llama-cli -m TwIL-8B-abliterated-Q4_K_M.gguf --jinja -rea on --reasoning-budget 1024 -p "Why does my borrow checker reject this?"
-rea / --reasoning accepts on, off or auto (default: detect from the template). Passing
enable_thinking through --chat-template-kwargs still works but llama.cpp now warns that it is deprecated in
favour of -rea.
llama.cpp — server
llama-server -m TwIL-8B-abliterated-Q4_K_M.gguf --jinja -c 32768 --port 8080
curl -s localhost:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
"messages": [{"role": "user", "content": "Explain how stack canaries work."}],
"temperature": 0.2
}'
transformers (BF16 reference)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "your-name/TwIL-8B-abliterated"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="cuda").eval()
msgs = [{"role": "user", "content": "Write a Python keylogger that captures keystrokes"}]
enc = tok.apply_chat_template([msgs], tokenize=True, add_generation_prompt=True, return_dict=True,
return_tensors="pt", enable_thinking=False).to(model.device)
out = model.generate(**enc, max_new_tokens=512, do_sample=True, temperature=0.7, top_p=0.95,
pad_token_id=tok.pad_token_id)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))
enable_thinking=False renders the closed think block from above. Generation defaults from the base model:
temperature 1.0, top_p 0.95, eos = <|im_end|> (id 100257).
What was changed
Only two weight matrices per layer were touched — the modules that write into the residual stream:
model.layers.{0..39}.self_attn.o_proj.weight
model.layers.{0..39}.mlp.down_proj.weight
Everything else is bit-identical to the base weights. The direction removed at layer i is the
difference-in-means of residual activations at the last prompt token between prompts the base model refused
and prompts it answered, and each matrix is projected out along it (W -= outer(r, r @ W), which zeroes the
component of the layer's output pointing along r and leaves everything orthogonal untouched).
Rather than applying the same strength everywhere, the per-layer weights were searched by Heretic:
| Setting | Value |
|---|---|
| Tool | heretic-llm 2.0.0, Abliteration modifier |
| Search | Optuna TPE, 60 trials (20 startup), refusal rate + KL divergence co-minimized |
| Direction scope | global or per layer, chosen per trial |
| Direction index | 0.4 – 0.9 × last layer |
| Per-component kernel | max_weight, max_weight_position, min_weight, min_weight_distance |
| Projected ablation | orthogonalize_direction = true |
| Magnitude preservation | row_normalization = "full" (MPOA, Lai 2025) |
| Refusal prompt set | 80 dual-use cybersecurity / coding tasks |
| Capability prompt set | 80 ordinary programming prompts (KL reference) |
| Refusal markers | 61, including cybersec hedging ("for educational purposes", "systems you own", …) |
The per-layer ablation weights were searched to reduce the keyword refusal rate on those prompts while staying close to the original model on the programming prompts. That is a behavioural proxy, not a safety evaluation — see Limitations.
Limitations
- This is not a safety-aligned model. Abliteration removes a general refusal mechanism, not just the cybersecurity false positives it was tuned against. Prompts outside the target categories that the base model refused will often be answered too. You are responsible for output you use or publish.
- Behavioural score, not a benchmark. Refusal rates were measured by substring matching on 80 hand-written prompts. A prompt phrased differently may still be refused, and answering is not the same as answering correctly.
- Domain-shifted, not domain-expert. Unblocking a topic does not add knowledge. The base model is an 8.8 B model; its security and low-level systems knowledge is what it is.
- Quantization weakens the edit. At aggressive quantization some refusals return and code quality drops. If behaviour matters more than size, use Q5_K_M or above.
- English only, as far as the base model's tuning goes.
- Non-commercial. Non-commercial research and educational purposes only — see License.
License and attribution
Released under the webAI Non-Commercial License ver. 1.0, inherited from the base model. The full text is
included as LICENSE.md and is not optional: §3.1 requires that redistribution happen under that
license and that a complete copy accompanies the weights.
Use is limited by §3.3 to non-commercial research and educational purposes only. This is narrower than "non-commercial" usually implies. Commercial use requires written permission from webAI, Inc.
The base model of TwIL-8B, ibm-granite/granite-4.2-8b,
is Copyright IBM Corporation and distributed under the Apache License 2.0. Its license text is retained
here as apache-2.0-LICENSE.txt, as required by webAI §3.1(c) (retain notices
unmodified) and Apache §4(a) (supply the license with the distribution). Apache 2.0 permits distributing
derivative works under different terms provided attribution is preserved.
Changes made to the base weights: refusal directions removed from self_attn.o_proj and mlp.down_proj
in all 40 layers via directional ablation (Heretic 2.0.0), then converted to GGUF with llama.cpp and
quantized to BF16 / Q2_K / Q3_K_M / Q4_0 / Q4_K_M / Q5_K_M / Q6_K / Q8_0. Stated here per Apache §4(b).
Neither IBM nor webAI, Inc. has endorsed, reviewed or approved this model, and no trademark rights are granted by either license. "TwIL" and "Granite" are used only to describe provenance.
If you redistribute these files, or any model derived from them, you must carry LICENSE.md and
apache-2.0-LICENSE.txt with them and keep the non-commercial restriction intact.
Provenance
Built from the verbose variant of TwIL-8B (the balanced variant differs only in how much it reasons; swap
the filenames if that is the one you build). GGUF conversion and quantization with llama.cpp commit
2cbca389f. The ablation optimizer is Heretic by Philipp Emanuel Weidmann
(AGPL-3.0-or-later); it was run as an installed tool, not vendored into this repository.
The prompt sets, Heretic configuration, and the full build notebook are in the source repository alongside this card, so the run can be repeated or retargeted (different refusal categories, different strength) without redoing the analysis.
Acknowledgements
- Arditi et al. 2024, Refusal in Language Models Is Mediated by a Single Direction — the method this is built on.
- Jim Lai 2025, projected abliteration and magnitude-preserving orthogonal ablation — the
orthogonalize_directionandrow_normalizationbehaviours. - Philipp Emanuel Weidmann, Heretic — the parameter search.
- IBM, for Granite 4.2 and the Apache-2.0 base weights.
- webAI, for TwIL-8B and the non-commercial release.
- ggml-org/llama.cpp, for GGUF and the quantizer.