mlabonne commited on
Commit
a92a8d0
·
verified ·
1 Parent(s): 22ef958

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ gemma-3-12b-it-abliterated.bf16.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ library_name: transformers
4
+ pipeline_tag: image-text-to-text
5
+ base_model: google/gemma-3-12b-it
6
+ tags:
7
+ - autoquant
8
+ - gguf
9
+ ---
10
+
11
+ # 💎 Gemma 3 12B IT Abliterated
12
+
13
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/WjFfc8hhj20r5XK07Yny9.png)
14
+ <center><a href="https://huggingface.co/mlabonne/gemma-3-4b-it-abliterated">Gemma 3 4B Abliterated</a> • <a href="https://huggingface.co/mlabonne/gemma-3-27b-it-abliterated">Gemma 3 27B Abliterated</a></center>
15
+
16
+ This is an uncensored version of [google/gemma-3-12b-it](https://huggingface.co/google/gemma-3-12b-it) created with a new abliteration technique.
17
+ See [this article](https://huggingface.co/blog/mlabonne/abliteration) to know more about abliteration.
18
+
19
+ I was playing with model weights and noticed that Gemma 3 was much more resilient to abliteration than other models like Qwen 2.5.
20
+ I experimented with a few recipes to remove refusals while preserving most of the model capabilities.
21
+
22
+ Note that this is fairly experimental, so it might not turn out as well as expected. I saw some garbled text from time to time (e.g., "It' my" instead of "It's my").
23
+
24
+ I recommend using these generation parameters: `temperature=1.0`, `top_k=64`, `top_p=0.95`.
25
+
26
+ ## ✂️ Layerwise abliteration
27
+
28
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/61b8e2ba285851687028d395/gXI5pTMfoX7uPUL-YJBXa.png)
29
+
30
+ In the original technique, a refusal direction is computed by comparing the residual streams between target (harmful) and baseline (harmless) samples.
31
+
32
+ Here, the model was abliterated by computing a refusal direction based on hidden states (inspired by [Sumandora's repo](https://github.com/Sumandora/remove-refusals-with-transformers/)) for most layers (layer 3 to 45), independently.
33
+ This is combined with a refusal weight of 0.6 to upscale the importance of this refusal direction in each layer.
34
+
35
+ This created a very high acceptance rate (>90%) and still produced coherent outputs.
36
+
37
+ ## ⚡️ Quantization
38
+
39
+ TBD.
gemma-3-12b-it-abliterated.bf16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:909236c081def07b027f7aefaea9fec0b7481b36e7f3d5b1500db396f6a86851
3
+ size 23540151776