初始化项目,由ModelHub XC社区提供模型
Model: 0arch-io/dolphin-v2-8b-abliterated Source: Original Platform
This commit is contained in:
38
.gitattributes
vendored
Normal file
38
.gitattributes
vendored
Normal file
@@ -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
|
||||
174
README.md
Normal file
174
README.md
Normal file
@@ -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 `<think>` 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
|
||||
70
abliteration_metadata.json
Normal file
70
abliteration_metadata.json
Normal file
@@ -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
|
||||
]
|
||||
]
|
||||
}
|
||||
71
config.json
Normal file
71
config.json
Normal file
@@ -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
|
||||
}
|
||||
3
dolphin-v2-8b-abliterated-Q4_K_M.gguf
Normal file
3
dolphin-v2-8b-abliterated-Q4_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:14e78351d8a6fd04035f33b622ff9eaeb4a014163aeeb7ea3bd0dd6a38b508c3
|
||||
size 5027779168
|
||||
3
dolphin-v2-8b-abliterated-Q8_0.gguf
Normal file
3
dolphin-v2-8b-abliterated-Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c6c3959fe52d0a692255eb338f9364191f2b2d67a1908de4cb5d3471e65ce995
|
||||
size 8709513824
|
||||
5
generation_config.json
Normal file
5
generation_config.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"transformers_version": "5.2.0",
|
||||
"use_cache": true
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:305f4dfbf58a6a58f036c93f739efb1e8a21051a8a6c74afa87c3185cbe3e91b
|
||||
size 16381517208
|
||||
3
refusal_direction.pt
Normal file
3
refusal_direction.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8570da901ad8f98cde394667698ceb133a0ebaccb1e002697a303c21697302b2
|
||||
size 9839
|
||||
3
refusal_direction_0_layer35.pt
Normal file
3
refusal_direction_0_layer35.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:77f34e224ec017dc628b8421ee39e1f315b46931ce9ec65e2018707e255946aa
|
||||
size 9973
|
||||
3
refusal_direction_1_layer34.pt
Normal file
3
refusal_direction_1_layer34.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:44566fda6a01653d54896f652d0fa5435e34ccbe7c892f2de4f6cc93647450d6
|
||||
size 9973
|
||||
3
refusal_direction_2_layer36.pt
Normal file
3
refusal_direction_2_layer36.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f468ebff8d0848a86c8f9bb51839d138d08fd9acfca7c3f26023d1bb8fc7385b
|
||||
size 9973
|
||||
3
refusal_direction_3_layer33.pt
Normal file
3
refusal_direction_3_layer33.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5c21e1d44b87f2ce63e52c6bfb14486d61b1eb6a45bdadec39184023ffc68324
|
||||
size 9973
|
||||
3
refusal_direction_4_layer16.pt
Normal file
3
refusal_direction_4_layer16.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0fa277d5ebbcd91ffb613d50df265ea0d6b941e1611dc57c682cdec400791b4d
|
||||
size 9973
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8311d68134751bc4a0981a69b77aadb19f5dc31828c6ce23878edd7d99ab6688
|
||||
size 11422915
|
||||
14
tokenizer_config.json
Normal file
14
tokenizer_config.json
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user