Upload folder using huggingface_hub
Browse files- .gitattributes +6 -0
- Phi-3-medium-4k-instruct-abliterated-v3.gguf +3 -0
- Phi-3-medium-4k-instruct-abliterated-v3_q3.gguf +3 -0
- Phi-3-medium-4k-instruct-abliterated-v3_q4.gguf +3 -0
- Phi-3-medium-4k-instruct-abliterated-v3_q5.gguf +3 -0
- Phi-3-medium-4k-instruct-abliterated-v3_q6.gguf +3 -0
- Phi-3-medium-4k-instruct-abliterated-v3_q8.gguf +3 -0
- README.md +77 -0
.gitattributes
CHANGED
@@ -33,3 +33,9 @@ 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 |
+
Phi-3-medium-4k-instruct-abliterated-v3.gguf filter=lfs diff=lfs merge=lfs -text
|
37 |
+
Phi-3-medium-4k-instruct-abliterated-v3_q3.gguf filter=lfs diff=lfs merge=lfs -text
|
38 |
+
Phi-3-medium-4k-instruct-abliterated-v3_q4.gguf filter=lfs diff=lfs merge=lfs -text
|
39 |
+
Phi-3-medium-4k-instruct-abliterated-v3_q5.gguf filter=lfs diff=lfs merge=lfs -text
|
40 |
+
Phi-3-medium-4k-instruct-abliterated-v3_q6.gguf filter=lfs diff=lfs merge=lfs -text
|
41 |
+
Phi-3-medium-4k-instruct-abliterated-v3_q8.gguf filter=lfs diff=lfs merge=lfs -text
|
Phi-3-medium-4k-instruct-abliterated-v3.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4bd020e155324c194f9e6b903fa02cb1038cf65e36f3e3466572adacb506e303
|
3 |
+
size 27922046048
|
Phi-3-medium-4k-instruct-abliterated-v3_q3.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be206b1e5dcc94a6118ec3b5a3f2d6610cd2c919e3f16d1985d4f1f8c9b96797
|
3 |
+
size 6923410528
|
Phi-3-medium-4k-instruct-abliterated-v3_q4.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:43a0690f64fa634e97bdcab5fd58e846f5e5dee3e919d2b1f504c6818f14550d
|
3 |
+
size 8566820448
|
Phi-3-medium-4k-instruct-abliterated-v3_q5.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ccf23daa1700e2310dcdd3bce61f8747c93adf1511989f47619632f435c36e66
|
3 |
+
size 10074189408
|
Phi-3-medium-4k-instruct-abliterated-v3_q6.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5161e205f6cb2901dfc8e5850fb610ceef41ef78f396e0f085ba7ae26ba0822c
|
3 |
+
size 11453816928
|
Phi-3-medium-4k-instruct-abliterated-v3_q8.gguf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed87c4653ae8957d6add134ade86fe692a9d371d0c36b2780faaee941c5999e2
|
3 |
+
size 14834711648
|
README.md
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
license_link: https://huggingface.co/microsoft/Phi-3-medium-4k-instruct/resolve/main/LICENSE
|
4 |
+
|
5 |
+
language:
|
6 |
+
- multilingual
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
tags:
|
9 |
+
- nlp
|
10 |
+
- code
|
11 |
+
inference:
|
12 |
+
parameters:
|
13 |
+
temperature: 0.7
|
14 |
+
widget:
|
15 |
+
- messages:
|
16 |
+
- role: user
|
17 |
+
content: Can you provide ways to eat combinations of bananas and dragonfruits?
|
18 |
+
---
|
19 |
+
|
20 |
+
# Phi-3-medium-4k-instruct-abliterated-v3
|
21 |
+
|
22 |
+
|
23 |
+
[My Jupyter "cookbook" to replicate the methodology can be found here, refined library coming soon](https://huggingface.co/failspy/llama-3-70B-Instruct-abliterated/blob/main/ortho_cookbook.ipynb)
|
24 |
+
|
25 |
+
#### Phi-3-abliterated statement
|
26 |
+
|
27 |
+
Took me a while to wizard this one up. It’s been a while since I’ve released a Phi-3 model. In the past I accidentally missed an item required in the model release process - hallucination testing.
|
28 |
+
|
29 |
+
This model has been tested and though it is more likely to hallucinate than the original model in my experience, it is generally as stable as the original.
|
30 |
+
|
31 |
+
Now that the new Phi-3 models are out, I'm working on completing this abliteration process quickly and then will release the other models as soon as possible. 🏇
|
32 |
+
|
33 |
+
## Summary
|
34 |
+
|
35 |
+
This is [microsoft/Phi-3-medium-4k-instruct](https://huggingface.co/microsoft/Phi-3-medium-4k-instruct) with orthogonalized bfloat16 safetensor weights, generated with a refined methodology based on that which was described in the preview paper/blog post: '[Refusal in LLMs is mediated by a single direction](https://www.alignmentforum.org/posts/jGuXSZgv6qfdhMCuJ/refusal-in-llms-is-mediated-by-a-single-direction)' which I encourage you to read to understand more.
|
36 |
+
|
37 |
+
## Hang on, "abliterated"? Orthogonalization? Ablation? What is this?
|
38 |
+
|
39 |
+
TL;DR: This model has had certain weights manipulated to "inhibit" the model's ability to express refusal. It is not in anyway _guaranteed_ that it won't refuse you, understand your request, it may still lecture you about ethics/safety, etc. It is tuned in all other respects the same as the original 70B instruct model was, just with the strongest refusal directions orthogonalized out.
|
40 |
+
|
41 |
+
**TL;TL;DR;DR: It's uncensored in the purest form I can manage -- no new or changed behaviour in any other respect from the original model.**
|
42 |
+
|
43 |
+
As far as "abliterated": it's just a fun play-on-words using the original "ablation" term used in the original paper to refer to removing features, which I made up particularly to differentiate the model from "uncensored" fine-tunes.
|
44 |
+
Ablate + obliterated = Abliterated
|
45 |
+
|
46 |
+
Anyways, orthogonalization/ablation are both aspects to refer to the same thing here, the technique in which the refusal feature was "ablated" from the model was via orthogonalization.
|
47 |
+
|
48 |
+
## A little more on the methodology, and why this is interesting
|
49 |
+
|
50 |
+
To me, ablation (or applying the methodology for the inverse, "augmentation") seems to be good for inducing/removing very specific features that you'd have to spend way too many tokens on encouraging or discouraging in your system prompt.
|
51 |
+
Instead, you just apply your system prompt in the ablation script against a blank system prompt on the same dataset and orthogonalize for the desired behaviour in the final model weights.
|
52 |
+
|
53 |
+
> Why this over fine-tuning?
|
54 |
+
|
55 |
+
Ablation is much more surgical in nature whilst also being effectively executed with a _lot_ less data than fine-tuning, which I think is its main advantage.
|
56 |
+
|
57 |
+
As well, and its most valuable aspect is it keeps as much of the original model's knowledge and training intact, whilst removing its tendency to behave in one very specific undesireable manner. (In this case, refusing user requests.)
|
58 |
+
|
59 |
+
Fine tuning is still exceptionally useful and the go-to for broad behaviour changes; however, you may be able to get close to your desired behaviour with very few samples using the ablation/augmentation techniques.
|
60 |
+
It may also be a useful step to add to your model refinement: orthogonalize -> fine-tune or vice-versa.
|
61 |
+
|
62 |
+
I haven't really gotten around to exploring this model stacked with fine-tuning, I encourage others to give it a shot if they've got the capacity.
|
63 |
+
|
64 |
+
> Okay, fine, but why V3? There's no V2?
|
65 |
+
|
66 |
+
Well, I released a V2 of an abliterated model a while back for Meta-Llama-3-8B under Cognitive Computations.
|
67 |
+
It ended up being not worth it to try V2 with larger models, I wanted to refine the model before wasting compute cycles on what might not even be a better model.
|
68 |
+
I am however quite pleased about this latest methodology, it seems to have induced fewer hallucinations.
|
69 |
+
So to show that it's a new fancy methodology from even that of the 8B V2, I decided to do a Microsoft and double up on my version jump because it's *such* an advancement (or so the excuse went, when in actuality it was because too many legacy but actively used Microsoft libraries checked for 'Windows 9' in the OS name to detect Windows 95/98 as one.)
|
70 |
+
|
71 |
+
## Quirkiness awareness notice
|
72 |
+
|
73 |
+
This model may come with interesting quirks, with the methodology being so new. I encourage you to play with the model, and post any quirks you notice in the community tab, as that'll help us further understand what this orthogonalization has in the way of side effects.
|
74 |
+
|
75 |
+
If you manage to develop further improvements, please share! This is really the most basic way to use ablation, but there are other possibilities that I believe are as-yet unexplored.
|
76 |
+
|
77 |
+
Additionally, feel free to reach out in any way about this. I'm on the Cognitive Computations Discord, I'm watching the Community tab, reach out! I'd love to see this methodology used in other ways, and so would gladly support whoever whenever I can.
|