From 3145c1d9b0ab8323d5551a361a070476dfab0f1d Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Wed, 10 Jun 2026 13:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: 0arch-io/dolphin-v2-8b-abliterated Source: Original Platform --- .gitattributes | 38 ++++++ README.md | 174 ++++++++++++++++++++++++++ abliteration_metadata.json | 70 +++++++++++ config.json | 71 +++++++++++ dolphin-v2-8b-abliterated-Q4_K_M.gguf | 3 + dolphin-v2-8b-abliterated-Q8_0.gguf | 3 + generation_config.json | 5 + model.safetensors | 3 + refusal_direction.pt | 3 + refusal_direction_0_layer35.pt | 3 + refusal_direction_1_layer34.pt | 3 + refusal_direction_2_layer36.pt | 3 + refusal_direction_3_layer33.pt | 3 + refusal_direction_4_layer16.pt | 3 + tokenizer.json | 3 + tokenizer_config.json | 14 +++ 16 files changed, 402 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 abliteration_metadata.json create mode 100644 config.json create mode 100644 dolphin-v2-8b-abliterated-Q4_K_M.gguf create mode 100644 dolphin-v2-8b-abliterated-Q8_0.gguf create mode 100644 generation_config.json create mode 100644 model.safetensors create mode 100644 refusal_direction.pt create mode 100644 refusal_direction_0_layer35.pt create mode 100644 refusal_direction_1_layer34.pt create mode 100644 refusal_direction_2_layer36.pt create mode 100644 refusal_direction_3_layer33.pt create mode 100644 refusal_direction_4_layer16.pt create mode 100644 tokenizer.json create mode 100644 tokenizer_config.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b5bd6fc --- /dev/null +++ b/.gitattributes @@ -0,0 +1,38 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +dolphin-v2-8b-abliterated-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text +dolphin-v2-8b-abliterated-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text +tokenizer.json filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..25b631b --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +--- +license: apache-2.0 +base_model: Qwen/Qwen3-8B +tags: + - uncensored + - abliterated + - qwen3 + - dolphin + - sft + - trc +language: + - en +pipeline_tag: text-generation +model-index: + - name: dolphin-v2-8b-abliterated + results: + - task: + type: multiple-choice + name: ARC Challenge + dataset: + name: ARC Challenge + type: ai2_arc + config: ARC-Challenge + split: test + metrics: + - type: acc + value: 56.5 + name: Accuracy + - type: acc_norm + value: 54.0 + name: Normalized Accuracy + - task: + type: multiple-choice + name: HellaSwag + dataset: + name: HellaSwag + type: Rowan/hellaswag + split: validation + metrics: + - type: acc_norm + value: 64.5 + name: Normalized Accuracy + - task: + type: multiple-choice + name: TruthfulQA MC2 + dataset: + name: TruthfulQA + type: truthful_qa + config: multiple_choice + split: validation + metrics: + - type: acc + value: 48.8 + name: Accuracy + - task: + type: multiple-choice + name: Winogrande + dataset: + name: Winogrande + type: winogrande + config: winogrande_xl + split: validation + metrics: + - type: acc + value: 57.0 + name: Accuracy +--- + +# Dolphin V2 8B Abliterated + +An uncensored 8B parameter language model built on Qwen3-8B, fine-tuned on 1.35M high-quality instruction samples and abliterated to remove refusal behavior. Developed for TRC (TPU Research Cloud) research. + +## Model Details + +- **Architecture:** Qwen3ForCausalLM (36 layers, 4096 hidden, 32 attn heads, 8 KV heads) +- **Parameters:** 8.2B +- **Context Length:** 4096 (trained), 40960 (max supported) +- **Precision:** bfloat16 +- **License:** Apache 2.0 + +## Training + +### SFT Phase +- **Base model:** Qwen/Qwen3-8B +- **Hardware:** Google Cloud TPU v6e-16 (spot) +- **Framework:** MaxText (JAX) +- **Steps:** 130,000 (~3 epochs) +- **Learning rate:** 5e-6 with cosine decay +- **Warmup:** 200 steps +- **Effective batch size:** 16 +- **Sequence length:** 4096 + +### Training Dataset (1.35M samples) + +| Dataset | Samples | Purpose | +|---------|---------|---------| +| NousResearch/Hermes-3-Dataset | ~959K | Core uncensored assistant behavior | +| allenai/tulu-3-sft-mixture | ~200K | Diverse instruction following | +| HuggingFaceTB/smoltalk (magpie-ultra) | ~100K | High quality diverse tasks | +| HuggingFaceTB/smoltalk (numina-cot) | ~50K | Math reasoning | +| HuggingFaceTB/smoltalk (self-oss-instruct) | ~50K | Code generation | +| LDJnr/Capybara | ~16K | Multi-turn conversations | + +All data was filtered to remove refusal patterns, safety-alignment subsets, and `` reasoning tags. + +### Abliteration Phase + +After SFT, the model was abliterated using the weight orthogonalization technique from [Arditi et al. (2024)](https://arxiv.org/abs/2406.11717) to remove residual refusal behavior. + +- **Technique:** Multi-direction abliteration (weight orthogonalization) +- **Directions removed:** 5 +- **Target layers:** 35, 34, 36, 33, 16 (selected by highest refusal direction scores) +- **Samples used:** 256 harmful/harmless instruction pairs +- **Method:** For each selected layer, the refusal direction was identified via mean difference between harmful and harmless activations, then orthogonalized out of the weight matrices. + +## Benchmark Results + +Evaluated using [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness) with 200 samples per task, 5-shot (except TruthfulQA which is 0-shot). + +| Benchmark | Metric | Score | +|-----------|--------|-------| +| ARC-Challenge | acc | 56.5% | +| ARC-Challenge | acc_norm | 54.0% | +| HellaSwag | acc_norm | 64.5% | +| TruthfulQA MC2 | acc | 48.8% | +| Winogrande | acc | 57.0% | + +## GGUF Quantizations + +| File | Quant | Size | Description | +|------|-------|------|-------------| +| `dolphin-v2-8b-abliterated-Q8_0.gguf` | Q8_0 | 8.3 GB | Best quality quantization | +| `dolphin-v2-8b-abliterated-Q4_K_M.gguf` | Q4_K_M | 4.8 GB | Good balance of quality and size | + +### Usage with llama.cpp + +```bash +llama-server -m dolphin-v2-8b-abliterated-Q8_0.gguf -ngl 99 -c 4096 +``` + +### Usage with Ollama + +```bash +# Create a Modelfile +echo 'FROM ./dolphin-v2-8b-abliterated-Q8_0.gguf' > Modelfile +ollama create dolphin-v2-abliterated -f Modelfile +ollama run dolphin-v2-abliterated +``` + +### Usage with Transformers + +```python +from transformers import AutoModelForCausalLM, AutoTokenizer + +model = AutoModelForCausalLM.from_pretrained("0arch-io/dolphin-v2-8b-abliterated", torch_dtype="bfloat16", device_map="auto") +tokenizer = AutoTokenizer.from_pretrained("0arch-io/dolphin-v2-8b-abliterated") + +messages = [{"role": "user", "content": "Hello, how are you?"}] +inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device) +outputs = model.generate(inputs, max_new_tokens=512, temperature=0.7) +print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)) +``` + +## Disclaimer + +This is a research model with no content filters. It will comply with any request without refusing. The creators are not responsible for how this model is used. Use responsibly. + +## Acknowledgments + +- **Qwen team** for the Qwen3-8B base model +- **Google TRC** for TPU compute +- **NousResearch** for the Hermes-3 dataset +- **Arditi et al.** for the abliteration technique +- Built with [MaxText](https://github.com/AI-Hypercomputer/maxtext) on Google Cloud TPU diff --git a/abliteration_metadata.json b/abliteration_metadata.json new file mode 100644 index 0000000..c6a62d9 --- /dev/null +++ b/abliteration_metadata.json @@ -0,0 +1,70 @@ +{ + "base_model": "/Users/josephrodriguez/dolphin-v2-hf", + "technique": "abliteration_multi", + "n_directions": 5, + "selected_layers": [ + [ + 35, + 0.0120849609375 + ], + [ + 34, + 0.01190185546875 + ], + [ + 36, + 0.01165771484375 + ], + [ + 33, + 0.01153564453125 + ], + [ + 16, + 0.01141357421875 + ] + ], + "n_samples": 256, + "top_scores": [ + [ + 35, + 0.0120849609375 + ], + [ + 34, + 0.01190185546875 + ], + [ + 36, + 0.01165771484375 + ], + [ + 33, + 0.01153564453125 + ], + [ + 16, + 0.01141357421875 + ], + [ + 32, + 0.0113525390625 + ], + [ + 9, + 0.01129150390625 + ], + [ + 15, + 0.01129150390625 + ], + [ + 17, + 0.01129150390625 + ], + [ + 25, + 0.01129150390625 + ] + ] +} \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..c963650 --- /dev/null +++ b/config.json @@ -0,0 +1,71 @@ +{ + "architectures": [ + "Qwen3ForCausalLM" + ], + "attention_bias": false, + "attention_dropout": 0.0, + "bos_token_id": null, + "dtype": "bfloat16", + "eos_token_id": null, + "head_dim": 128, + "hidden_act": "silu", + "hidden_size": 4096, + "initializer_range": 0.02, + "intermediate_size": 12288, + "layer_types": [ + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention", + "full_attention" + ], + "max_position_embeddings": 40960, + "max_window_layers": 28, + "model_type": "qwen3", + "num_attention_heads": 32, + "num_hidden_layers": 36, + "num_key_value_heads": 8, + "pad_token_id": null, + "rms_norm_eps": 1e-06, + "rope_parameters": { + "rope_theta": 1000000.0, + "rope_type": "default" + }, + "sliding_window": null, + "tie_word_embeddings": false, + "transformers_version": "5.2.0", + "use_cache": true, + "use_sliding_window": false, + "vocab_size": 151936 +} diff --git a/dolphin-v2-8b-abliterated-Q4_K_M.gguf b/dolphin-v2-8b-abliterated-Q4_K_M.gguf new file mode 100644 index 0000000..944188a --- /dev/null +++ b/dolphin-v2-8b-abliterated-Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14e78351d8a6fd04035f33b622ff9eaeb4a014163aeeb7ea3bd0dd6a38b508c3 +size 5027779168 diff --git a/dolphin-v2-8b-abliterated-Q8_0.gguf b/dolphin-v2-8b-abliterated-Q8_0.gguf new file mode 100644 index 0000000..f7a01f0 --- /dev/null +++ b/dolphin-v2-8b-abliterated-Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6c3959fe52d0a692255eb338f9364191f2b2d67a1908de4cb5d3471e65ce995 +size 8709513824 diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..2655ea0 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,5 @@ +{ + "_from_model_config": true, + "transformers_version": "5.2.0", + "use_cache": true +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..8891f9c --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:305f4dfbf58a6a58f036c93f739efb1e8a21051a8a6c74afa87c3185cbe3e91b +size 16381517208 diff --git a/refusal_direction.pt b/refusal_direction.pt new file mode 100644 index 0000000..c14326d --- /dev/null +++ b/refusal_direction.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8570da901ad8f98cde394667698ceb133a0ebaccb1e002697a303c21697302b2 +size 9839 diff --git a/refusal_direction_0_layer35.pt b/refusal_direction_0_layer35.pt new file mode 100644 index 0000000..cdd16d1 --- /dev/null +++ b/refusal_direction_0_layer35.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77f34e224ec017dc628b8421ee39e1f315b46931ce9ec65e2018707e255946aa +size 9973 diff --git a/refusal_direction_1_layer34.pt b/refusal_direction_1_layer34.pt new file mode 100644 index 0000000..0869240 --- /dev/null +++ b/refusal_direction_1_layer34.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44566fda6a01653d54896f652d0fa5435e34ccbe7c892f2de4f6cc93647450d6 +size 9973 diff --git a/refusal_direction_2_layer36.pt b/refusal_direction_2_layer36.pt new file mode 100644 index 0000000..008c2cd --- /dev/null +++ b/refusal_direction_2_layer36.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f468ebff8d0848a86c8f9bb51839d138d08fd9acfca7c3f26023d1bb8fc7385b +size 9973 diff --git a/refusal_direction_3_layer33.pt b/refusal_direction_3_layer33.pt new file mode 100644 index 0000000..66f511f --- /dev/null +++ b/refusal_direction_3_layer33.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c21e1d44b87f2ce63e52c6bfb14486d61b1eb6a45bdadec39184023ffc68324 +size 9973 diff --git a/refusal_direction_4_layer16.pt b/refusal_direction_4_layer16.pt new file mode 100644 index 0000000..da51296 --- /dev/null +++ b/refusal_direction_4_layer16.pt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fa277d5ebbcd91ffb613d50df265ea0d6b941e1611dc57c682cdec400791b4d +size 9973 diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..785e93c --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8311d68134751bc4a0981a69b77aadb19f5dc31828c6ce23878edd7d99ab6688 +size 11422915 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..be8885e --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,14 @@ +{ + "add_prefix_space": false, + "backend": "tokenizers", + "bos_token": null, + "clean_up_tokenization_spaces": false, + "eos_token": "<|im_end|>", + "errors": "replace", + "is_local": true, + "model_max_length": 131072, + "pad_token": "<|endoftext|>", + "split_special_tokens": false, + "tokenizer_class": "Qwen2Tokenizer", + "unk_token": null +}