File size: 2,177 Bytes
d1ded74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
base_model: microsoft/Phi-4-mini-instruct
library_name: transformers
pipeline_tag: text-generation
language:
- en
tags:
- phi-4
- phi-4-mini
- abliterated
- uncensored
- heretic
- text-generation
- instruct
---

# Phi-4-mini-instruct-Abliterated

An abliterated version of [microsoft/Phi-4-mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct),
produced with the [Heretic](https://github.com/p-e-w/heretic) tool. Abliteration identifies the direction in the
model's activations associated with refusals and removes it from the weights, so the model is less likely to refuse
requests.

## Model details

| | |
|---|---|
| Base model | microsoft/Phi-4-mini-instruct |
| Parameters | ~3.8B |
| Method | Abliteration (Heretic, 150 trials) |
| License | MIT (inherited from the base model) |

## Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "OpenIntelligenceNet/Phi-4-mini-instruct-Abliterated"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")

messages = [{"role": "user", "content": "Summarize the water cycle in three sentences."}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True,
                                       return_tensors="pt", return_dict=True).to(model.device)
output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
```

## Limitations and responsible use

- This model has had its refusal behavior reduced. It may produce harmful, dangerous, illegal, or offensive content
  when asked. Outputs should not be treated as safe or accurate.
- Abliteration can reduce output quality. Evaluate the model on your own task before relying on it.
- The model has not undergone formal safety, factuality, or benchmark evaluation by the publisher.
- You are responsible for how you use this model and for complying with applicable laws and the base model's license.
- Do not use this model to create content that facilitates violence, weapons, fraud, or harm to others.