LLM Foundations
See inside the models, not just the chat box.
What large language models really do, from tokens and embeddings through attention, training and alignment, to running them fast and cheaply and using them safely. Vendor-neutral: closed and open-weight models, on APIs, cloud platforms or your own GPUs. By the end you can explain how an LLM works, choose one for a job, and predict where it will fail.
- 8
- chapters
- 26
- modules
- ~12h
- of learning
- 26
- live now
Take modules in any order. The route suggests one that builds up naturally.
has a live module in progress complete
Take a look inside
The big picture, before the details
What every LLM does: read the tokens, score every possible next one, pick, repeat. Real scores from a small open model.
model · 24 layers
1. Text is split into tokens.
Real scores from a small open model (Qwen2.5-0.5B (base)). Bars are scaled to the top candidate; ␣ marks a token that starts with a space.
A taste of module 7: turn the temperature on the same model's real odds, then pick a word.
My favourite South Indian breakfast is a simple but ___
The big picture
What a language model does, and the raw material it works with.
3 modules · 80 min
Beginner
What an LLM actually does
A machine that predicts the next word, astonishingly well, over and over.
Beginner
Tokens
The pieces models actually read, and why they explain cost, limits and odd mistakes.
Beginner
Embeddings: meaning as coordinates
How text becomes points in space, where closeness means similar meaning.
Inside the transformer
The architecture behind every modern language model.
4 modules · 110 min
Core
Attention
How each word decides which other words to pay attention to.
Core
The transformer block
One token's journey through the layers of a model.
Core
Positions & the context window
Why word order must be added in, and why long inputs cost so much.
Core
From scores to words: sampling
How the model's scores become the next word, and what temperature really does.
How models learn
Pretraining, fine-tuning, alignment and reasoning.
4 modules · 110 min
Core
Pretraining & scaling laws
How reading trillions of tokens teaches a model, and how to spend a compute budget.
Core
From base model to assistant
Why a raw model continues your text, and how fine-tuning makes it answer.
Core
Alignment: RLHF, DPO & friends
How human preferences shape what assistants say, and refuse to say.
Core
Reasoning models
Models that think before they answer, and what that costs.
Using models well
Prompts, tools, context and the limits of what models know.
4 modules · 105 min
Applied
Prompting fundamentals
Clear instructions, good examples and the right format.
Applied
Structured output & tool calling
Getting reliable data out of models, and letting them use other software.
Applied
Context engineering
Deciding what goes into the context window, and what stays out.
Applied
Hallucinations
Why fluent models state false things confidently, and what actually helps.
Running models
Speed, memory, throughput and cost.
4 modules · 100 min
Core
Inference: prefill, decode & the KV cache
Where the time goes between pressing Enter and the last word.
Core
Model size, memory & quantization
Will this model fit on this GPU, and what do you lose by shrinking it?
Core
Serving at scale
Many users, one GPU: batching, throughput and latency.
Applied
Cost & latency estimation
Estimate what an AI feature will cost each month, and how fast it will feel.
The model landscape
Choosing among models, modalities and sizes.
3 modules · 75 min
Applied
Open vs closed models
Weights, licences and where a model can run.
Core
Multimodal models
Models that see images, read documents, hear and speak.
Applied
Small & on-device models
When a small, focused model beats a giant one.
Safety & responsibility
Attacks, privacy and building systems people can trust.
2 modules · 55 min
Capstones
Put it all together.
2 modules · 80 min