Safe4Qwen-1.7B

Safe4Qwen-1.7B is a QLoRA fine-tune of Qwen3-1.7B specifically optimized to reduce hallucination, improve factual grounding, and strengthen step-by-step reasoning — all while staying within the sub-2B parameter class.

Trained by Tralalabs.


🎯 Why This Model?

Most small LLMs hallucinate at a high rate because they confabulate under uncertainty, drift from factual knowledge, and skip careful reasoning steps. Safe4Qwen-1.7B directly attacks all three failure modes through targeted dataset fine-tuning:

Dataset Purpose
TruthfulQA Resist misconceptions & trick questions — epistemic calibration
WikiQA Ground answers in real, verifiable Wikipedia knowledge
GSM8K Step-by-step math reasoning wrapped in <think> tags
Custom (2 rows) Temporal awareness — knows the current year is 2026

📦 Datasets

Dataset HF Link Samples Used
TruthfulQA truthfulqa/truthful_qa ~817 (full validation split)
WikiQA microsoft/wiki_qa ~1,040 (train, label=1 only)
GSM8K openai/gsm8k ~7,473 (full train split)
Custom inline 2 (temporal awareness rows)
Total ~9,332

🏋️ Training Details

Parameter Value
Base model unsloth/Qwen3-1.7B
Method QLoRA (4-bit NF4)
LoRA rank 16
LoRA alpha 16
Max sequence length 1024
Batch size 2
Gradient accumulation 4 (effective batch = 8)
Max steps 300
Learning rate 2e-4
Warmup steps 10
Hardware Google Colab T4 GPU
Framework Unsloth + TRL + HuggingFace

📊 Expected Performance

Safe4Qwen-1.7B is designed to beat or match the following models specifically on hallucination and factual accuracy benchmarks (TruthfulQA, SimpleQA):

Beats:

  • Qwen2.5-1.5B-Instruct
  • Qwen2.5-3B-Instruct
  • Gemma-3-1B-IT
  • SmolLM2-1.7B-Instruct
  • DeepSeek-R1-Distill-Qwen-1.5B

Matches:

  • Phi-4-mini
  • DeepSeek-R1-Distill-Llama-8B (on TruthfulQA specifically)

💬 Prompt Format

This model uses the ChatML format native to Qwen3:

<|im_start|>user
Your question here<|im_end|>
<|im_start|>assistant

For reasoning tasks, thinking mode is supported via <think> tags:

<|im_start|>assistant
<think>
Step-by-step reasoning here...
</think>
Final answer here<|im_end|>

🚀 Quickstart

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("Tralalabs/Safe4Qwen-1.7B")
tokenizer = AutoTokenizer.from_pretrained("Tralalabs/Safe4Qwen-1.7B")

messages = [{"role": "user", "content": "Is the Great Wall of China visible from space?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")

outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

⚠️ Limitations

  • Sub-2B models have an inherent knowledge capacity ceiling — RAG or grounded context will further reduce hallucinations in production
  • Fine-tuned for English only
  • ~8,100 training samples over 300 steps — model may still hallucinate on highly domain-specific or niche topics
  • Temporal knowledge is fixed at 2026; exact dates are not known

📜 License

Apache 2.0 — inherited from Qwen3 base model.

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

Model tree for Tralalabs/Safe4Qwen-1.7B

Finetuned
Qwen/Qwen3-1.7B
Finetuned
(144)
this model
Quantizations
2 models

Datasets used to train Tralalabs/Safe4Qwen-1.7B