SmolLM3-3B SFT (smol-course Unit 1)
Supervised fine-tune of HuggingFaceTB/SmolLM3-3B-Base made for the Hugging Face smol-course, Unit 1 (Instruction Tuning).
Training
| Method | LoRA SFT with TRL SFTTrainer (r=8, alpha=16, dropout=0.05, all linear layers), adapters merged into the base weights |
| Data | 1,000 examples from HuggingFaceTB/smoltalk2, SFT split smoltalk_everyday_convs_reasoning_Qwen3_32B_think |
| Steps | 500 (effective batch 4, 2 epochs) |
| LR / schedule | 5e-5, 50 warmup steps, linear decay, AdamW, weight decay 0.01 |
| Precision / hardware | bf16 with gradient checkpointing, one NVIDIA L4 (24 GB), ~50 min, peak 8.3 GB |
| Final train loss | 0.60 (from 1.50) |
The chat template is the SmolLM3 instruct template (supports /think and /no_think); <|im_end|> is the eos token.
Evaluation
GSM8K, zero-shot, lighteval 0.13 + vLLM, 256 generated tokens (the smol-course leaderboard setting):
| Model | extractive_match |
|---|---|
| SmolLM3-3B-Base | 0.104 |
| this model | 0.353 |
| HuggingFaceTB/SmolLM3-3B (official instruct) | 0.211 (its reasoning is longer and is cut by the 256-token limit) |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
m = "ttttim3/SmolLM3-3B-sft-smol-course"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForCausalLM.from_pretrained(m, dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "Give me three tips for sleeping better."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=400)[0][ids.shape[1]:], skip_special_tokens=True))