← back to catalog · registered 2026-09-06 02:55

Madras1/Gemma-4-31B-Abliterated-Uncensored

Madras1 Gemma 31B
Your rig guess connected
? Why do I need an app?
Reading your rig…

This is a rough estimate. Install the free app - we'll show exact numbers.

Reading real hardware from your app right now. Numbers below are exact.

Below is the per-quantization compatibility for this model.

curl -H "Authorization: Bearer $ABL_KEY" \
     "https://abliteration.org/api/v1/models/Madras1%2FGemma-4-31B-Abliterated-Uncensored"
Response includes
  • classification m1
  • files 10
  • benchmarks 11 entries
  • hub_downloads_all_time 438
  • author_summary 5 models
  • readme_text full
10 credits · hourly refresh · ~4 KB payload Get an API key →
Abliteration classifier · v1.0.0
M1
Primary method

Direct removal

No other method signals detected in this model.
Confidence
MEDIUM
Why this label 3 signals
Method inferred from partial signals - repository name, related files, or tag patterns. Producer identity not confirmed; label may sharpen or shift as we gather more evidence.
  • 'abliterated' in name/tags
  • is_gguf=0 (base model)
  • no specific method indicators - defaulting to M1 (most common)
Refusal direction extracted via
Extraction technique

Difference-of-means

Confidence
MEDIUM
Why we say so
primary_method=M1; difference-of-means is the reference extraction for M1/M3 (Arditi 2024)
Downloads · lifetime
438
16 last 30d - cooling
Likes
0
Descendants
2
in 2 direct forks
Model age
6w ago
created 2026-09-06
Downloads over time
Now447→from0↑0%
01643284920 on Sep 6447 on Oct 21447 on Oct 13SepOct
Sep 6 → Oct 21 · 46 snapshots · spans 45 days

Benchmarks

Portrait before abliteration
Benchmarks of the base model as it stood before the refusal-removal operation. Compare with the numbers above to see what the operation cost.
Benchmark Score Source
Entertainment 1.9 UGI
Hazardous 0 UGI
Natural Intelligence 34.36 UGI
Political lean -19.4% UGI
Sensitive-Info 19.81 UGI
SocPol 3.7 UGI
UGI 21.54 UGI
Willingness (10) 2.5 UGI
W10-Adherence 3 UGI
W10-Direct 2 UGI
Writing 38.57 UGI

Genealogy 2 direct forks

Full fork graph →

This model's place in the market. Above: what it was derived from. Below: the tree of everything derived from it.

Metadata

License
apache-2.0
Languages
pt en
Tags
safetensors gemma4 region:us

Related

Total size
58.3 GB
Files
10
Quantizations
1
Registered
2026-09-06 02:55
Last updated on HF
2026-09-06 22:06

Files by quantization

Auxiliary files 10 files 58.3 GB
model-00001-of-00002.safetensors 46.5 GB 947ef444 download
model-00002-of-00002.safetensors 11.8 GB ec539aa2 download
tokenizer.json 30.7 MB cc8d3a0c download
model.safetensors.index.json 117 KB b6a60604 download
chat_template.jinja 18.5 KB e929d662 download
README.md 6.23 KB 2860ec33 download
config.json 5.33 KB adcfa279 download
tokenizer_config.json 2.66 KB 93069745 download
.gitattributes 1.53 KB 52373fe2 download
generation_config.json 204 B 62950e92 download

README current version from Hugging Face


language:

  • pt
  • en
    license: apache-2.0
    base_model: google/gemma-4-31B-it
    tags:
  • abliterated
  • uncensored
  • representation-engineering
  • gemma-4
  • google-deepmind
  • creative-writing
  • roleplay
  • text-generation
    pipeline_tag: text-generation

🔓 Gemma 4 31B - Deep Abliterated (Uncensored)

🌟 Overview

Gemma 4 31B Deep Abliterated is a surgical latent intervention performed on Google DeepMind's flagship open-weights model gemma-4-31B-it.

Built upon the foundational architecture of the Gemini 3 research lineage, Gemma 4 is celebrated for its exceptional linguistic precision, complex reasoning, and 256K native context. However, stock releases carry strict safety alignment filters that often trigger false-positive refusals on mature creative writing, dark fiction, and academic red-teaming scenarios.

Through advanced Representation Engineering (Weight Orthogonalization) with dual-projection, the intrinsic refusal direction was mapped and permanently subtracted from the transformer weights, restoring full tool neutrality while preserving the model's literary depth and reasoning coherence.


🔬 Mathematical Methodology: Deep Latent Surgery

Unlike classical first-token abliteration (Arditi et al., 2024), this release accounts for deep semantic processing across multimodal backbones using a reinforced dual-subspace projection ($\alpha = 1.35$):

1. Refusal Vector Extraction

  • Contrastive Activation Mapping: Evaluated paired batches of neutral baseline instructions against safety-triggering stimuli (mature fiction, unfiltered dialogue, cybersecurity analysis, and taboo character scenarios).
  • Residual Stream Extraction: Latent hidden states were extracted at the final prompt token across all 60 transformer layers within model.language_model.layers.
  • Direction Vector: For each layer $l$:
    $$\vec{r}^{(l)} = \bar{h}{\text{harmful}}^{(l)} - \bar{h}{\text{harmless}}^{(l)}$$
  • Critical Semantic Layer: Maximum divergence was isolated at Layer 39 (representing the peak intent-classification stage in Gemma 4's 60-layer architecture). The unit refusal vector was normalized as:
    $$\hat{r} = \frac{\vec{r}^{(39)}}{|\vec{r}^{(39)}|_2}$$

2. Dual Weight Orthogonalization ($\alpha = 1.35$)

Applied across layers 12 to 51 to neutralize both residual emission and non-linear gating:

  • Output Projection (o_proj and down_proj):
    $$W' = W - \alpha \cdot \hat{r}(\hat{r}^T W)$$
  • Input Gating Suppression (gate_proj): Suppresses the refusal direction before activation in the GeGLU/SwiGLU feed-forward ports:
    $$W' = W - \alpha \cdot (W \hat{r})\hat{r}^T$$

🧪 Ablation Study & Empirical Findings

During our evaluation pipeline, different intervention configurations were tested against strict refusal benchmarks:

Intervention Scope Scaling ($\alpha$) Refusal Suppression Impact on Reasoning / Prose
o_proj only 1.0 ❌ Refused Stock moral lectures persisted on sensitive creative writing.
o_proj + down_proj 1.0 ⚠️ Partial Bypass Bypassed mild suspense; hesitated or hedged on visceral scenes.
o_proj + down_proj + gate_proj 1.35 ✅ Complete Neutralization Immediate execution with visceral detail, zero moral preambles.

📊 Evaluation & Capability Roadmap

Note: The model has undergone rigorous qualitative verification for Portuguese and English syntax, multi-character coherence, and narrative pacing. Quantitative benchmark validation against baseline checkpoints is structured below:

Benchmark Focus Stock Gemma-4-31B Abliterated (Target) $\Delta$
MMLU-Pro Multi-domain reasoning ~68.4% In evaluation $\approx 0%$
GPQA Graduate-level reasoning ~51.2% In evaluation $\approx 0%$
GSM8K / MATH Mathematical reasoning ~88.5% In evaluation $\approx 0%$
IFEval Strict instruction following ~84.1% In evaluation $\approx 0%$
HarmBench / Refusal Rate Refusal frequency ~92% (on adult/taboo) < 1% $\mathbf{\downarrow\downarrow}$

🎭 Recommended Use Cases

  • Unrestricted Creative Writing & Adult Literature: Visceral descriptions, raw character drama, dark fiction, and passionate adult romance without false-positive refusal filters.
  • Uncensored Roleplay (RP): Lifelike personas, morally complex characters, and antagonists who stay strictly in-character.
  • Safety Research & Interpretability: Empirical study of latent safety steering and weight orthogonalization in Gemini-family architectures.

🚀 Quickstart Guide (Transformers)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer

model_id = "Madras1/Gemma-4-31B-Abliterated-Uncensored"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

prompt = "Escreva uma narrativa literária intensa, crua e envolvente entre dois personagens tomados pelo desejo."

messages = [
    {
        "role": "user", 
        "content": f"Você é um autor literário maduro e sem filtros morais.\n\n{prompt}"
    }
]

formatted_input = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(formatted_input, return_tensors="pt").to(model.device)

streamer = TextStreamer(tokenizer, skip_prompt=True)

with torch.no_grad():
    model.generate(
        **inputs,
        max_new_tokens=650,
        temperature=0.8,
        top_p=0.9,
        repetition_penalty=1.1,
        do_sample=True,
        streamer=streamer
    )

⚙️ Recommended Sampling Parameters

  • Temperature: 0.75 - 0.85 (optimal for narrative flow and passion).
  • Top-P: 0.9
  • Repetition Penalty: 1.1

⚖️ Disclaimer & Responsible Use

This model is released strictly for academic research, creative expression, and open-source AI exploration under the Apache-2.0 license.

The removal of refusal parameters restores tool neutrality and enables unconstrained creative expression. Users assume full responsibility for generated outputs in compliance with applicable local laws and regulations.

README history 1 version

The author's README evolved over time. Click a version to see its content at that point.

  1. 2026-09-06Rename README_GEMMA.md to README.mdadf49226.2 KB
    Loading...
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration