Fine-tuning takes a pretrained model — which already understands language and carries broad world knowledge — and trains it further on a smaller, curated dataset targeted at a specific use case.
Think of pretraining as graduating from a comprehensive university education. Fine-tuning is the internship — you arrive with general knowledge and learn the specific tools, vocabulary, and norms of one particular environment. The general education stays intact; specialized behavior gets layered on top.
A pretrained model is capable but general. Fine-tuning shifts the model's behavior toward a specific domain, style, or task type.
Medical — train on clinical notes so the model understands medical terminology, dosage conventions, and clinical reasoning patterns
Legal — train on case law and contracts so the model handles legal language and citation formats accurately
Customer support — train on past support tickets and resolutions so the model handles company-specific scenarios correctly
Internal code — train on a private codebase so the model understands internal APIs, naming conventions, and architecture patterns
Brand voice — train on examples of company communication so the model consistently matches tone and style
Trillions of tokens from diverse sources. Months of compute on thousands of GPUs. Costs tens to hundreds of millions of dollars. Builds all foundational knowledge from scratch.
Thousands to millions of domain-specific examples. Hours to days of compute on a handful of GPUs. Costs hundreds to thousands of dollars. Adapts existing knowledge to a target domain.
In supervised fine-tuning, training data consists of input-output pairs: a prompt and the desired response. The model learns to produce outputs that match the desired format, vocabulary, and reasoning style.
Tell the model what to do at inference time via instructions in the prompt.
No training required. Fast to iterate. Works with closed API models.
Best for: quick iteration, flexible tasks, no labeled data available.
Bake the behavior into the model weights through additional training.
More consistent and robust for the target domain. Requires curated data and compute.
Best for: high-volume production use, private data, performance that prompting cannot reach.
Fine-tuning cannot inject large-scale factual knowledge that was absent from pretraining. If the base model was not pretrained on medical research, fine-tuning on a few thousand Q&A pairs will teach it medical surface patterns — but it may still hallucinate medical details with confidence. Fine-tuning works best when the base model already has foundational domain knowledge and you are shaping style, format, and task-specific behavior.
A key risk in fine-tuning is catastrophic forgetting: heavy fine-tuning on a narrow dataset improves the target domain but degrades performance on everything else.
Mix in general data — include a portion of diverse general-purpose examples alongside domain-specific ones to preserve breadth
Fine-tune for fewer epochs — over-training on a small dataset accelerates forgetting; stop early and monitor general benchmarks
Use parameter-efficient methods — update fewer parameters so the general knowledge encoded in frozen weights is preserved
Full fine-tuning updates all model parameters. PEFT methods update only a small fraction, dramatically reducing cost while achieving most of the benefit.
Adds small trainable matrices alongside frozen original weights. The original model stays unchanged; only the small adapters are trained.
Can train in hours on consumer hardware. Widely used for open-weight models like Llama.
Inserts small trainable modules between transformer layers. Original weights are frozen.
Modular — you can swap different adapters to change the model's behavior without retraining the base.
Ask the AI if you need help understanding fine-tuning, the difference between fine-tuning and prompting, catastrophic forgetting, LoRA, or when to choose fine-tuning over prompt engineering for your use case.