Generative AI Tutorial 0/80 lessons ~6 min read Lesson 27
Fine-Tuning Basics
Fine-tuning updates an existing LLM's weights on your domain-specific data so it learns your tone, format and knowledge.
Course progress0%
Focus
7 guided sections
Practice signal
Examples included
Career prep
Foundation builder
Introduction
Fine-tuning updates an existing LLM's weights on your domain-specific data so it learns your tone, format and knowledge. It's the right tool when prompt engineering hits a ceiling.
Beginner analogy: The base model graduated college; fine-tuning is its on-the-job training at your company.
Understanding the topic
Core concepts to understand:
- Provide ~500–10,000 high-quality input/output pairs.
- Use LoRA / QLoRA for cheap fine-tuning of open models.
- OpenAI & Anthropic offer hosted fine-tuning APIs.
- Best for: tone, format, narrow tasks. Bad for: adding new factual knowledge.
Syntax reference
Visual workflow / architecture:
bash
Base model (Llama 3.1 8B)│ + LoRA adapter▼Fine-tuned model (your tone, your format)│▼Inference: same speed, cheaper than GPT-4
Real-world use
Replit Ghostwriter, Harvey AI (legal), and Bloomberg GPT all rely on fine-tuned models for domain accuracy and latency.
Best practices
- Try prompt engineering first — fine-tune only when it plateaus.
- Use LoRA — 100× cheaper than full fine-tuning.
- Always evaluate against the base model.
Common mistakes
- Fine-tuning to teach facts — use RAG instead.
- Overfitting on a tiny dataset.
Hands-on exercise
Interview preparation — practice these questions:
- Q1. When should you fine-tune vs prompt-engineer?
- Q2. What is LoRA?
- Q3. Why is fine-tuning bad at adding new knowledge?
Ready to mark this lesson complete?Track your journey across the entire course.