Modern AI Engineering

Lesson 8.1 · 23 min · video lesson

Fine-Tuning: Adapting a Pre-Trained Model to Your Task

A model that has read half the internet still does not know how your support team answers a refund question, so how do we teach it that without starting from scratch?

In short: Fine-tuning takes a model that is already trained (pretrained) and continues training it on a small, focused dataset so it behaves the way our task needs. We reuse everything the model already knows and only nudge its weights. We can nudge all weights (full fine-tuning) or train a tiny add-on such as LoRA, which is far cheaper.

What you will learn

  • What is Fine-tuning?
  • Why do we need Fine-tuning?
  • How does Fine-tuning work step by step?
  • A simple worked example with numbers
  • Full Fine-tuning vs LoRA
  • When to use Fine-tuning
  • Tips before we Fine-tune
  • Summary

In this lesson

  1. What is fine-tuning?
  2. Why do we need fine-tuning?
  3. How fine-tuning works, step by step
  4. A simple worked example with numbers
  5. Full fine-tuning vs LoRA
  6. When to use fine-tuning (and when not to)
  7. Tips before we fine-tune
  8. Common mistakes and how to spot them
  9. Practice: try it yourself
  10. Summary

Key terms in this lesson

Pretrained model
A model already trained on a large general dataset, used as the starting point.
Fine-tuning
Continued training of a pretrained model on a smaller, task-specific dataset.
Epoch
One full pass over the training dataset.
Learning rate
How big each weight update step is; kept small during fine-tuning.
PEFT
Parameter-efficient fine-tuning: freezing the base model and training a small number of new weights.
Catastrophic forgetting
Losing previously learned skills when training on new data.
Overfitting
Memorising training examples so performance on new data gets worse.

This lesson is part of the Generative AI Engineering and Complete AI Engineer tracks. See plans and pricing to open the full lesson, its video, labs and quiz, or try the free lesson first (free account needed).

← 7.5 Jev and System One: Fast vs Deliberate AI Thinking · 8.2 LoRA: Parameter-Efficient Fine-Tuning via Low-Rank Matrices →