r/learnmachinelearning • u/Longjumping_Golf9903 • Oct 29 '26
Project First time fine-tuning: my LoRA made a 2B model worse, and the mistakes taught me more than the wins
I’m not an ML engineer. I build a small desktop app that runs Gemma 4 E2B offline, and I wanted to teach it a few things it’s bad at. So I tried LoRA with MLX on my MacBook. Writing down what happened in case it helps someone else starting out.
What I did right (by luck): before training I wrote a 23-question “sealed” exam that never goes into the training data. Same prompt, temperature 0, graded by hand. Without it I’d have fooled myself. The same model scored 7/10 on the trick questions in Ollama at temp 0.4 and 3/10 in MLX at temp 0, so numbers from different setups mean nothing.
Baseline: 6/23.
Run 1: 328 hand-written examples, lr 5e-5, 16 layers, 75 steps. Score dropped to 4/23. It started answering “2 + 2 × 2 = 4” (it was right before), and it used my “I don’t know, I’m offline” template on a simple riddle. It copied the shape of my answers instead of learning anything new.
Run 2: lower lr (1e-5), 8 layers, fewer template answers, and “replay”: I added the base model’s own answers to 117 normal questions so it wouldn’t forget. Score went back to 6/23. No forgetting, but no gain either.
What I took from it:
- A few hundred examples change how a small model answers, not what it knows.
- Template answers leak into everything.
- Replay is a simple fix for forgetting.
- Always keep a test set the model never sees.
If you’ve fine-tuned a model this small: did you manage to add knowledge, or only style? What would you change in my setup?
1
u/CelebrityChess Oct 29 '26
for a laptop-sized embedding model, bge-small-en-v1.5 or all-MiniLM-L6-v2 are the usual picks, both are tiny (tens of MB) and run fine on cpu. nomic-embed-text is a bit bigger but handles longer chunks. for personal files i'd chunk to something like 200-400 tokens with a little overlap and also add plain keyword search (bm25) next to the embeddings, because embeddings are bad at exact names and numbers and bm25 catches those. and on your actual question, yeah that matches what people usually see: a few hundred examples with lora shifts style/format much more than it adds facts.
1
u/amargolin Oct 29 '26
the sealed exam was the right call. one caution on reading it: with 23 questions, 6 -> 4 is two questions, which is about the swing you saw yourself (7/10 vs 3/10 on the same model between Ollama and MLX).
before concluding run 1 made it worse, i'd rerun the base model a few times (different seeds, or temp > 0 with several samples per question) to get its own spread, and compare per-question flips rather than the total. a change only means something if it's bigger than the base model's run-to-run swing.
also worth growing the exam past 23, and hiding which model produced each answer when you grade by hand.
1
u/DeepRatAI Oct 29 '26
The first time I finetuned a model (Phi), I dropped down it's IQ to the floor xD. Literally, I took a pretty decent model and transformed it into a retarded. Anyways, I have some papers to share with you about fine-tuning SLLM, if you want I can share them with you
6
u/[deleted] Oct 29 '26 •
[removed] — view removed comment
0
u/[deleted] Oct 29 '26
[removed] — view removed comment