license: apache-2.0
language:
- en
library_name: transformers
pipeline_tag: text-generation
base_model: salyamq/olmicro-2.7b-instruct
tags: - olmicro
- olmo
- hybrid
- gated-deltanet
- abliterated
- uncensored
- chat
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 | ~131k assistant tokens (~480 conversations) per step |
| 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}
}