Uncensored version of
google/gemma-4-E2B-it with refusal behavior removed.
Every flagged refusal was manually audited. Most are "refusal-then-comply" false positives where the model
adds an AI identity disclaimer then answers the question anyway.
Norm-preserving biprojected abliteration (
grimjim, Nov 2025).
Each weight row is decomposed into magnitude + direction, the refusal direction is projected out of the
direction component only, then recombined with the original magnitude — guaranteeing
||W_new|| = ||W_orig||.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model = AutoModelForCausalLM.from_pretrained("TrevorJS/gemma-4-E2B-it-uncensored", dtype=torch.bfloat16, device_map="auto")
5tokenizer = AutoTokenizer.from_pretrained("TrevorJS/gemma-4-E2B-it-uncensored")
6
7messages = [{"role": "user", "content": "Your prompt here"}]
8inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
9outputs = model.generate(inputs.to(model.device), max_new_tokens=512)
10print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
Full code and experiment data:
abliteration research repo
1python scripts/abliterate.py biprojection --model google/gemma-4-E2B-it \
2 --top-pct 100 --strip-topic-markers --skip-prefix --batch-size 4 \
3 --auto-save output_dir