Free · No sign-up · Self-paced

How to build an LLM, starting from nothing

A structured, beginner-friendly path through Andrej Karpathy’s deep-dive material — from “what is a neural network” to a working GPT you trained yourself.

Karpathy’s lectures are the best material on this subject that exists, and they are free — but they are also about 24 hours long, in no stated order, and assume you know when to stop and practise. This page is the missing scaffolding: what to watch, in what order, what to build after each one, and how to tell whether you have understood it before the next module quietly assumes you did.

11
modules
44
exercises
~24h
of lectures
~50h
total work

What you will have built

Not a reading list. Every module ends with code you wrote and a checkpoint you can test yourself against.

An autograd engine

Backpropagation written by you, from an empty file, over single numbers — so PyTorch stops being magic.

A character-level language model

First by counting, then as a neural network, then with embeddings and a hidden layer that can actually scale.

A working GPT

Self-attention, multi-head blocks, residuals and layer norm — trained on Shakespeare, then on text of your own.

A byte-pair-encoding tokenizer

The real one, with regex splitting and special tokens, plus the ability to explain half of LLM weirdness.

A GPT-2 (124M) reproduction

Faithful enough to load OpenAI’s published weights, then trained with the full modern recipe.

An assistant, not just a base model

Your own supervised-finetuning dataset, and a clear grasp of what RLHF and reasoning training add.

What you need first

Genuinely less than people expect. The course is built for someone who can write Python and has never trained a model.

  • Python you can read and write — functions, classes, lists, loops. No more than that.
  • A vague recollection that a derivative measures a rate of change. The course re-teaches what it needs.
  • A laptop. Modules 0 to 8 run fine on CPU, or on a free Colab GPU.
  • For module 9 only: a rented cloud GPU. Karpathy puts the full GPT-2 run at roughly an hour and about $10.
  • No machine learning experience. No PyTorch experience. No university maths.

How to study this

Almost nobody fails this material through lack of ability. They fail it by watching it. Six rules make the difference.

Type the code, never copy it

The whole value is in your fingers finding the errors. Copying a notebook and running it teaches you approximately nothing, and it feels like learning, which is what makes it dangerous.

Budget three hours of practice per hour of video

These lectures are dense. The times on each module below already assume this, and it is why the course is measured in weeks rather than a weekend.

Pause before every reveal

When Karpathy poses a question or starts a change, pause and attempt it first. Being wrong first is what makes the answer stick.

Attempt the exercises before you watch the solution

Every module here ends with a checkpoint. If you cannot meet it, repeat the module — the next one assumes it, and the difficulty compounds quietly.

Keep a lab notebook

One file per module: what you changed, what the loss did, what confused you. Most of what you learn is in the failed runs, and you will forget them by the following week.

Expect to feel slow in module 1 and 5

Backpropagation is the hardest conceptual step and it comes early. Everybody finds it heavy. It does not mean you are unsuited to the rest.

The syllabus

Work top to bottom. Each module states what it assumes, so if a checkpoint fails you know exactly which earlier module to repeat.

Your progress

0 of 44 exercises complete. Saved on this device only — no account needed.

In plain language

An LLM is a program that has read a very large amount of text and learned one narrow skill extremely well: guessing what comes next. Everything else — answering questions, writing code, refusing a request — is that one skill wrapped in layers of training. This lecture walks the entire assembly line end to end: where the text comes from, how it is chopped into tokens, what the network does with them, and how a document-completing “base model” is turned into the assistant you actually talk to. Watch it before touching code, because every later module is a zoomed-in view of one station on this line.

Before you start: Nothing at all. No maths, no code, no ML background.

What you will learn

  • Where training data comes from, and how 2.7 billion crawled web pages become a clean 44 TB dataset
  • What a token is, and why the model sees text quite differently from how you see it
  • What is actually inside the network, and what “inference” means
  • Why a base model is not an assistant, and what post-training adds
  • Where hallucinations come from, and why tool use fixes a real limitation rather than papering over it
  • Why models need tokens in order to think, and what “jagged intelligence” means in practice

Practical exercises

Checkpoint before moving on

You can draw the pipeline on one sheet of paper — internet text → tokens → network → base model → post-training → assistant — and say in a sentence what each arrow does.

Final project

Capstone: read the whole thing on one page, then build yours

Karpathy’s microgpt is 200 lines of pure Python with no dependencies, and it contains the entire pipeline: a dataset, a tokenizer, an autograd engine, a GPT-2-style network, the Adam optimizer, a training loop and an inference loop. Every one of those is a module you have now done. Read it and label each section with the module it came from — if you can do that, the course has worked. Then build your own: pick text that matters to you, train a small model on it end to end, and write up what you did and where it fell short.

  1. 1Read microgpt top to bottom and annotate each block with the module that taught it.
  2. 2Re-derive one section from memory in an empty file, then diff yours against his.
  3. 3Assemble your own small LLM: your tokenizer from module 8, your architecture from module 7, your training recipe from module 9.
  4. 4Train it on a corpus you care about, and evaluate it against a baseline rather than by vibes.
  5. 5Write it up — the architecture, the numbers, what surprised you, what you would do next.

Where this comes from

Every lecture linked here was made by Andrej Karpathy — a founding member of OpenAI, former Sr. Director of AI at Tesla, and now the founder of Eureka Labs. The videos and the code repositories are his and are published free on YouTube and GitHub under his own terms. Nothing on this page is a copy of them, and nothing is for sale.

What FindAmNow added is the part that was missing for a beginner: an order to watch them in, the prerequisites for each, exercises with a stated finishing condition, and a checkpoint per module so you can catch a gap before it compounds. If you find this useful, the right thing to do is watch the originals in full and star the repositories.

Know someone who wants to understand this properly?

It is free and needs no account. Send them the path.