Skip to content

Track 00

Live

Start Here: LLM Foundations

Six guided parts take a new reader from a raw prompt through the math, transformer, generation phases, cache, and GPU basics. Every new term is explained before it is used in depth.

  • Beginner
  • 20 of 24 lessons live
  • 273 min live

What you'll be able to do

By the end of the core course.

  1. Trace raw text through token IDs, embeddings, logits, and multiple generated tokens
  2. Work small numerical examples with tensor shapes, attention, and probability
  3. Trace a decoder-only block and explain the choices behind its main components
  4. Compare prefill and decode, then calculate and explain the memory used to reuse earlier work
  5. Explain how a GPU runs transformer calculations and why moving data can limit speed

Main subjects

The territory this track covers.

  1. 01Part I — Foundations: What Happens When You Send a Prompt?
  2. 02Part II — Mathematical Foundations for Transformer Inference
  3. 03Part III — Inside a Decoder-Only Transformer
  4. 04Part IV — Prefill and Decode: The Two Major Phases
  5. 05Part V — KV Cache: From First Principles to Advanced Techniques
  6. 06Part VI — GPU Fundamentals for Inference

Who this is for

Curious readers and software developers who want to start Track 1 without assuming prior AI or linear-algebra knowledge.

Before you start

  • No machine-learning, calculus, or GPU background required
  • Basic programming familiarity helps but is not required for the first lesson

Curriculum

20 of 24 lessons published

Core course

20 of 24 live

The main sequence, read in order.

Module 01

Part I — Foundations: What Happens When You Send a Prompt?

Learn what an LLM, training, inference, parameters, and a forward pass are. Trace raw text through tokens, IDs, vocabulary, embedding lookup, tensor shapes, logits, softmax, greedy and sampled decoding, repetition controls, and stopping. Exit task: trace a prompt to its first and later generated tokens with inputs, outputs, shapes, and intermediate results.

3 of 3 lessons live

  1. 01Your First LLM Walkthrough: From Prompt to AnswerFollow a small prompt through token choices and explain the repeated step that produces an answer.Beginner8 min readRead
  2. 02From Raw Text to Token IDs and EmbeddingsUse a tiny vocabulary to tokenize a prompt, assign IDs, look up vectors, and label the resulting tensor shapes.Beginner12 min readRead
  3. 03From Logits to the Next TokenTurn scores into probabilities, then compare greedy decoding, temperature, top-k, top-p, repetition penalties, and stopping rules across two generation steps.Beginner14 min readRead

Module 02

Part II — Mathematical Foundations for Transformer Inference

Learn only the inference math needed next: scalars, vectors, matrices, tensors, dot products, similarity, matrix multiplication, projections, transposes, softmax, probability, sampling, normalization and RMSNorm, Big-O cost, and FP32/FP16/BF16/FP8/INT8/INT4 formats. Exit task: solve small numerical exercises with shapes and checked answers.

4 of 4 lessons live

  1. 04Vectors, Matrices, and Tensor ShapesCalculate with scalars, vectors, matrices, and tensors; track dimensions through dot products and matrix multiplication.Beginner12 min readRead
  2. 05Linear Projections, Transposes, and SimilarityFollow the shapes of a small linear projection and transpose, then use a dot product to compare two vectors.Beginner12 min readRead
  3. 06Softmax, Probability, and Sampling by HandCompute a tiny softmax distribution, check that it sums to one, and compare a sample with the highest-scoring choice.Beginner12 min readRead
  4. 07Normalization, Computation Cost, and Number FormatsWork through RMSNorm, Big-O growth, and the storage trade-offs among FP32, FP16, BF16, FP8, INT8, and INT4.Intermediate15 min readRead

Module 03

Part III — Inside a Decoder-Only Transformer

Trace embeddings, RoPE, Q/K/V projections, scaled attention, causal masks, head variants, residuals, RMSNorm, SwiGLU, blocks, output logits, and weight tying. Derive attention with one complete numerical example and diagrams showing each tensor shape and how a token changes across layers. Exit task: annotate the forward pass of a tiny decoder-only model.

4 of 4 lessons live

  1. 08Token Embeddings and Position in a DecoderFollow token vectors into the model, then show how positional information, including RoPE, changes attention inputs.Intermediate13 min readRead
  2. 09Attention from Numbers: Queries, Keys, and ValuesDerive scaled dot-product attention, define every symbol and shape, and calculate a complete tiny Q/K/V example.Intermediate16 min readRead
  3. 10Causal Masks and Attention HeadsApply a causal mask and compare multi-head, multi-query, and grouped-query attention using explicit head and cache shapes.Intermediate14 min readRead
  4. 11A Decoder Block from Input to LogitsTrace residuals, RMSNorm, SwiGLU, stacked blocks, output projection, weight tying, and architecture variations.Intermediate16 min readRead

Module 04

Part IV — Prefill and Decode: The Two Major Phases

Compare parallel prompt processing and causal attention during prefill with sequential per-position decode and KV-cache reuse. Explain time to first token, inter-token latency, throughput, compute and memory-bandwidth bottlenecks, and how latency changes with prompt and output lengths. Exit task: calculate a small request timeline and identify the limiting phase.

3 of 3 lessons live

  1. 12Prefill: Process the Prompt and Build the CacheTrace prompt positions through causal attention, show which calculations run together, and build the initial KV cache.Intermediate13 min readRead
  2. 13Decode: Generate One Position at a TimeFollow each new position through cached attention and explain memory reads, output throughput, and inter-token delay.Intermediate13 min readRead
  3. 14Prefill vs. Decode: A Worked Latency ExampleCompare phase costs and tensor shapes, then calculate how prompt and output lengths change total request latency.Intermediate14 min readRead

Module 05

Part V — KV Cache: From First Principles to Advanced Techniques

Start with why recalculating the whole sequence for every new token wastes work. Explain why causal attention permits reuse, what key/value vectors are saved, their shapes and memory formula, and how memory grows with context, layers, KV heads, head width, batch size, and precision. Then teach allocation, fragmentation, paging, prefix reuse, eviction, sliding windows, quantization, offloading, chunked prefill, and long-context limits. Exit task: calculate cache memory for two model designs and choose a memory strategy under a stated limit.

6 of 6 lessons live

  1. 15Why Cache Keys and Values?Compare recomputing the full sequence with reusing earlier attention results; show why a causal model may save keys and values and label their shapes.Beginner13 min readRead
  2. 16Calculate KV Cache Memory by HandDerive the byte formula across context, layers, head widths, batches, and precision; compare separate, grouped, and shared key/value heads.Intermediate16 min readRead
  3. 17Allocate the Cache: Blocks, Waste, and PagedAttentionUse a small block-allocation example to explain unused space, fragmentation, and how PagedAttention maps logical positions to physical blocks.Intermediate15 min readRead
  4. 18Reuse, Evict, or Limit Earlier ContextCompare prefix caching, cache eviction, and sliding-window attention when requests share a beginning or memory fills up.Intermediate15 min readRead
  5. 19Use Less Memory: Quantization and OffloadingCompare fewer bytes per cached value with moving cache data between GPU, CPU, and storage; account for quality and transfer costs.Intermediate15 min readRead
  6. 20Chunked Prefill and Long-Context LimitsSplit long prompt processing into scheduled pieces and examine why memory, computation, and useful recall become harder as context grows.Intermediate15 min readRead

Module 06

Part VI — GPU Fundamentals for Inference

Assume no GPU programming background. Start with CPU versus GPU execution and parallel work; then define CUDA threads, warps, blocks, grids, streaming multiprocessors, registers, shared memory, GPU memory, bandwidth, Tensor Cores, kernel launches, coalescing, arithmetic intensity, the Roofline model, and fusion. Connect every concept to a transformer operation using diagrams and small numerical examples. Exit task: label where compute and data movement occur in one transformer step and estimate which limits it.

0 of 4 lessons live

  1. 21From CPU Instructions to GPU ThreadsCompare CPU and GPU work, then build a plain-language map of GPU cores, CUDA, threads, warps, blocks, grids, and streaming multiprocessors.BeginnerPlannedComing soon
  2. 22GPU Memory and Matrix MultiplicationTrace weights and intermediate values through registers, shared memory, and high-bandwidth memory while a GPU multiplies matrices using Tensor Cores.BeginnerPlannedComing soon
  3. 23When Moving Data Limits a GPUCalculate bandwidth, compute throughput, and arithmetic intensity; use a simple Roofline example to distinguish compute-limited from memory-limited work.IntermediatePlannedComing soon
  4. 24Launch, Combine, and Feed GPU OperationsExplain kernel launches, adjacent memory reads, and combining operations; compare a transformer step before and after reducing data movement.IntermediatePlannedComing soon

Lessons are published in reading order. A coming-soon entry has no page yet — it is not a broken link.