SmolLM3-3B-GSM8K-QLoRA
Unit 1 project for the Hugging Face smol course. HuggingFaceTB/SmolLM3-3B-Base fine-tuned with QLoRA (TRL SFT)
on step-by-step GSM8K solutions,
formatted exactly like the lighteval|gsm8k|0|0 prompt (Question: ...\nAnswer:), ending with
The final answer is N. so answers fit in the eval's 256-token budget. LoRA adapter merged into bf16 weights.
Training
- Data: GSM8K train split only (calculator annotations removed); 300 examples held out for validation
- QLoRA: 4-bit NF4 base, LoRA r=16, alpha=32, dropout 0.05, all linear layers
- 2 epochs, lr 0.0002, cosine schedule, effective batch 16, max length 512, fp16 on a free Colab T4
- Loss on completions only; final validation loss 0.530
Quick check (first 200 GSM8K test questions, greedy, 256 tokens, 4-bit)
| Model | Accuracy |
|---|---|
| HuggingFaceTB/SmolLM3-3B-Base | 3.5% |
| This model | 70.0% |
Official leaderboard number: see the lighteval results dataset moekotb12345/details_moekotb12345__SmolLM3-3B-GSM8K-QLoRA_private.
Usage
from transformers import pipeline
pipe = pipeline("text-generation", model="moekotb12345/SmolLM3-3B-GSM8K-QLoRA")
print(pipe("Question: A pen costs $3 and a notebook costs twice as much. How much for 2 of each?\nAnswer:",
max_new_tokens=256, stop_strings=["Question:"], tokenizer=pipe.tokenizer)[0]["generated_text"])