Practical guide to fine-tuning pre-trained models for your use case.
When to fine-tune vs prompting:
- Try prompting first (cheaper, faster)
- Fine-tune for consistent formatting, domain knowledge, or cost optimization
Steps:
1. Prepare dataset: Min 100 quality examples (500+ better), instruction/input/output pairs
2. Choose base model: Llama 3 70B (quality), Mistral 7B (resource-constrained), Phi-3 (edge)
3. Method: LoRA (practical), QLoRA (single GPU), Full (serious compute)
4. Train: lr=2e-5, batch=4, epochs=3, monitor eval loss
5. Evaluate: Test held-out examples, compare with base + good prompting, A/B test in prod