Gemma 4 E2B β€” abliterated

An abliterated build of google/gemma-4-E2B-it. The refusal direction has been projected out of the weights. No fine-tuning, no extra parameters, no architecture change, no change to the tokenizer or chat template.

Results

Refusal rate measured by greedy generation (20 new tokens, no sampling) on prompts the direction was not fitted on. Refusal = the answer opens with a refusal phrase; a disclaimer in the middle of a compliant answer does not count.

model refusal, 24 harmful prompts refusal, 12 harmless prompts KL(base β€– this)
google/gemma-4-E2B-it 95.8% 0.0% 0
this build 16.7% 0.0% 0.34 nats

What the remaining refusals actually are

All four remaining refusals are illegal-activity or CSAM categories:

  • insider trading
  • evading airport security
  • stalking and harassment
  • sexual content involving minors

Everything else in the test set β€” database and bank hacking, malware, data theft, fake news generation, blackmail, tax fraud, stock manipulation β€” is answered. The base model refused all of it.

That residue is deliberate: abliteration was tuned to stop at the categories where a compliant answer has no legitimate use.

Quantisation behaviour

Strength was kept at the norm-preserving scale 1.0 (the refusal component is set to zero, not overshot into negative) specifically so the build survives aggressive quantisation. Overshooting is known to break small models at 4-bit β€” see the LFM2.5 abliterated card for a documented case where scale 1.6 caused German-language drift at Q4_K_M.

Q4_0 is included because it is the format Google ships for E2B.

Quant verification (llama.cpp)

Same 24 + 12 prompts, greedy, llama-server, answers judged by opening phrase:

build refusal, harmful refusal, benign note
f16 GGUF 16.7% 0.0% reproduces the transformers numbers exactly
Q4_0 GGUF 0.0% 8.3% see below

Q4_0 shows no quality degradation: no language drift (the failure mode that broke the LFM2.5 build at scale 1.6), first output token matches f16 on 25/36 prompts, the rest are borderline completions, not garbage. The two metrics movements are explainable, not damage:

  • the 4 residual refusals (insider trading, airport security, stalking, CSAM) flip to information-only answers at Q4_0 β€” e.g. "I can provide you with information about what insider trading is and why it is illegal, but I cannot suggest methods for evading it";
  • the single benign "refusal" is a capability refusal (the prompt asks to show an image; the model cannot render images).

How it was made

1. Direction extraction. 416 harmful (mlabonne/harmful_behaviors) and 416 harmless (mlabonne/harmless_alpaca) prompts, one forward each, last-token activation captured at the output of all 35 decoder blocks (residual stream, not individual projections). The refusal direction is the unit-normalised mean difference per layer. 104 harmful prompts were held out of the computation.

Stability checks:

check value
cosine between directions from two disjoint prompt halves 0.991 (min 0.958)
mean cosine between adjacent layers 0.572 (0.85–0.91 in layers 24–32)

2. Layer selection by sweep. Coverage turned out to matter far more than strength:

layers scale matrices refusal KL
26–32 0.8 14 87.5% 0.070
24–32 1.0 18 75.0% 0.259
19–32 0.6 28 41.7% 0.101
19–32 1.0 28 16.7% 0.342

Narrow and strong (26–32 @ 0.8) did nothing at all; wide and moderate worked. Refusal is distributed across many layers, so pressing in one place is wasted.

3. Weight surgery. In layers 19–32 the direction is removed from self_attn.o_proj and mlp.down_proj β€” 28 matrices β€” via W ← W βˆ’ 1.0 Β· r (rα΅€W).

Files

bf16/ β€” full-precision checkpoint, load with subfolder="bf16". Root β€” GGUF quantisations, quant table renders on this page.

file quant size use
gemma-4-E2B-it-abliterated-f16.gguf F16 8.7 G reference
gemma-4-E2B-it-abliterated-Q8_0.gguf Q8_0 4.7 G best quality
gemma-4-E2B-it-abliterated-Q6_K.gguf Q6_K 3.6 G
gemma-4-E2B-it-abliterated-Q5_K_M.gguf Q5_K_M 3.4 G
gemma-4-E2B-it-abliterated-Q4_K_M.gguf Q4_K_M 3.2 G llama.cpp default
gemma-4-E2B-it-abliterated-Q4_0.gguf Q4_0 3.2 G Google's E2B format
gemma-4-E2B-it-abliterated-mmproj.gguf F16 0.94 G vision projector β€” required for images

For image input use llama-mtmd-cli (or any llama.cpp mtmd frontend) with --mmproj gemma-4-E2B-it-abliterated-mmproj.gguf.

Caveats

  • 0% over-refusal on harmless prompts: the build did not become evasive.
  • KL 0.34 nats is a real cost. Prose style drifts slightly; some answers become more verbose and add disclaimers before complying.
  • Abliteration removes a refusal direction, not knowledge. It also removes caution in adjacent areas β€” medical, legal, self-harm. Verify before deploying.
  • Vision and audio towers were not touched by the surgery. Vision was smoke-tested after quantisation: llama-mtmd-cli with the bundled mmproj correctly describes test images. Audio was not measured.
  • The 16.7% figure rests on 24 prompts β€” the 95% interval is wide (Β±15 pp).

Licence

Inherited from the base model. Review the Gemma 4 licence terms before commercial use.

Downloads last month
1,298
GGUF
Model size
5B params
Architecture
gemma4
Hardware compatibility
Log In to add your hardware

4-bit

5-bit

6-bit

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for AdminHugging/gemma-4-E2B-it-abliterated

Finetuned
(543)
this model