Module 10 of 12

Pretraining & Fine-Tuning

Lessons

About This Module

Modern language models are built in stages. Pretraining comes first: a transformer reads a huge amount of text and learns to predict the next token. That one simple objective forces it to pick up grammar, facts and patterns of reasoning, and the result is a base model that continues text but does not yet follow instructions.

Fine-tuning adapts that base model. With supervised fine-tuning it trains on examples of good answers to prompts, and with reinforcement learning from human feedback (RLHF) it is pushed toward responses people prefer. Reusing a pretrained model this way is far cheaper than training from scratch, which is the same transfer learning idea you met with images.

Watch the lessons in order, then continue to Generative Models.

Lessons

5 videos
01

Large Language Models explained briefly

3Blue1Brown gives a short, visual introduction to what a language model does, how it predicts the next word, and how pretraining followed by tuning produces a chatbot.

Video 7min
02

[1hr Talk] Intro to Large Language Models

Andrej Karpathy explains what an LLM is, how it is trained in stages, and where it is heading. A good big-picture talk for newcomers.

Video 59min
03

State of GPT | BRK216HFS

Karpathy walks through the full training pipeline for GPT-style assistants: pretraining, supervised fine-tuning, reward modeling and reinforcement learning.

Video 42min
04

Reinforcement Learning with Human Feedback (RLHF), Clearly Explained!!!

StatQuest explains how human preferences are turned into a reward signal and used to fine-tune a language model so its answers become more helpful.

Video 18min
05

Deep Dive into LLMs like ChatGPT

A long, thorough Karpathy session covering pretraining data, tokenization, base models and post-training. Best watched after the shorter videos above.

Video 3h 31min