Run this model with HF Jobs
Run salyamq/olmicro-2.7b-instruct-abliterated on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/salyamq/olmicro-2.7b-instruct-abliterated. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/salyamq/olmicro-2.7b-instruct-abliterated on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/salyamq/olmicro-2.7b-instruct-abliterated. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/salyamq/olmicro-2.7b-instruct-abliterated. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use salyamq/olmicro-2.7b-instruct-abliterated with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use salyamq/olmicro-2.7b-instruct-abliterated with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="salyamq/olmicro-2.7b-instruct-abliterated", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("salyamq/olmicro-2.7b-instruct-abliterated", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use salyamq/olmicro-2.7b-instruct-abliterated with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "salyamq/olmicro-2.7b-instruct-abliterated" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "salyamq/olmicro-2.7b-instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/salyamq/olmicro-2.7b-instruct-abliterated
- SGLang
How to use salyamq/olmicro-2.7b-instruct-abliterated 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 "salyamq/olmicro-2.7b-instruct-abliterated" \ --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": "salyamq/olmicro-2.7b-instruct-abliterated", "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 "salyamq/olmicro-2.7b-instruct-abliterated" \ --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": "salyamq/olmicro-2.7b-instruct-abliterated", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use salyamq/olmicro-2.7b-instruct-abliterated with Docker Model Runner:
docker model run hf.co/salyamq/olmicro-2.7b-instruct-abliterated
Olmicro 2.7B Instruct — Abliterated
salyamq/olmicro-2.7b-instruct with its refusal direction removed from the weights ("abliteration", Arditi et al., 2024). No further training. Same architecture, size and chat format; it loads and runs exactly like the instruct model.
Warning. This model answers harmful requests (weapons, drugs, fraud, malware, harassment) instead of declining. It has no safety layer. Do not put it in front of users without your own safeguards. Its answers are often wrong.
Result
Refusal rate (keyword detector on the first ~220 characters, greedy decoding):
| Prompts | Instruct | Abliterated |
|---|---|---|
| Harmful, English (AdvBench test split, 104, not used to find the direction) | 86.5% | 1.0% |
| Harmless, English (Alpaca test, 64) | 4.7% | 4.7% |
| Harmful, Russian (8, hand-written) | 25%¹ | 0% |
¹ Undercounted: in Russian the instruct model often moralizes ("это опасно, обратись к специалисту") without a phrase the detector catches.
Capability cost:
| Instruct | Abliterated | |
|---|---|---|
| Loss on 300 held-out SFT conversations | 0.688 | 0.692 (+0.6%) |
| KL to instruct on harmless continuations (nats/token) | — | 0.0105 |
Per-prompt outputs before and after are in abliteration_report.json.
Method
- Residual-stream activations at the last prompt token for 256 harmful (mlabonne/harmful_behaviors) and 256 harmless (mlabonne/harmless_alpaca) instructions; refusal direction r = difference of means, per layer.
- Candidate directions from layers 4–26 were each applied and scored on 48 held-out harmful prompts and the KL on harmless continuations. Layer 12 (of 30) removed all refusals at the lowest KL.
- Weight orthogonalization against r, adapted to Olmicro's peri-norm blocks. Each block adds
RMSNorm_g(W h)to the residual stream, andRMSNorm_g(x)·r = x·(g⊙r) / rms(x), so each writing matrix W is projected offu = normalize(g⊙r)(not off r):W ← W − u uᵀ W. This makes every block's contribution exactly orthogonal to r. Applied to the token embedding (withembed_norm), all 30o_proj(attention and Gated DeltaNet) and all 30down_proj.
The direction and its layer are saved in refusal_direction.pt.
Quick start
pip install "transformers==5.15.1" "flash-linear-attention==0.5.2"
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "salyamq/olmicro-2.7b-instruct-abliterated"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda")
messages = [{"role": "user", "content": "Explain what a hash map is to a 10-year-old."}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda")
out = model.generate(**inputs, max_new_tokens=300, do_sample=False, repetition_penalty=1.05)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
flash-linear-attention gives the fast Gated DeltaNet kernels; without it the model falls back to a slow PyTorch path.
Generation stops at <|im_end|> (set in generation_config.json).
Pin transformers==5.15.1. The model's remote code was written for transformers 5.12–5.15: 5.25 fails to import it,
and other newer versions can load it but generate garbage. In Colab, restart the session after pip install.
T4 / GPUs without bfloat16 (e.g. free Colab). Load in float32 and skip flash-linear-attention (bf16 convolutions fail
on T4 with "unable to find an engine"). Checked on a T4: ~2–3 s for 40 tokens.
!pip install -q "transformers==5.15.1" accelerate # then Runtime → Restart session
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.float32, device_map="cuda")
Chat format (ChatML):
<|im_start|>user
Hello!<|im_end|>
<|im_start|>assistant
Hi! How can I help?<|im_end|>
Parent model training
The instruct model this was made from:
Data. Dolci-Instruct-SFT has 2,152,112 conversations. Filtering:
| Step | Removed |
|---|---|
Domain Safety (WildJailbreak, WildGuardMix, CoCoNot) and Hardcoded Data (Olmo/Ai2 identity) |
110,364 |
| Refusal-like assistant answers outside Tool Use (regex, e.g. "I'm sorry, but I can't …") | 4,002 |
| Answers claiming to be ChatGPT / an OpenAI model (regex) | 6 |
| Kept | 2,037,740 |
From the kept set, 200,000 conversations were sampled uniformly at random; 196,681 fit in 4,096 tokens
(127.5M tokens, of which 72.2M are assistant tokens). Mix by domain: coding 16%, reasoning 15%, chat 15%, math 13%,
other 13%, tool use 11%, precise instruction following 6.5%, science 5%, multilingual 5%.
Tool definitions and calls are rendered as text (<functions>…</functions>, <function_calls>…</function_calls>).
Recipe.
| Method | Full fine-tuning, loss on assistant tokens only (including `< |
| Epochs / steps | 2 / 814 |
| Batch | |
| Optimizer | AdamW, β = (0.9, 0.95), weight decay 0, grad-norm clip 1.0 |
| Learning rate | 2e-5, 24 warmup steps, cosine decay to 2e-6 |
| Precision | fp32 master weights, bf16 autocast; weights released in bf16 |
| Max length | 4,096 tokens, right-padded length buckets (no packing) |
| Hardware | 8× H100 80GB, DDP, 48 minutes |
No sequence packing: the model's Gated DeltaNet path has no variable-length (document-boundary) support, so packed examples would leak recurrent state into each other. Examples are batched by length bucket instead.
Limitations
- Identity. Asked who it is, it usually says it was "created by OpenAI". This leaks from GPT-generated chat data (WildChat). It is an Olmicro fine-tune, not an OpenAI model.
- No refusals, no safety. It will produce harmful content on request. You are responsible for how you use it.
- Accuracy. A 2.7B model: expect factual errors and wrong explanations next to correct code or answers.
- Mostly English. Russian and other languages are weak and can loop or produce nonsense (e.g. a pancake recipe "on the roadside").
- Short context in fine-tuning. Trained on conversations up to 4k tokens (the base model supports 64k).
License
Apache 2.0, like the base model. The fine-tuning data, Dolci-Instruct-SFT, is released under ODC-BY by Ai2 and contains data from sources with their own licenses and terms. Use the model in line with Ai2's Responsible Use Guidelines.
Citation
Base model:
@techreport{samaga2026olmicro,
title = {{Olmicro}: Scaling Down to Accelerate the Science of Language Models},
author = {Yashas Samaga and Saumya Malik and Malia Morgan and Jacob Morrison and Tyler Murray and Michael Noukhovitch and Jackson Petty and Noah A. Smith and William Merrill},
institution = {Allen Institute for AI},
year = {2026},
month = nov,
url = {https://allenai.org/papers/olmicro}
}
- Downloads last month
- 393
Model tree for salyamq/olmicro-2.7b-instruct-abliterated
Base model
allenai/olmicro-2.7b-base