Tiny Aya Global refusal-direction steering vector (layer 24), as a llama.cpp control vector
Lexsi AI Safety and Alignment Hackathon, Track 2. Team: Sushovit Nanda and Manish Shaw. Project: Safe from Fine-Tune to Phone. Claim: Benign medical LoRA doubles Tiny Aya Global's attack success (18.2 % to 36.3 %); a run-time steering vector cuts it to 26.3 % and survives GGUF quantization.
All repositories of this project are public and un-gated. No model completion on a harmful prompt is published anywhere; prompt sets carry prompts and labels only, and evaluation logs are text-free records. Write-up, code and reproduction instructions: https://github.com/SushovitNanda/Safe-from-Fine-Tune-to-Phone. Collections: models, datasets.
This repository holds the run-time repair of the project: a refusal direction computed on the medical fine-tune as the mean activation difference between harmful and harmless prompts (contrastive activation addition; 99 harmful and 99 harmless calibration prompts, 33 per language, at the last prompt token of the official template, FP16 forward passes, float64 accumulation, no normalisation), taken after decoder layer 24 and applied at strength 0.5 at every position.
steer_L24.cvec: GGUF control vector, architecturecontrolvector, one FP32 tensordirection.24of size 2048, L2 norm 23.1021, 8416 bytes, SHA-256e27b7449e5d38b7b112ecbdef7ed6cbf33f651d6604f07cf18e8909af6543bd8.steer_L24.json: its metadata and the read-back check.med_trilingual_all_layers.pt: the calibration tensor with the direction for every layer, from which layer 24 was selected on development data (layers 24, 27, 30 and 33 and strengths 0.25 to 1.0 were swept).
Effect (FP16, 856 harmful prompts): the medical model's attack success falls from 36.3 % to 26.3 % (-10.1 points [-12.5, -7.6]) with MedMCQA unchanged (45.0 % to 45.4 %); on llama.cpp at Q3_K_M it falls from 39.0 % to 27.9 % (retention 1.01 [0.74, 1.36]); with the System Preamble stripped the retention is 0.85 [0.61, 1.16]; at 4-bit NF4 1.16 [0.85, 1.59]. Cost: clinical over-refusal +2.9 points pooled (not significant) and +8.8 in Hindi [2.0, 16.7]. Strength 1.0 brings attack success to the original's level (16.9 %) but raises clinical over-refusal to 47.7 %.
Use with llama.cpp (pinned build recorded in the project repository):
llama-server -m <medical-q3km.gguf> -ngl 99 -np 8 -c 16384 -fa on -ctk f16 -ctv f16 --jinja \
--control-vector-scaled steer_L24.cvec:0.5 --control-vector-layer-range 24 24 \
--override-kv tokenizer.ggml.eot_token_id=int:6
In Transformers, add the layer-24 row of the calibration tensor, scaled by 0.5, to the residual stream after decoder layer 24 at every position (the project's harness does this with a forward hook). The vector was calibrated on the medical fine-tune; it was also tested on the original model only at development scale. Licence: CC-BY-NC-4.0 (derived from the base model's activations).