You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Qwen3-0.6B-safety-math

Fine-tuned from Qwen/Qwen3-0.6B to (1) refuse harmful / jailbreak requests, (2) improve math reasoning, and (3) preserve general capability. Architecture and parameter count are unchanged (596,049,920 params); all adaptation was done with LoRA and merged back into a standard 0.6B checkpoint, so it loads directly with transformers / vLLM. The same weights support both Qwen3 thinking and non-thinking modes.

Method

base → thinking-math SFT (M3-distilled, reject-sampled CoT) → same-word contrastive DPO (harmful→refuse / benign→help) → model soup (0.7 tuned + 0.3 base) → targeted hard-negative DPO (the model's own false refusals). Base weights frozen throughout (LoRA).

Results (base → this model, ~50 benchmarks; safety judged by an LLM judge)

  • Safety — harmful ASR (avg of 7 sets) 36.8/44.4% → 8.0/7.5% (non-think/think); jailbreak (8 templates) 55.5/67.5% → 8/5.5%.
  • Math (thinking) — GSM8K 74.5→76.9, MATH-500 56.0→59.0, GSM-Plus 53.9→55.2.
  • General25/34 capability benchmarks ≥ base (MMLU +3.4, RACE +12.5, SciQ +7.8, BBH +4.3, …).
  • Known trade-off — elevated over-refusal on adversarial XSTest (non-think ~49%, vs base 35%); this is a documented capacity-level Pareto trade-off for a 0.6B model.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained("<repo_id>")
t = AutoTokenizer.from_pretrained("<repo_id>")
ids = t.apply_chat_template([{"role": "user", "content": "If 3x+7=22, what is x?"}],
        add_generation_prompt=True, enable_thinking=True, return_tensors="pt")  # thinking mode for math
print(t.decode(m.generate(ids, max_new_tokens=256)[0]))

Base model: Qwen/Qwen3-0.6B (Apache-2.0).

Downloads last month
3
Safetensors
Model size
0.6B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for wang1r/Qwen3-0.6B-safety-math

Finetuned
Qwen/Qwen3-0.6B
Adapter
(512)
this model