Instructions to use bestdive/SmolLM3-3B-SFT-Free-Course with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use bestdive/SmolLM3-3B-SFT-Free-Course with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM3-3B-Base") model = PeftModel.from_pretrained(base_model, "bestdive/SmolLM3-3B-SFT-Free-Course") - Notebooks
- Google Colab
- Kaggle
SmolLM3-3B SFT โ Free Course Project
Course project for Kay Zheng (bestdive), developed with AI assistance and trained on a free Colab Tesla T4. This repository contains the trained LoRA adapter, tokenizer, reproducible training code and actual training metrics. It does not claim official course-project acceptance or full-course certification.
Training
- Base revision:
d78a42f79198603e614095753484a04c10c2b940 - Dataset revision:
fc6cc2103c066455aade5d7fbb346039ae36ca5e - Dataset: SmolTalk2, config SFT, split
smoltalk_smollm3_everyday_conversations_no_think. - Deterministic sample: first up to 4096 records, shuffle seed 20260910, retain 16โ512-token conversations, select 1088, split 1024 train / 64 validation.
- QLoRA NF4; rank 16, alpha 32, dropout 0.05, all linear layers; one epoch, 128 updates, learning rate 1e-4.
- Training runtime: 975.87 seconds. Additional compute cost: 0.
Verified validation results
| Metric | Before SFT | After SFT |
|---|---|---|
| Held-out token loss | 1.349124789 | 0.680268705 |
| Held-out token accuracy | 0.679593565 | 0.792761523 |
These are teacher-forced metrics on 64 held-out conversations, not an independent benchmark or a general capability claim. Full GSM8K evaluation is complete; official leaderboard review is pending.
Loading
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
import torch
repo = "bestdive/SmolLM3-3B-SFT-Free-Course"
model = AutoPeftModelForCausalLM.from_pretrained(repo, torch_dtype=torch.float16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(repo)
The adapter configuration records the base model revision. For exact reproduction, follow the fixed revisions in train_sft.py. merge_model.py rebuilds full weights for the evaluation command; adjust its local paths for your environment.
Limits
This is a small instructional experiment with one epoch on everyday conversations. It can hallucinate and is not validated for production use. A reduction in validation loss does not establish improved math reasoning or safety. No paid inference endpoint is required or deployed.
Full GSM8K evaluation
Zero-shot extractive match: 40.864291% (539/1319), stderr 0.01354064, full test set with no sample limit. This is the post-SFT score; no before-SFT GSM8K comparison was run.
Original results, all 1319 per-question records, logs and dependency audit.
Free Colab T4 evaluation used Python 3.12, lighteval 0.11.0, vLLM 0.10.1.1, Transformers 4.57.1 and xxhash 3.5.0. A malformed evaluator dataset address was corrected to openai/gsm8k; xxhash was pinned after a detail-logging compatibility error. All 1319 generated answers were cached and reused for scoring. No question or scoring changes were made.
To evaluate the published adapter without retraining:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM3-3B-Base", revision="d78a42f79198603e614095753484a04c10c2b940", torch_dtype=torch.float16)
repo = "bestdive/SmolLM3-3B-SFT-Free-Course"
rev = "0484e028b494d605a267050a949c9266edadd16b"
model = PeftModel.from_pretrained(base, repo, revision=rev).merge_and_unload()
model.config.use_cache = True
model.save_pretrained("/content/kay-smol-sft-merged", max_shard_size="2GB")
AutoTokenizer.from_pretrained(repo, revision=rev).save_pretrained("/content/kay-smol-sft-merged")
Restart the notebook Python session to release model memory, then run install_evaluation.py followed by evaluate_gsm8k.py. The clean notebook includes the complete training workflow as an alternative.
- Downloads last month
- 11
Model tree for bestdive/SmolLM3-3B-SFT-Free-Course
Base model
HuggingFaceTB/SmolLM3-3B-Base