How Fine-Tuning Works
A pre-trained model like GPT-4 or Llama 3 learns general language understanding from trillions of tokens. Fine-tuning takes this foundation and trains it further on your specific data — typically thousands to millions of examples in a prompt-response format. The model's weights are adjusted to better handle your domain while retaining general capabilities.
Modern fine-tuning techniques like LoRA (Low-Rank Adaptation) and QLoRA modify only a small percentage of model weights, reducing compute costs by 10-100x compared to full fine-tuning. You can fine-tune a 70B parameter model on a single A100 GPU with QLoRA.
Fine-Tuning vs RAG vs Prompting
Use prompting first. It is cheapest, fastest, and requires no training data. If prompting fails because the model lacks domain knowledge or produces the wrong style/format, consider RAG or fine-tuning.
Use RAG when the model needs access to specific, changing documents — product catalogs, policy documents, research papers. RAG keeps knowledge current without retraining.
Use fine-tuning when you need to change the model's behavior, style, or reasoning patterns — not just its knowledge. Common use cases: consistent brand voice, domain-specific jargon handling, structured output formatting, and safety alignment for specific industries.
When Fine-Tuning Is Overkill
Most teams fine-tune too early. A well-crafted system prompt with few-shot examples solves 80% of customization needs. Fine-tuning is warranted only when you have clear evidence that prompting and RAG cannot achieve the required quality, and you have sufficient training data (minimum 500-1,000 high-quality examples).