LLM Fine-Tuning & Adaptation
Learn when and how to fine-tune LLMs. Master LoRA, QLoRA, dataset preparation, training pipelines, and serving your adapted models in production.
Curriculum
Lesson 1: Fine-Tune vs. RAG vs. Prompt Engineering
Navigate the decision tree: when prompting is enough, when RAG is the right answer, and when fine-tuning is genuinely necessary. Understand cost, latency, and maintainability trade-offs.
Lesson 2: Supervised Fine-Tuning (SFT) Deep Dive
Understand full-parameter SFT: how it shifts model weights to align with new training data, the cross-entropy loss objective, and why catastrophic forgetting is a real risk.
Lesson 3: Parameter-Efficient Fine-Tuning: LoRA & QLoRA
Learn how LoRA injects trainable low-rank matrices without touching base model weights. Understand how QLoRA adds 4-bit quantization to make 70B model fine-tuning feasible on a single GPU.
Fine-tuning Large Language Models
When and why to fine-tune an LLM, plus the key techniques: LoRA, QLoRA, and full fine-tuning.
Lesson 4: Preparing Your Fine-Tuning Dataset
Format training data as instruction-response JSONL pairs, clean and deduplicate, balance classes, and validate quality. Learn the minimum data size rules of thumb for different tasks.
Lesson 5: Training Your First Fine-Tuned Model
Use the Hugging Face Trainer with LoRA adapters to fine-tune a Mistral 7B model on a custom dataset. Set learning rate, batch size, and warmup steps. Monitor loss curves.
Lesson 6: Evaluating Fine-Tuned Models
Measure perplexity on held-out data, run task-specific benchmarks, compare fine-tuned vs. base model side-by-side, and use LLM-as-judge to score instruction-following quality.
LoRA: Low-Rank Adaptation Explained
How LoRA works — train only a fraction of parameters while achieving near-full fine-tuning performance.
Lesson 7: Serving Fine-Tuned Models in Production
Merge LoRA adapters back into the base model for deployment, serve with vLLM for high-throughput inference, and run locally with Ollama. Compare serving options by latency and cost.
Lesson 8: Capstone — Fine-Tune a Domain Expert
End-to-end fine-tuning project: curate a domain-specific dataset, fine-tune with QLoRA, evaluate against the base model, and deploy via a FastAPI inference endpoint.
Deploy Fine-Tuned LLMs to Production
End-to-end walkthrough of serving a fine-tuned model — from training checkpoints to production APIs.
Course Quiz
5 questions · ~5 min · Pass 4/5 to unlock your badge