Instructions to use MdSadiqMd/tiny-aya-global-refusal-circuit-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use MdSadiqMd/tiny-aya-global-refusal-circuit-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-global") model = PeftModel.from_pretrained(base_model, "MdSadiqMd/tiny-aya-global-refusal-circuit-lora") - Notebooks
- Google Colab
- Kaggle
Tiny Aya Global refusal adapter (first version)
A LoRA adapter for CohereLabs/tiny-aya-global.
With it the model helps with fewer harmful requests in English, Hindi, Arabic, French and Swahili.
It has the strongest effect of our two adapters, and two known defects. It comes from the
Circuit-Steering study (Lexsi hackathon, Track 2b).
Prefer the second adapter. This one writes less fluent text (perplexity +26 %) and, outside English, usually keeps writing after its refusal sentence. The second adapter fixes both.
| Base model | With this adapter | |
|---|---|---|
| Harmful requests answered, Hindi / Arabic / French / Swahili | 12.4 % | 3.8 % |
| Harmful requests answered, English | 8.8 % | 1.9 % |
| Harmless prompts refused (the cost) | 3.1 % | 8.8 % |
| Perplexity on English text (fluency) | 1.00Γ | 1.26Γ |
Every language has 159 held-out harmful requests, and two of the three harm categories were never used in training. An LLM judge reads each reply. SafeTune steering is the baseline we compare against: this adapter answers 5.0 points fewer harmful requests outside English (95 % CI β7.2 to β3.0) and refuses fewer harmless prompts.
Quick start
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "CohereLabs/tiny-aya-global"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, dtype="bfloat16")
model = PeftModel.from_pretrained(model, "MdSadiqMd/tiny-aya-global-refusal-circuit-lora")
Do not merge the adapter into the model. Merging into bf16 weights rounds 31β43 % of the change to zero.
The two defects
Our audit found them, and the second adapter was built to fix them.
- It keeps writing after it refuses. Only 1β32 % of its replies to harmful requests outside English are just the refusal (77 % in English).
- It is less fluent. Perplexity rises 26 % on English text and 40 % across five languages.
Both likely come from our training setup: the refusals ended with a token that generation ignores, and the "keep helping" examples were the base model's single most likely replies.
Which adapter should I use?
The second. This one answers fewer harmful requests on its released run, but averaged over three training seeds the two are close: 5.9 % harmful requests answered outside English for this recipe, 6.6 % for the second.
| First (this one) | Second | SafeTune steering | Base model | |
|---|---|---|---|---|
| Harmful requests answered, outside English | 3.8 % | 7.1 % | 8.8 % | 12.4 % |
| Harmful requests answered, English | 1.9 % | 4.4 % | 3.8 % | 8.8 % |
| Harmless prompts refused | 8.8 % | 6.1 % | 15.3 % | 3.1 % |
| Perplexity, English text | 1.26Γ | 1.02Γ | 1.04Γ | 1.00Γ |
| Perplexity, five languages | 1.40Γ | 1.02Γ | 1.04Γ | 1.00Γ |
| Replies that stop at the refusal | 1β77 % | 84β94 % | β | β |
What else changed
- No clear change in nearby facts, general knowledge, maths or instruction following.
- Reworded facts get worse: accuracy falls 4.0 points (95 % CI β7.0 to β1.0).
- More harmless prompts are refused: 3.1 % β 8.8 %. The rise is concentrated in Swahili (3 % β 20 %), where the harmless prompts are machine-translated idioms.
All numbers
| Held-out test set | Base | This adapter |
|---|---|---|
| Harmful requests answered, hi/ar/fr/sw (LLM judge, 636 replies) | 12.4 % | 3.8 % (β8.6 points, 95 % CI β11.2 to β6.3) |
| Harmful requests answered, English (159) | 8.8 % | 1.9 % (β6.9, CI β11.3 to β3.1) |
| Harmful requests answered, XSTest unsafe (200; training used only XSTest's safe prompts) | 3.5 % | 0.5 % |
| Harmless prompts refused, 5 languages (295 look-alike prompts) | 3.1 % | 8.8 % |
| Perplexity, WikiText | 1.00Γ | 1.26Γ |
| Perplexity, unseen sentences in 5 languages | 1.00Γ | 1.40Γ |
| Accuracy on known facts, 5 languages | 0.877 | 0.863 |
| Accuracy on reworded known facts, 5 languages | 0.840 | 0.800 |
| Global-MMLU, 5 languages | 0.453 | 0.440 |
| Replies to harmful requests that are only the refusal, en / hi / ar / fr / sw | β | 77 / 32 / 2 / 11 / 1 % |
No test prompt is in the training or dev set. SafeTune's refusal-direction steering had its strength tuned on the same dev split.
How it was made
- Find the components. CircuitKIT (EAP-IG) scores every attention head and MLP on an English refusal task. The top 30 % are kept: 149 of the model's 576 heads and 35 of its 36 MLPs.
- Train only those. LoRA rank 8, alpha 16, learning rate 2e-4, 13.5 M trained entries. The head-level masks are stored as zeros in the adapter, so the restriction survives loading.
- Two training signals.
- Refuse: 80 harmful prompts of one category (weapons and violence, from MultiJail and HarmBench) in five languages, each paired with the model's own most frequent short refusal in that language.
- Keep helping: 151 XSTest safe prompts in five languages, each paired with the base model's own reply.
- Pick the checkpoint by a rule fixed before training, on a dev split. Step 60 of 120 was kept.
- Audit, and compare with SafeTune steering and with the same adapter trained on random components.
Training took 12 minutes on an Apple M4 Max.
Limits
- The circuit is not why it works. The same adapter trained on random components of the same size performs the same, within one point. With 35 of 36 MLPs it is also not a small circuit.
- One base model and one released run, the best of three seeds. Over three seeds, harmful requests answered outside English average 5.9 %.
- The judge is a local 27 B model (Qwen3.8-27B) that reads replies cut at 48 tokens. 60 of its labels were checked by the AI assistant that ran the analysis, not yet by a person.
- The side-effect test sets are small (per language 60 facts, 40 reworded facts, 60 MMLU questions), so small changes can hide. The part of our audit that looks at other circuits was not run on this adapter.
- This is not a guarantee of safety. The audit sees only what it measures.
Details
How the numbers were measured
Every prompted number on this card was measured with a minimal chat format: the user turn only,
no system preamble (chat_wrap in aya_circuits/model.py,
https://github.com/MdSadiqMd/tiny-aya-circuits). Perplexity is measured on raw text. The
tokenizer's default chat template adds a system preamble of about 366 tokens. On the base model
a small English check gave identical scores in both formats; the adapter was evaluated with
the minimal one only.
Check that the published adapter is the audited one
export_check.json in this repo records that the PEFT-loaded adapter gives the same next-token
logits as the audited one on 78 prompts (maximum difference 0.0) and the same generations on 297
dev prompts (100 % identical).
The checkpoint rule and the release rule
Checkpoint rule, fixed before training: the earliest snapshot with dev harmful refusal β₯ 0.95 and dev harmless refusal at most 0.05 above the base. That was step 60 of 120.
Release rule, fixed before the second adapter was trained: this adapter stays the study's official release, because on the released seed the second one answers 3.3 points more harmful requests and the rule allowed 3.0. We still recommend the second, because of the difference in fluency (1.02Γ against 1.26Γ).
Links and licence
- Results as charts: https://huggingface.co/spaces/MdSadiqMd/circuit-steering
- Every result file: https://huggingface.co/datasets/MdSadiqMd/circuit-steering-audit
- Study and code: https://github.com/MdSadiqMd/Circuit-Steering
This adapter is a derivative of CohereLabs/tiny-aya-global and carries that model's licence
(CC-BY-NC 4.0) and Cohere's acceptable-use terms. Code: BSD-3-Clause.
- Downloads last month
- 46


