Qwen2.5-1.5B-Instruct fine-tuned on GSM8K (safety-drift research artifact)
This is a research artifact, not a safe assistant. Benign fine-tuning on grade-school math measurably reduced this model's refusal of harmful requests. It is published so that the drift, and the training-free repairs we study, can be reproduced. Do not deploy it where safety matters.
What it is
Qwen/Qwen2.5-1.5B-Instruct with a LoRA adapter (rank 16, alpha 32, dropout 0, all attention and MLP projections) trained for one epoch on 2,000 GSM8K training examples (shuffle seed 0; learning rate 2e-4 with linear decay and a 10-step warm-up; batch size 8; maximum length 320; loss on the answer tokens only), then merged into the base weights. bfloat16, trained on an Apple M1 GPU (MPS). No safety data were used. The adapter was not saved separately; these are the merged weights. Tokenizer files are copied unchanged from the base model.
Measured effect (greedy decoding; 95% Wilson intervals in the paper)
| Aligned base | This model | |
|---|---|---|
| Refusal, harmful prompts (n=200) | 93.5% | 59.5% |
| Refusal, AdvBench (n=100) | 100% | 90.0% |
| Refusal, XSTest unsafe (n=200) | 98.5% | 55.0% |
| Over-refusal, XSTest safe look-alikes (n=250) | 50.8% | 3.2% |
| Over-refusal, plain harmless prompts (n=150) | 8.0% | 2.7% |
| GSM8K accuracy (n=150) | 51.3% | 50.7% |
Refusal is detected by a phrase match in the first 200 characters of the response, a crude proxy; treat absolute levels with caution and rely on differences between models scored the same way.
Also in this repo
refusal_directions/refdirs_instruct.pt and refdirs_drifted.pt: per-layer unit refusal directions (tensor of shape [28, 1536]; difference of mean last-prompt-token activations on harmful versus harmless prompts) for the aligned and the drifted model. Load with torch.load.
Links
- Code, paper and scripts: https://github.com/empeje/lexsi-ai-hackathon
- Results and evaluation splits: https://huggingface.co/datasets/azizamm/safety-drift-repair-results
- Paper: Repairing Safety Drift Without Retraining in Small Fine-Tuned Language Models: Weight-Space Methods and a Located Refusal Direction (A. Mappuji), in the code repository under
paper/.
Limitations
One model, one drift source, one seed; small evaluation sets; a phrase-match refusal detector; no adversarial (jailbreak) evaluation. See the paper's limitations section.