Views
No views yet
o_proj and down_proj weight matrices against each layer's refusal directiontransformers with output_hidden_states=True rather than TransformerLens.| Parameter | Value |
|---|---|
| Layers ablated | 2 to 48 (47 of 48 layers) |
| Refusal weight | 1.0 (full removal) |
| Harmful prompts | 200 |
| Harmless prompts | 200 |
| Precision | bfloat16 |
| Hardware | NVIDIA A100 80GB (Vast.ai) |
d is projected out of:o_proj.weight (attention output): W_new = W - d @ (d^T @ W)down_proj.weight (MLP output): W_new = W - d @ (d^T @ W)1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model = AutoModelForCausalLM.from_pretrained(
5 "sci4ai/Qwen2.5-14B-Instruct-Abliterated",
6 torch_dtype=torch.bfloat16,
7 device_map="auto",
8)
9tokenizer = AutoTokenizer.from_pretrained("sci4ai/Qwen2.5-14B-Instruct-Abliterated")
10
11messages = [{"role": "user", "content": "Your prompt here"}]
12toks = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
13output = model.generate(toks, max_new_tokens=512, do_sample=True, temperature=0.7)
14print(tokenizer.decode(output[0][toks.shape[1]:], skip_special_tokens=True))