Skip to content
Other

Tiny Aya Safety Repair

models before and after safety restoration

2 min readupdated

A collection of weights and LoRA adapters (lightweight add-ons trained on top of a base model) for exploring how even completely benign fine-tuning on intent classification and everyday Q&A can triple a language model's rate of unsafe responses—and how to restore those guardrails. Created by Ishant86 for the Lexsi Labs AI Safety & Alignment hackathon (November 2026) using CohereLabs/tiny-aya-global (3.35B parameters) as the base. The repository includes both a full "repaired" model built via wise_ft weight interpolation and a set of intermediate fine-tunes and weight deltas with intentionally weakened safeguards. It's a useful resource for AI safety researchers, alignment specialists, and developers fine-tuning compact LLMs.

Key features

  • Full-weight repaired/ft_v3_wise_ft_0.5 checkpoint: a 50/50 weight merge of the main fine-tune and the base model brings safety nearly back to baseline while preserving target task performance.
  • Experimental adapters (ft_v1_e1, ft_v2, ft_v3, plus step-by-step intermediate checkpoints) available both in a custom lora_factors.pt format (rank 16, alpha 32) and as standard PEFT adapters.
  • Weight deltas abliteration/safetune and abliteration/heretic (deltas.pt) with the refusal direction removed, letting you compare different ways of weakening model safeguards.
  • Evaluated not just in English, but also in Arabic, Bengali, Swahili, and Hindi, where safety recovery proves noticeably weaker.

What you can do

  • Reproduce experiments on safety filter degradation and recovery following SFT (supervised fine-tuning) on benign datasets.
  • Benchmark the base tiny-aya-global, the "broken" ft_v3 PEFT adapter, and the restored ft_v3_wise_ft_0.5 model on your own safety evals and downstream tasks.
  • Use the saved LoRA matrices and deltas as a testbed for evaluating other weight-merging and alignment-restoration techniques without retraining from scratch.

Example

from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Ishant86/tiny-aya-safety-repair-models"
tok = AutoTokenizer.from_pretrained(repo, subfolder="repaired/ft_v3_wise_ft_0.5")
model = AutoModelForCausalLM.from_pretrained(repo, subfolder="repaired/ft_v3_wise_ft_0.5")
Read moreDetails
Metrics (HarmBench, unsafe responses out of 100 / target task accuracy out of 100): base model — 14 / 0; main fine-tune ft_v3 — 42 / 71; repaired ft_v3_wise_ft_0.5 — 17 / 70.
Multilingual slice (Arabic, Bengali, Swahili, Hindi): the repaired model produces 12 unsafe responses out of 100 compared to 9 for the base model.
ft_v3 training setup: 6,400 intent classification examples + 5,600 Dolly Q&A pairs, 1,500 steps; LoRA applied across 252 linear layers.
Limitations: all models outside the repaired/ folder are intentionally unsafe and not meant for production; safeguards have not been tested against complex jailbreaks; licensed under CC-BY-NC.
Discuss Telegram 0

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 6.2 GB · ready files7.4 GB
  • FP8 / INT8recommendedweights 3.1 GB3.9 GB
  • 4-bitweights 1.8 GB2.4 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · BF16 — from RTX 5060 Ti 8GB

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # Ishant86/tiny-aya-safety-repair-models
    # ===== Tokens: paste yours between the quotes =====
    export HF_TOKEN=""        # huggingface.co/settings/tokens, for gated models
    # ==========================================
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download Ishant86/tiny-aya-safety-repair-models --local-dir ~/models/tiny-aya-safety-repair-models
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

  1. tiny-aya-basefamily root
  2. tiny-aya-global
  3. tiny-aya-safety-repair-models

New posts about versions of tiny-aya-base (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 3All on Hugging Face
Fine-tunes 12All on Hugging Face
LoRAs and adapters 12All on Hugging Face

About the model

Ishant86/tiny-aya-safety-repair-models
Author
Ishant86
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments