How Large Language Models Work

Course Overview
Beginner
Free Course

For developers and technical learners who use LLMs and want to know what happens inside them, from tokenisation and attention to training, sampling and alignment. You will be able to work the key numbers by hand, measure them in a real model, and use them to reason about cost, context, decoding settings and fine-tuning choices.

Instructor: Jaidev
Sections: 3

Course Content

Section 1: Inside the LLM

Follow text through a model's input path and one transformer block — tokens, embeddings, positions, attention, normalisation and feed-forward layers — with the arithmetic worked by hand.

Section 2: Training and Inference

See what a model is trained to do and how it produces text — next-token loss, compute budgets, decoding and sampling, and the post-training stages (fine-tuning, preference optimisation and reasoning RL) that turn a text predictor into an assistant.

Section 3: Mini Project

Open GPT-2 small and measure what the course described — tokenisation, surprisal and entropy, an induction head, decoding strategies and KV-cache memory — with code you run yourself.