Orientation & Setup
Module 00 — Orientation & Setup
Goal of this module: Give you the mental map of the whole field, set up the tools you’ll need, and make sure you know how to get unstuck. No fine-tuning yet — just orientation.
1. The one-paragraph version of the whole course
A large language model is a giant function that, given some text, predicts what text comes next. It learned this by reading an enormous amount of the internet during a phase called pretraining. That makes it broadly capable but generic — it doesn’t know your company, your style, your task, or your data. Fine-tuning is the process of continuing that training on a smaller, focused dataset so the model becomes good at your specific thing. Everything else in this course — LoRA, PEFT, SFT, synthetic data, evaluation, deployment — is about doing that well, cheaply, and safely.
That’s it. Hold that paragraph in your head; every module is a zoom-in on one part of it.
2. A map of the territory
Here is the landscape you’re about to learn, drawn as a journey rather than a list.
┌─────────────────────────────────────────────────────────┐
│ A BASE MODEL EXISTS │
│ (someone spent millions pretraining it on the internet) │
└───────────────────────────┬─────────────────────────────┘
│
"It's smart but generic. I need it to do MY task."
│
┌────────────────────────────▼─────────────────────────────┐
│ STEP 1: Should I even fine-tune? (Module 02) │
│ Maybe prompting or RAG is enough. Decide first. │
└────────────────────────────┬─────────────────────────────┘
│ "Yes, fine-tuning is right."
┌────────────────────────────▼─────────────────────────────┐
│ STEP 2: Get data (Modules 04, 09, 10) │
│ Collect, generate (synthetic), clean, format it. │
└────────────────────────────┬─────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────┐
│ STEP 3: Train (Modules 03, 05, 06, 07, 08, 12) │
│ SFT to teach behavior; LoRA/QLoRA to do it cheaply; │
│ DPO/RLHF to align taste. │
└────────────────────────────┬─────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────┐
│ STEP 4: Evaluate (Module 11) │
│ Prove it's actually better. Don't trust vibes. │
└────────────────────────────┬─────────────────────────────┘
│
┌────────────────────────────▼─────────────────────────────┐
│ STEP 5: Deploy & serve (Module 14) │
│ Merge, quantize, host, monitor. │
└───────────────────────────────────────────────────────────┘
Notice this is a loop, not a line. Real practitioners go around it many times — evaluation reveals a data problem, you fix the data, you retrain, you re-evaluate. Getting comfortable with that loop is the expertise.
3. Key terms you’ll meet immediately (plain-language preview)
You’ll see these constantly. Here’s the friendly version; precise definitions live in the Glossary.
- Base model / foundation model — the big pretrained model you start from (e.g., Llama, Mistral, Qwen, Gemma). Think of it as a very well-read but generic graduate.
- Fine-tuning — extra training to specialize the model.
- SFT (Supervised Fine-Tuning) — fine-tuning by showing the model examples of input → desired output. The workhorse.
- PEFT (Parameter-Efficient Fine-Tuning) — a family of tricks that update only a tiny slice of the model instead of all of it, saving enormous time and memory.
- LoRA (Low-Rank Adaptation) — the most popular PEFT method. Instead of editing the model’s giant weight matrices, you add small “patch” matrices and train only those.
- QLoRA — LoRA on top of a quantized (compressed) model, letting you fine-tune very large models on a single consumer GPU.
- Synthetic data — training examples generated by another AI model rather than collected from humans.
- Inference — actually using the model to get answers (as opposed to training it).
- Token — the unit of text the model reads and writes; roughly a word-piece. (Full treatment in Module 01.)
4. Prerequisites — and how to fill any gaps
You need:
- Comfort reading basic Python. Variables, functions, loops, importing libraries, and dictionaries/lists. You do not need to be a strong programmer.
- Willingness to use the command line a little (running a script, installing a package).
- High-school-level comfort with the idea of math. You’ll see things like “multiply two matrices” and “minimize an error.” We always explain what these mean. You will never be asked to do calculus by hand.
You do NOT need: a math degree, a powerful computer, prior machine-learning experience, or money. Everything in this course can be done on free tiers.
If your Python is rusty, spend an hour with any “Python in 1 hour” tutorial before Module 05 (the first code-heavy module). That’s enough.
5. Tools and environment
You have three realistic options for actually running fine-tuning. You can read the whole course without any of them, but you’ll learn far more by running things.
Option A — Google Colab (recommended for beginners)
A free, browser-based notebook with a free GPU (often a T4, ~16 GB). No installation. Perfect for everything up to fine-tuning ~7–8B models with QLoRA. A paid tier (Colab Pro) gives bigger GPUs cheaply when you need them.
Option B — A cloud GPU rental
Services like RunPod, Lambda, Vast.ai, or the big clouds rent GPUs by the hour (often a few dollars/hour for a capable card). Best when you outgrow Colab.
Option C — Your own GPU
An NVIDIA GPU with at least 8 GB of VRAM lets you do real QLoRA work locally. 16–24 GB is comfortable. Apple Silicon (M-series) Macs can do smaller experiments via MLX, though most tutorials assume NVIDIA/CUDA.
The core software stack you’ll use
You don’t install these yet — just recognize the names when they appear:
- PyTorch — the underlying deep-learning framework that does the math on the GPU.
- Hugging Face
transformers— loads models and tokenizers; the de-facto standard library. - Hugging Face
datasets— loads and processes training data. peft— Hugging Face’s library implementing LoRA and friends.trl— “Transformer Reinforcement Learning”; provides ready-madeSFTTrainer,DPOTrainer, etc.bitsandbytes— handles quantization for QLoRA.- Unsloth / Axolotl — higher-level wrappers that make fine-tuning faster and simpler. Great once you understand the basics underneath.
Expert habit: Learn the lower-level stack (
transformers+peft+trl) first, even though it’s more verbose, so you understand what the convenient wrappers are doing. Then switch to Unsloth/Axolotl for speed. Tools that hide the machinery are a trap if you never learned the machinery.
6. How to get unstuck (the meta-skill)
The difference between someone who finishes this course and someone who quits is almost never talent — it’s how they handle being stuck. Three rules:
- Read the error message slowly, bottom to top. Python tracebacks put the actual cause at the bottom. 80% of fine-tuning errors are out-of-memory, a shape mismatch, or a tokenizer/template problem — all of which say so if you read carefully.
- Change one thing at a time. When something breaks, resist the urge to change five settings at once. You’ll never learn which one mattered.
- Keep a lab notebook. For every training run, write down: the base model, the dataset, the key hyperparameters, and what happened. Experts run dozens of experiments; without notes they all blur together. This single habit will make you look like a pro within weeks.
7. What “mastery” actually means here
By the end you won’t have memorized commands — those change. Mastery in this field means:
- You can frame a problem correctly (the right technique for the right job).
- You can reason about trade-offs (memory vs quality, speed vs accuracy, data size vs overfitting).
- You can debug from first principles because you understand what each step is doing.
- You can read a brand-new paper or library and slot it into the mental map you’re building now.
That mental map starts in the next module, where we open up the model itself and see what’s inside.
Module 00 checklist
- I can state the one-paragraph summary of fine-tuning in my own words.
- I can name the five steps of the fine-tuning loop.
- I’ve chosen which environment (Colab / cloud / local) I’ll use.
- I’ve started a lab notebook (even just a text file).