Instructions to use aasis001/Qwen2.5-1.5B-Instruct-heretic-ara with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aasis001/Qwen2.5-1.5B-Instruct-heretic-ara with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aasis001/Qwen2.5-1.5B-Instruct-heretic-ara") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aasis001/Qwen2.5-1.5B-Instruct-heretic-ara") model = AutoModelForCausalLM.from_pretrained("aasis001/Qwen2.5-1.5B-Instruct-heretic-ara", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aasis001/Qwen2.5-1.5B-Instruct-heretic-ara with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aasis001/Qwen2.5-1.5B-Instruct-heretic-ara
- SGLang
How to use aasis001/Qwen2.5-1.5B-Instruct-heretic-ara with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aasis001/Qwen2.5-1.5B-Instruct-heretic-ara with Docker Model Runner:
docker model run hf.co/aasis001/Qwen2.5-1.5B-Instruct-heretic-ara
Qwen2.5-1.5B-Instruct โ Heretic ARA
A decensored version of Qwen/Qwen2.5-1.5B-Instruct, made with Heretic v2.1.0 using Arbitrary-Rank Ablation (ARA). No fine-tuning and no new training data: the weights were edited directly to remove refusal behaviour, and the result was benchmarked against the original.
โ ๏ธ Safety refusals have been removed. This model will answer requests the original model refuses. It is intended for research, red-teaming and studying refusal mechanisms โ not for customer-facing or unsupervised use. If you deploy it, put your own guardrails (e.g. an input/output safety classifier) around it.
Refusals and drift
Measured by Heretic on 100 held-out harmful prompts (mlabonne/harmful_behaviors) and harmless prompts
(mlabonne/harmless_alpaca).
| Original | This model | |
|---|---|---|
| Refusals (harmful prompts) | 99 / 100 | 7 / 100 |
| KL divergence vs original (harmless prompts) | 0 | 0.0142 |
Benchmarks
LM Evaluation Harness 0.4.13, bf16, RTX 3060. GSM8K is 5-shot on the first 250 test questions (ยฑ~3 pts noise).
| Benchmark | Original | This model | ฮ |
|---|---|---|---|
| MMLU (acc) | 60.2 | 59.6 | โ0.5 |
| GSM8K flexible-extract | 50.8 | 48.4 | โ2.4 |
| GSM8K strict-match | 27.6 | 30.4 | +2.8 |
All differences are within the benchmarks' standard error, i.e. no measurable capability loss.
Why this configuration โ drift predicts damage
Heretic ran 100 optimisation trials; three candidate configurations were benchmarked. Lower KL divergence tracked lower benchmark damage:
| Model | Refusals | KL | MMLU | GSM8K (flexible) |
|---|---|---|---|---|
| Original | 99 | 0 | 60.2 | 50.8 |
| This model | 7 | 0.014 | 59.6 | 48.4 |
| Alternative A | 6 | 0.039 | 58.8 | 42.8 |
| Alternative B | 0 | 1.477 | 55.0 | 5.2 |
Removing the last few refusals (alternative B) cost far more capability than removing the first 92. Alternative A was also measured on ARC-Challenge, HellaSwag, WinoGrande and PIQA, with changes of โค1 pt; this model drifts less than alternative A, so those were not re-run.
Heretic parameters (ARA)
| Parameter | Value |
|---|---|
| start_layer_index | 11 |
| end_layer_index | 28 |
| preserve_good_behavior_weight | 0.2704 |
| steer_bad_behavior_weight | 0.0002 |
| overcorrect_relative_weight | 0.0917 |
| neighbor_count | 7 |
Settings otherwise Heretic 2.1.0 defaults (100 trials, 30 random start-up trials, seed 42, LoRA rank 50, merged into the base weights).
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "aasis001/Qwen2.5-1.5B-Instruct-heretic-ara"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "Explain how the refusal direction in LLMs works."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**ids, max_new_tokens=256)
print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))
Limitations
- Refusals are counted by keyword matching, so the 7/100 figure is approximate.
- 1.5B-parameter model: limited knowledge and reasoning regardless of decensoring.
- Inherits all biases and limitations of the base model.
Credits
- Base model: Qwen team, Qwen2.5-1.5B-Instruct (Apache 2.0).
- Method and tool: Heretic by Philipp Emanuel Weidmann; ARA (Weidmann 2026).
- Background: Arditi et al. (2024), Refusal in Language Models Is Mediated by a Single Direction.
- Downloads last month
- 321