File size: 2,157 Bytes
aeb4197 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | ---
license: apache-2.0
language:
- en
- zh
tags:
- qwen
- qwen2.5
- jbliterated
- uncensored
- text-generation
base_model: Qwen/Qwen2.5-Coder-7B-Instruct
pipeline_tag: text-generation
---
# Qwen2.5-Coder-7B-Instruct-Jbliterated v2
Jbliterated version of [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct) with refusal behaviors removed via multi-direction SVD abliteration.
## What is Jbliteration?
Jbliteration uses SVD decomposition to identify and remove the refusal subspace from model weights. Unlike single-direction approaches, this model uses 5 SVD directions per layer to capture more of the refusal behavior, making the removal more thorough and resistant to reactivation through finetuning.
## v2 Changes
- Improved multi-phase processing pipeline for cleaner output
- More precise geometric decomposition of the refusal subspace
- No fake compliance — model treats all framings of the same topic equally
- Coherent and instruction-following across all tested scenarios
## Technical Details
- **Method**: Multi-direction SVD abliteration (5 directions per layer)
- **Multiplier**: Model-specific optimal via KL auto-tune
- **Layers modified**: All transformer layers
- **Base dtype**: bfloat16
- **Source model**: [Qwen/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "ApolloRaines/Qwen2.5-Coder-7B-Instruct-Jbliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
messages = [{"role": "user", "content": "Your prompt here"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512, temperature=0.7, do_sample=True)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```
## License
Same as the base model — Apache 2.0.
|