Fine-tune a small open model
Train a small adapter (LoRA) on your dataset and prove with the test rows whether it beat the baselines.
-
Convert train and validation rows to chat format: the email in, the label out
Run this to check
head -n 1 data/train.chat.jsonlYou pass when
One JSON line with a messages list: a user message and a one-word assistant message.
Files you write
- data/train.chat.jsonl
- data/valid.chat.jsonl
-
Score the untuned small model on the test rows
Run this to check
uv run eval_tuned.py --baseYou pass when
An accuracy number, usually below your classic baseline.
Files you write
- eval_tuned.py
-
Train an adapter and log training and validation loss every 50 steps
An adapter trains a few million numbers and leaves the model untouched, which is why it fits on a laptop.
Run this to check
tail -n 5 train.logYou pass when
Both losses went down from the first line of the log. The adapter is a small file, not a new model.
Files you write
- train.log
- adapters/
-
Find the step where validation loss stops falling and keep that checkpoint
When training loss keeps falling and validation loss turns up, the model is memorising. Stop there.
Run this to check
uv run eval_tuned.py --adapter adapters/You pass when
A tuned accuracy on the same 30 rows. In RESULTS.md, say which step you kept and why.
Files you write
- RESULTS.md