Lessons38
0/38 modules masteredStart Here
2 lessons · 30 minNo maths: what a large language model is, how it learns to guess the next word by counting, and how attention lets each word look at the words that help. Pictures, a tally and four words.
What Is a Large Language Model?
Up NextA large language model is a very good guesser of the next piece of text. How that skill is learned by counting, what makes a model large, and what it does not do, with no maths.
Attention in Pictures
How a language model decides which earlier words matter, shown with a spotlight that has a fixed budget, four words, a hand trace of the numbers and a tiny numpy program.
Foundations
3 lessons · 2 hrHow text becomes tokens and then vectors, before the full attention machinery.
Tokenization
BPE, WordPiece, SentencePiece — how raw text becomes tokens that models can process.
Word Embeddings: From Words to Vectors
Word2Vec, GloVe, and embedding layers — how words become meaningful vectors that capture meaning.
Embeddings: Categorical to Word2Vec
From one-hot codes to learned embedding tables: entity embeddings for tabular data, then Word2Vec, GloVe and FastText for words.
Core: How Transformers Work and Learn
11 lessons · 6 hrMulti-head attention, positions, the full transformer, the three families (BERT, GPT, T5 and BART), scaling, decoding, prompting, fine-tuning, RLHF and reasoning models.
Multi-Head Attention
Why one attention head is not enough, and how multiple heads capture different relationships in parallel.
Positional Encoding
How transformers understand sequence order without recurrence — sinusoidal, learned, RoPE, ALiBi.
The Full Transformer
Putting it all together: encoder, decoder, layer norms, and residual connections.
BERT & Encoder Models
Masked language modeling, bidirectional attention, and why encoders dominate understanding tasks.
GPT & Decoder Models
Causal masking, autoregressive generation, and the GPT family evolution from GPT-1 to GPT-5.
Encoder-Decoder Models: T5, BART & Span Corruption
T5, BART, Flan-T5 — the third architecture family. Span corruption, denoising, and when encoder-decoder beats decoder-only.
Decoding Strategies
Greedy, beam, top-k, top-p, temperature, speculative decoding — turning a token distribution into actual text.
Prompt Engineering
Zero-shot, few-shot, chain-of-thought, prompt injection, and practical prompt design.
Fine-Tuning LLMs: LoRA, QLoRA & Beyond
When to fine-tune vs prompt engineer. LoRA, QLoRA, and the SFT pipeline — customize any LLM on a single GPU.
RLHF & DPO: Aligning LLMs with Human Preferences
The alignment pipeline — SFT, reward modeling, PPO, DPO, and Constitutional AI. How every major LLM learns to be helpful, harmless, and honest.
Reasoning Models & Test-Time Compute
How reasoning models spend more compute on harder questions — extended thinking, process reward models, and the test-time scaling paradigm.
Advanced: Efficiency, Architectures and Practice
15 lessons · 8 hrFlashAttention and inference tricks, mixture of experts, state space models, vision and multimodal transformers, the model landscape, GRPO, constitutional training, merging, pretraining data, distributed training, safety and evaluation.
Attention Efficiency: FlashAttention, GQA, KV Cache
The modern efficiency stack — FlashAttention, GQA/MQA, KV cache, paged attention, sliding window, attention sinks.
Inference Efficiency: Quantization, Speculative Decoding, vLLM
Making LLMs cheap and fast at inference — GPTQ/AWQ/GGUF quantization, speculative decoding, vLLM PagedAttention serving.
Scaling Laws & Emergent Abilities
Kaplan, Chinchilla, emergent abilities — the laws that govern how loss falls with compute, data, and parameters.
Mixture of Experts
Switch Transformer, Mixtral, GShard — total params scale much faster than active params per token.
State Space Models & Alt-Architectures
Mamba, S4, RWKV, Hyena — linear-time sequence models that compete with attention on quality.
Vision Transformers: ViT, Swin & DEiT
ViT, Swin, DEiT, MAE, DINOv2 — how transformers process images as patch sequences.
Multimodal Transformers
Visual encoder + projection + LLM — how Gemini, Claude 3, GPT-4V, LLaVA understand images alongside text.
Modern LLM Landscape & Evaluation
GPT-4o/Claude 4/Llama-3/Gemini/DeepSeek/Qwen survey + MMLU/HumanEval/MT-Bench/Chatbot Arena. The capstone.
GRPO & DeepSeek R1: Training Reasoning Models
GRPO algorithm, DeepSeek R1 training recipe, process vs outcome rewards, and why reasoning emerged from pure RL.
Constitutional AI: Anthropic's Approach to Safe Alignment
Anthropic's CAI approach — critique-revision loops, RLAIF, and scaling alignment without human labelers.
Model Merging: LoRA, SLERP & Combining Fine-Tuned Models
LoRA/QLoRA internals, PEFT comparison, and merging fine-tuned models with SLERP, TIES, and DARE.
LLM Data & Pretraining: Common Crawl to FineWeb
How pretraining data is collected, cleaned, deduplicated, filtered and packed, with hands-on MinHash and perplexity-filter code.
Distributed Training: DP, TP, PP, FSDP & Sequence Parallelism
Why one GPU is not enough, and how data, tensor, pipeline, sequence and expert parallelism and ZeRO split a model across many.
LLM Safety & Red-Teaming: Jailbreaks, Injections & Hallucinations
The main ways LLM systems fail or get attacked (jailbreaks, prompt injection, hallucination, poisoning, data extraction) and how teams test and defend against them.
Evaluating LLMs in 2026: MMLU-Pro, GPQA, SWE-Bench & Agentic Evals
Which LLM benchmarks still tell you something, across knowledge, code, long context, agents, multimodal and safety, and how to run a sound evaluation. Snapshot as of 2026, verify before relying on it.
Expert: Inside and Around the Model
7 lessons · 4 hrInterpretability and circuits, code and domain models, tool calling, structured generation, knowledge editing and synthetic data.
Mechanistic Interpretability: Circuits, Heads & Sparse Autoencoders
Reading what a transformer computes: the residual stream, attention heads, probes, steering, sparse autoencoders, activation patching and the logit lens.
Code & Domain LLMs: When Specialists Beat Generalists
When a smaller specialist model beats a general one, across code, math, medicine, law, finance, languages and embeddings, and how a router combines them.
Tool Calling Internals: How LLMs Decide to Call a Function
How an LLM decides to call a function: the text format, how the behaviour is trained in, the schema the model sees, parallel calls, and safe execution.
Structured Generation: How Constrained Decoding Actually Works
How constrained decoding forces a model to emit valid JSON or regex-matching text using state machines and grammars, and what it costs in quality.
Knowledge Editing: Surgical Updates to a Trained LLM
How to change one fact inside a trained model without retraining it: ROME, MEMIT, MEND and GRACE, how edits are scored, and why they still fail.
Synthetic Data: How Modern LLMs Train on Their Own Outputs
How models are trained on data that other models wrote: Phi-style textbooks, Self-Instruct, Evol-Instruct, distillation, verification, and the risk of model collapse.
Transformers From Scratch Lab
Eight from-scratch numpy exercises with automatic checking: a byte-pair-encoding merge step, sinusoidal positional encoding, scaled dot-product attention, the causal mask, multi-head split and merge, layer norm, a pre-norm transformer block, and KV-cache decoding that must equal full recompute, plus the traps and a capstone checklist.
Practice labs
14 interactive labs — hands-on exercises for this track
Tokenizer
How does AI read? First it breaks text into tokens — type a sentence and see it split into pieces
Embeddings Explorer
Words live in a space where similar meanings are close together — explore king - man + woman = queen
Transformer Attention
Watch data flow through a transformer step by step — the architecture behind ChatGPT
Attention Heatmap
See which words a transformer pays attention to — a vivid heatmap of what the model focuses on
Positional Encoding
Without this, 'dog bites man' and 'man bites dog' look identical to a transformer — see how position information is injected.
Self-Attention Step-Through
Step through every matrix operation in self-attention: Q·K^T, scale, softmax, weighted sum of V.
Multi-Head Attention Dissection
Eight attention heads side-by-side — each specializing in a different linguistic pattern. Hover to enlarge and watch the concatenated output emerge.
Tokenization Interactive
Type any sentence and watch it fragment into BPE tokens. Compare English-only, Multilingual, and Character-level vocabularies.
Transformer Block Walkthrough
Watch data flow through a single transformer encoder block — multi-head attention, residuals, LayerNorm, and FFN. Toggle residuals off and see gradient flow collapse.
Softmax Temperature Explorer
Drag a single slider and reshape the next-token probability distribution in real time — focused, balanced, creative, chaotic.
Beam Search Visualizer
Watch beam search branch, score, and prune multiple candidate completions in parallel. Compare greedy vs k=3 vs k=5.
Causal Masking Visualizer
Toggle bidirectional (BERT) vs causal (GPT) attention and step through autoregressive generation position-by-position.
Layer Norm vs Batch Norm
[batch=4, seq=6, dim=8] tensor. BN highlights columns; LN highlights rows. Toggle variable seq lengths — BN stats rot, LN stays identical.
KV Cache Visualizer
Step through autoregressive generation. Without cache: quadratic recompute. With cache: one row appended per step.
Test your knowledge
1058 questions across 38 modules — check how well you understood this track.