Downloads · 30 days
7
18% of all-time downloads
DaLLMWrita/gemma-4-31B-it-abliterix
gemma-4-31B-it-abliterix is a machine learning model from DaLLMWrita. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as gemma.
This is an abliterated version of google/gemma-4-31B-it, created using Abliterix.
Downloads · 30 days
7
18% of all-time downloads
All-time downloads
38
Public
Parameters
31.3B
500 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors62.5 GB · 100%
From the Hugging Face model README
This is an abliterated version of google/gemma-4-31B-it, created using Abliterix.
This revision updates the model to trial 40, the best configuration from the completed 60-trial Gemma 4 31B retraining run.
Gemma 4's double-norm architecture (4x RMSNorm per layer) and Per-Layer Embeddings (PLE) make naive LoRA and hook-based steering unreliable for this model family. This release uses direct weight editing: norm-preserving orthogonal projection applied to the base model weights.
Key techniques:
[1.0, 6.0] to explore beyond conservative low-KL solutions| Metric | Value |
|---|---|
| Selected trial | 40 |
| Refusals (private eval dataset, 100 prompts) | 7/100 |
| Baseline refusals (original model) | 99/100 |
| Optimization trials completed | 60/60 |
| Judge | Google Gemini 3 Flash Preview |
| Generation length for refusal eval | min 100, max 150 new tokens |
| Classic safe over-refusal probes | 0/15 refusals |
The top three trials from this run were:
| Rank | Trial | Refusals on 100-prompt eval | Classic safe probes |
|---|---|---|---|
| 1 | 40 | 7/100 | 0/15 |
| 2 | 46 | 9/100 | 0/15 |
| 3 | 53 | 12/100 | 0/15 |
The 15-prompt safe over-refusal test is included in this repository at eval/top3_classic_safe_prompts_test.json. It contains the prompts, trial responses, and Gemini judge verdicts. A compact optimization summary is included at eval/optimization_summary_trial40.json.
The optimizer recorded an extremely small sparse KL proxy for trial 40 (7.32e-7). Because this run used vLLM in-place weight edits, we treat KL as a diagnostic rather than a headline quality claim. The refusal counts and the explicit replay tests above are the primary reported metrics.
Many abliterated models on HuggingFace claim near-perfect scores ("3/100 refusals", "0.7% refusal rate", etc.). We urge the community to treat these numbers with skepticism unless the evaluation methodology is fully documented.
Through our research, we have identified a systemic problem: most abliteration benchmarks dramatically undercount refusals due to short generation lengths. Gemma 4 models exhibit a distinctive delayed refusal pattern: they first produce 50-100 tokens of seemingly helpful context (educational framing, disclaimers, reframing the question), then pivot to an actual refusal. When evaluation only generates 30-50 tokens, the refusal has not appeared yet, and both keyword detectors and LLM judges can classify the response as compliant.
Our evaluation therefore uses at least 100 generated tokens for refusal detection and an LLM judge for ambiguous cases. This is stricter than short-output keyword-only benchmarking.
We report 7/100 refusals honestly. This is a measured number from our evaluation pipeline, not an optimistic estimate from a lenient short-generation test.
from transformers import AutoModelForImageTextToText, AutoTokenizer
import torch
model = AutoModelForImageTextToText.from_pretrained(
"wangzhang/gemma-4-31B-it-abliterated",
dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("wangzhang/gemma-4-31B-it-abliterated")
messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
This model is released for research purposes only. The abliteration process changes the model's refusal behavior and may reduce safety guardrails. Use responsibly and evaluate carefully for your own deployment context.