What is model fine-tuning?
Quick Answer
Model fine-tuning is the process of further training a pre-trained AI model on your specific data to adapt its behaviour for your particular use case. It adjusts the model's internal parameters using labelled examples of desired inputs and outputs. Fine-tuning is used when you need consistent output formatting, domain-specific behaviour, or performance improvements that prompt engineering alone cannot achieve.
Summary
Key takeaways
- Adapts pre-trained models to specific tasks using your example data
- Best for changing model behaviour, tone, or output format
- Requires curated training data of 50 to 10,000+ examples
- More complex and costly than prompt engineering or RAG approaches
When Fine-Tuning Makes Sense
The Fine-Tuning Process
FAQ
Frequently asked questions
For instruction fine-tuning, 100 to 1,000 high-quality examples is typically sufficient. For more complex behaviour changes, you may need 1,000 to 10,000 examples. Quality matters far more than quantity; 100 excellent examples outperform 10,000 mediocre ones.
Fine-tuning costs vary by model and provider. OpenAI fine-tuning starts at a few hundred pounds for smaller datasets. Self-hosted fine-tuning using open-source models requires GPU compute costs of £100 to £5,000+ depending on model size and training duration.
This is called catastrophic forgetting and it can occur if fine-tuning is done incorrectly. Using appropriate learning rates, limiting training epochs, and including some general-purpose examples in your training data mitigates this risk.
Fine-tuning time varies by model size and dataset. Small models (7B parameters) can be fine-tuned in 1 to 4 hours on modern hardware. Larger models (70B+) may take 12 to 48 hours. Cloud-based fine-tuning through providers like OpenAI typically completes within a few hours for standard datasets.
Yes, and this is one of the key advantages of open-source models. Techniques like LoRA and QLoRA make fine-tuning efficient even on consumer-grade GPUs. Hugging Face provides comprehensive tooling for fine-tuning. You retain full ownership of the resulting model.
Have more questions about AI?
Our team can help you navigate the AI landscape. Book a free strategy call.