/ module 09 · Inside the model
Fine-tuning
Pre-training gives a model general language ability. Fine-tuning teaches it a specific behavior, such as answering in a tone, following a format, or learning your domain. You change the weights with much smaller datasets and tiny learning rates.
- Compare full fine-tuning, LoRA and RLHF/DPO
- Spot overfitting from train and validation loss curves
- Pick a learning rate that is neither chaotic nor stuck
Try this first: Set dataset size very small and learning rate high, then Re-run.
methods
Three families of fine-tuning
Full fine-tuning, which updates every weight. Highest quality, highest cost.
LoRA / adapters, which freeze the base and train a small low-rank delta. Cheap, composable, the default in 2024+.
RLHF / DPO (Reinforcement Learning from Human Feedback / Direct Preference Optimization), which align the model to human preferences: people rank two answers, and the model learns to prefer the better one. This is how ChatGPT became helpful.
Try a tiny dataset with a high learning rate, then watch val loss diverge. Add dropout or more data to fix it.
Now feel it run. This simulated A100 fine-tunes your chosen method epoch-by-epoch, streaming GPU util, VRAM, tokens/sec, and a live train/val loss curve. Fine-tuning typically uses far less VRAM and finishes in minutes, not weeks.
Change Method, Dataset size, Dropout, or Epochs above and press Start, then the run rebuilds. Watch LoRA finish in a fraction of the VRAM of full fine-tuning.
Check yourself
Tick each one you could explain to a friend. If you can't yet, scroll back up and replay the lab.