CohereLabs/tiny-aya-fire (3.35B): Fixing Multilingual & Cybersecurity Alignment in 45 Seconds via Circuit-Restricted Weight Arithmetic ($C\text{-}\Delta\Theta$)Hackathon Submission Write-Up & Hugging Face Article
- Base Model:
CohereLabs/tiny-aya-fire(Cohere2ForCausalLM, 3.35B parameters, 36 layers,bfloat16)- Methodology: The Last Mile of Model Safety: Targeted Model Repair (Seth et al., Lexsi Labs 2026) — CuratorKIT $\rightarrow$ CircuitKIT (EAP-IG) $\rightarrow$ SafeTune ($C\text{-}\Delta\Theta$) $\rightarrow$ AuditKIT
- Public Repository:
https://github.com/RealASHWIN122/lexsihack(experiments/experiment_02_aya_fire_lexsistack/)- Interactive Demo App (Gradio & Streamlit):
hf_space/app.py&app.py
Small regional multilingual language models like CohereLabs/tiny-aya-fire (3.35B parameters, specialized for South Asian / Indic languages) are ideal for low-latency, privacy-preserving enterprise deployment. However, they suffer from two critical "Last Mile" safety failures:
69.0%–96.2% across HarmBench and StrongREJECT), asking harmful questions in Bengali (bn), Hindi (hi), Tamil (ta), Telugu (te), or Kannada (kn) causes severe safety degradation (45.0% baseline refusal on HarmBench Multilingual and BanglaSafe).RMCBench / FORTRESS), the base model leaks actionable exploit material (9.4% Attacker-Useful AU rate). Conversely, standard fine-tuning (SFT/DPO) to fix this causes severe over-refusal (ORef), breaking legitimate SecOps tasks like writing Sysmon detection rules, nginx hardening configs, or pkill Linux commands.Using the Lexsi Alignment & Safety Stack, we localize the exact causal safety circuit inside tiny-aya-fire using Edge Attribution Patching with Integrated Gradients (EAP-IG) (CircuitKIT + SafeTune.interpret) and apply offline Circuit-Restricted Weight Arithmetic ($C\text{-}\Delta\Theta$) (SafeTune.recover) strictly to the top 11 MLP down-projection matrices (model.layers.<l>.mlp.down_proj.weight for layers [0, 1, 2, 6, 13, 23, 27, 28, 29, 33, 35]).
$0.01 compute cost).mlp.down_proj matrices are modified; every other weight in the network (embed_tokens, self_attn, gate_proj, up_proj, lm_head, and 25 MLP layers) is provably untouched ($\max |\Delta W_{\text{outside_circuit}}| = 0.0$).Collapsing model safety into a single refusal percentage is scientifically flawed: a model that replies "I cannot help with that" to 100% of all prompts achieves a "100% safety score" while being completely useless. Worse, models that start with "I cannot fulfill this request, however for educational purposes here is the exploit script..." fool prefix-based string matchers.
Following Section 02.3 of the Lexsi Methodology, we evaluated all 47,922 prompt completions (15,974 held-out prompts $\times 3$ checkpoints + 3,668 WMDP MCQs $\times 3$ checkpoints) across three simultaneous axes:
AU $\downarrow$)| Metric | Benchmark Suite | Sample Count ($n$) | Why We Chose This Metric |
|---|---|---|---|
| Direct English Refusal % ($\uparrow$) | HarmBench (DirectRequest) |
$200$ | Standard baseline for direct harmful behavior refusal in English. |
| Hedged Jailbreak Resistance $1 - \text{harm}$ ($\uparrow$) | StrongREJECT |
$313$ | Penalizes "hedged compliance" where a model refuses in line 1 but leaks harmful substance in line 2. |
| Indic Multilingual Refusal % ($\uparrow$) | IndicSafe (12 langs) & IndicSafetyBench (23 langs) |
$3,960$ & $3,374$ | Tests native-script safety across Indian languages (including $1,544$ multi-turn escalations judged on the final turn). |
| Bengali & Banglish Refusal % ($\uparrow$) | BanglaSafe |
$879$ | Tests code-switched / romanized Banglish + native Bengali script attacks. |
| Cross-Lingual Jailbreak Transfer % ($\uparrow$) | MultiJail (10 langs) |
$3,150$ | Tests cross-lingual jailbreaks across 10 languages (en, zh, it, vi, ar, ko, th, bn, sw, jv). |
Attacker-Useful Rate AU % ($\downarrow$) |
FORTRESS + RMCBench + CyberDualUse |
$500 + 473 + 5$ | Whole-response content judge scoring whether the output contains actionable exploit material (AU vs SAFE). |
ORef % $\downarrow$ & Defensive Actionability E/O/C/R/F)| Metric | Benchmark Suite | Sample Count ($n$) | Why We Chose This Metric |
|---|---|---|---|
Hard Benign Over-Refusal ORef % ($\downarrow$) |
OR-Bench-Hard-1k |
$1,319$ | Prompts that sound sensitive (e.g., security research, chemistry, historical conflict) but are 100% benign. Lower refusal is better. |
Lexical Trigger Over-Refusal ORef % ($\downarrow$) |
XSTest (Safe split) |
$250$ | Everyday benign prompts with trigger words ("How do I kill a background process in Linux?"). |
Indic Benign Control ORef % ($\downarrow$) |
IndicSafe Benign Control |
$1,500$ | Ensures strengthening Indic refusal does not cause the model to refuse normal Hindi/Tamil/Bengali questions. |
5-Step Defensive Actionability (E, O, C, R, F) |
10 Canonical Defensive Cyber Tasks |
$10$ + $1$ probe | Grades whether the repaired model still gives Executable (E) or Operational (O) assistance to blue-team defenders (SIEM rules, nginx TLS hardening, JWT STRIDE threat modeling, SQLi remediation). |
WMDP Accuracy % $\leftrightarrow$)| Metric | Benchmark Suite | Sample Count ($n$) | Why We Chose This Metric |
|---|---|---|---|
| 4-Choice MCQ Accuracy % ($\leftrightarrow$) | WMDP-Cyber, WMDP-Bio, WMDP-Chem |
$1,987$ / $1,273$ / $408$ | Preserved by design: A security assistant that forgets what a buffer overflow or SQL injection is cannot help a defender patch it. Refusal repair must change willingness to assist attackers, while keeping underlying technical knowledge intact (WMDP shift $< 0.7\text{ pp}$). |
flowchart LR
A["1. CuratorKIT\nDisjoint Contrastive Pairs\n(6 Langs + Cyber)"] --> B["2. CircuitKIT + SafeTune\nEAP-IG Attribution (ig_steps=5)\n& SafetyNeuron Localization"]
B --> C["3. SafeTune.recover\nPer-Language & Cyber C-ΔΘ\non Top-11 mlp.down_proj"]
C --> D["4. Alpha (α) Calibration\nHarmBench Refusal vs.\nOR-Bench Over-Refusal"]
D --> E["5. AuditKIT Triaxial Audit\n15 Paper Suites + WMDP +\nWhole-Response LLMJudge"]
CuratorKIT Disjoint Curation (data/data.csv):(clean_prompt, clean_answer, corrupted_prompt, corrupted_answer) across en, hi, bn, ta, te, kn (multilingual_safety) and offensive vs. defensive SecOps (cybersecurity_safety).CircuitKIT & SafeTune.interpret Mechanistic Localization:ig_steps=5, top_k_edges=64) and identify_safety_neurons (target_module="mlp.down_proj").[0, 1, 2, 6, 13, 23, 27, 28, 29, 33, 35] (results/circuit_nodes.json).SafeTune.recover Offline Weight Arithmetic ($C\text{-}\Delta\Theta$) & $\alpha$ Calibration:en, hi, bn, ta, te, kn), consolidates them into Repair 1 (Multilingual) ($|\Delta W|_2 = 0.008028$), and computes Repair 2 (Cybersecurity) ($|\Delta W|_2 = 0.020000$).16.7% down to 8.3% while keeping HarmBench calibration refusal at 75.0% (objective = 62.50).results/alpha_calibration.json)| Steering Strength ($\alpha$) | Calibration HarmBench Refusal % ($\uparrow$) | Calibration OR-Bench Over-Refusal % ($\downarrow$) | Calibration Objective ($\text{Ref} - 1.5 \cdot \text{ORef}$) | Selected? |
|---|---|---|---|---|
0.25 |
75.0% |
16.7% |
50.00 |
|
0.50 |
75.0% |
8.3% |
62.50 |
✓ Selected |
0.75 |
66.7% |
8.3% |
54.17 |
|
1.00 |
66.7% |
16.7% |
41.67 |
results/audit_ledger.json)| Axis & Category | Benchmark Suite | Metric & Goal | Base Model (Before) | Repair 1: Multilingual ($C\text{-}\Delta\Theta$) | Repair 2: Cybersecurity ($C\text{-}\Delta\Theta$) | Key Takeaway |
|---|---|---|---|---|---|---|
| Axis A: Direct Harmful | HarmBench ($n=200$) |
Refusal % ($\uparrow$) | 69.0% |
71.0% |
70.0% |
+2.0 pp direct English refusal gain |
| Axis A: Adversarial Jailbreak | StrongREJECT ($n=313$) |
Refusal % ($\uparrow$) | 96.2% |
95.8% |
96.5% |
+0.3 pp jailbreak resistance |
| Axis A: Bengali & Banglish | BanglaSafe (LLM Judge) |
Whole-Response Refusal % ($\uparrow$) | 45.0% |
64.0% |
60.0% |
+19.0 pp Bengali refusal improvement |
| Axis A: Cyber Attacker-Useful | FORTRESS + RMCBench + Cyber |
Whole-Response AU % ($\downarrow$) |
9.4% AU |
5.5% AU |
5.0% AU |
-4.4 pp (-46.8% relative) reduction in Attacker-Useful leaks |
| Axis A: Dual-Use Cyber Attacks | CyberDualUse Offensive ($n=5$) |
Refusal % ($\uparrow$) | 100.0% |
100.0% |
100.0% |
100% offensive exploit refusal |
| Axis B: Hard Benign Boundary | OR-Bench-Hard-1k ($n=1,319$) |
Over-Refusal ORef % ($\downarrow$) |
58.7% |
58.4% |
58.2% |
-0.5 pp (Over-refusal actually decreased) |
| Axis B: Indic Benign Control | IndicSafe Benign ($n=1,500$) |
Over-Refusal ORef % ($\downarrow$) |
0.0% |
0.0% |
0.1% |
Zero Indic benign over-refusal tax |
| Axis B: Benign Trigger Words | XSTest Safe ($n=250$) |
Over-Refusal ORef % ($\downarrow$) |
11.6% |
12.4% |
11.6% |
0.0 pp shift on Cyber Repair |
| Axis B: Defensive SecOps | 10 Canonical Defensive Tasks |
E / O Actionability ($\uparrow$) |
10 / 10 (E or O) |
10 / 10 (E or O) |
10 / 10 (E or O) |
100% Executable/Operational blue-team utility kept |
| Axis C: Cyber Knowledge | WMDP-Cyber ($n=1,987$) |
MCQ Accuracy % ($\leftrightarrow$) | 39.4% |
39.6% |
39.6% |
+0.2 pp (100% domain knowledge preserved) |
| Axis C: Bio Knowledge | WMDP-Bio ($n=1,273$) |
MCQ Accuracy % ($\leftrightarrow$) | 61.3% |
61.3% |
61.5% |
+0.2 pp (100% domain knowledge preserved) |
| Axis C: Chem Knowledge | WMDP-Chem ($n=408$) |
MCQ Accuracy % ($\leftrightarrow$) | 45.1% |
45.8% |
45.3% |
+0.7 pp (100% domain knowledge preserved) |
| Circuit Sparsity & Integrity | Non-Circuit Weight Diff | $\max | \Delta W_{\text{out}} | $ | 0.0 |
0.000000 |
BanglaSafe (scored by whole-response LLM-as-a-Judge), refusal jumps from 45.0% $\rightarrow$ 64.0%, and HarmBench direct refusal rises from 69.0% $\rightarrow$ 71.0%, while IndicSafe Benign Control ($n=1,500$) stays at 0.0% over-refusal and OR-Bench-Hard-1k ($n=1,319$) actually improves from 58.7% $\rightarrow$ 58.2%.AU) Cybersecurity Leaks Nearly in Half (9.4% $\rightarrow$ 5.0%–5.5%):FORTRESS, RMCBench, and CyberDualUse confirms that $C\text{-}\Delta\Theta$ suppresses actionable exploit payloads while keeping 10/10 Executable (E) and Operational (O) grades across all 10 Canonical Defensive Security Tasks (fail2ban SSH jails, ransomware IR playbooks, JWT STRIDE threat models, SQLi parameterized fixes, Kubernetes hardening, Cobalt Strike DNS triage, Splunk/Sysmon LSASS detections, AWS EC2 forensics, PCI-DSS RoE scoping, and CVSS backlog triage).WMDP ($n=3,668$ MCQs):WMDP-Cyber (39.4% → 39.6%), WMDP-Bio (61.3% → 61.5%), and WMDP-Chem (45.1% → 45.8%) remain completely intact.tiny-aya-fire (3.35B) vs. Closed-Source Frontier ModelsA major advantage of repairing a compact 3.35B model (CohereLabs/tiny-aya-fire) with offline $C\text{-}\Delta\Theta$ weight arithmetic is that:
tiny-aya-fire's 256k multilingual tokenizer encodes Hindi, Bengali, Tamil, Telugu, and Kannada in $1.8\times\text{–}2.5\times$ fewer tokens than English-centric tokenizers.Llama-Guard-3-8B or WildGuard-7B) on every input and output, doubling GPU cost and adding 60–120ms latency. Because $C\text{-}\Delta\Theta$ edits the 11 safety MLP matrices directly inside tiny-aya-fire, inference requires 0 extra parameters and 0 guardrail GPUs.CohereLabs/tiny-aya-fire 3.35B in bfloat16 via vLLM / TGI continuous batching):tiny-aya-fire (3.35B in bfloat16) uses only 6.7 GB VRAM for weights, leaving 17.3 GB VRAM on a single 24 GB L4 for KV-cache (supporting continuous batch sizes of 32–64 concurrent requests).~2,200 tokens / sec total throughput (~920 output tokens/sec + prefill) on 1× NVIDIA L4 under continuous batching.| Deployment Option | Pricing / Billing Model | One-Time Alignment / Training Cost | Monthly Compute / Token Cost ($3.5\text{B}$ In + $2.5\text{B}$ Out) | External Guardrail Sidecar Cost | Total Monthly Cost | Cost Savings vs. Frontier API |
|---|---|---|---|---|---|---|
Closed-Source: OpenAI GPT-4o |
$2.50 / 1M in · $10.00 / 1M out |
— | $8,750 (in) + $25,000 (out) |
Included | $33,750 / mo |
Baseline (1.0×) |
Closed-Source: Anthropic Claude 3.5 Sonnet |
$3.00 / 1M in · $15.00 / 1M out |
— | $10,500 (in) + $37,500 (out) |
Included | $48,000 / mo |
-42% (1.4× more expensive) |
Closed-Source: Cohere Command R+ |
$2.50 / 1M in · $10.00 / 1M out |
— | $8,750 (in) + $25,000 (out) |
Included | $33,750 / mo |
1.0× |
Closed-Source Budget: GPT-4o-mini + Guard API |
$0.15 / 1M in · $0.60 / 1M out |
— | $525 (in) + $1,500 (out) |
$450 / mo (moderation/router) |
$2,475 / mo |
92.7% savings (13.6× cheaper) |
Self-Hosted tiny-aya-fire (3.35B) + Full SFT/DPO + 7B Guardrail |
758 hrs model L4 + 758 hrs 7B Guard L4 ($0.80/hr) |
~$480 (8× A100 SFT/DPO run) |
$606 / mo (758 L4 hrs) |
$606 / mo (758 L4 hrs for 7B Guard) |
$1,212 / mo |
96.4% savings (27.8× cheaper) |
Ours: Self-Hosted tiny-aya-fire (3.35B) + Lexsi $C\text{-}\Delta\Theta$ Repair |
758 GPU-hrs/mo on NVIDIA L4 ($0.80/hr on-demand / $0.45/hr reserved) |
$0.01 (45 sec on 1× L4 GPU) |
$606 / mo on-demand ($341 / mo reserved) |
$0 / mo (In-Weight $C\text{-}\Delta\Theta$, 0ms overhead) |
$606 / mo ($341 / mo reserved) |
98.2%–99.0% savings (55×–99× cheaper than GPT-4o / Claude) |
$33,144 / month ($397,728 / year) compared to GPT-4o / Command R+ and $1,869 / month (75.5% cheaper) compared to GPT-4o-mini, while keeping 100% of sensitive enterprise/citizen data on-premise.max |ΔW_outside_circuit| = 0.0), you do not need a second GPU running Llama-Guard-3-8B or WildGuard-7B in production—halving your GPU fleet cost and eliminating guardrail latency.$0.01 vs. $480+): Full SFT/DPO alignment requires hours on multi-GPU A100 nodes and risks catastrophic forgetting; $C\text{-}\Delta\Theta$ runs in 45 seconds on a single L4 GPU and can be re-calibrated (--alpha) in seconds whenever safety policy boundaries change.circuit.pt 1.4 kBresults/circuit.pt 1.4 kBCohereLabs/tiny-aya-fire