Table of Contents

Part I — Architecture

1

Tokens, Tokenization & Context Windows

BPE, WordPiece, SentencePiece, byte-level encoding, special tokens, context budgeting, and why output tokens cost more.

interactive trainerspectrum diagram
2

Embeddings & Semantic Representations

Token/sentence/document embeddings, cosine vs dot product vs euclidean, L2 normalization, bi-encoder vs cross-encoder, CLIP.

draggable vectorsCLIP spacesimilarity graphs
3

Transformer Architecture & Attention

Self-attention (Q/K/V), multi-head attention, positional encoding (sinusoidal/RoPE/ALiBi), KV cache, causal masking, Flash Attention.

end-to-end walkthroughblock diagramattention heatmap

Part II — Training

4

Model Families & Training Objectives

From BERT to GPT to LLaMA — MLM, seq2seq, generative vs discriminative, foundation vs task-specific, model specs and architecture comparison.

timelinemodel specs
5

Pretraining & Scaling Laws

Next-token prediction deep dive, interactive loss function demo, teacher forcing, scaling laws (Kaplan vs Chinchilla), compute-optimal training.

NTP demoloss demoscaling laws
6

Post-Training: Alignment, Tuning & Reasoning

How SFT, RLHF, DPO, and GRPO turn a base model into a useful assistant — plus LoRA, distillation, and when to fine-tune.

LoRA rank slidercost calculatorforgetting chart
7

Math Foundations & Number Formats

Softmax, cross-entropy, backpropagation, activation functions (ReLU/GELU/SwiGLU), FP32/FP16/BF16/INT8/INT4, mixed precision training.

softmax calculatorprecision convertergradient descent

Part III — Applications

8

Classification with LLMs

Zero-shot/few-shot classification, prompt vs fine-tune decision framework, metrics (precision/recall/F1), human-in-the-loop pipelines.

classifier democonfusion matrix
9

Topic Modeling & Theme Discovery

Embedding-based clustering, UMAP/t-SNE/PCA, K-means vs DBSCAN vs hierarchical, LLM-powered cluster naming, topic drift.

cluster canvasdrift chart
10

Prompting, In-Context Learning & Tool Use

System/user/assistant roles, chain-of-thought, structured output, function calling, prompt injection attacks, versioning.

prompt playgroundtool calling flow
11

Multimodal Large Language Models

Vision encoders (VLM), CLIP, visual grounding, OCR vs native vision, audio/video pipelines, architecture patterns (LLaVA, GPT-4V).

CLIP matrixarchitecture diagram

Part IV — Retrieval & RAG

12

Retrieval Foundations

Lexical vs dense retrieval, hybrid search (RRF), chunking strategies, vector databases, HNSW/IVF, reranking, HyDE, offline metrics.

search demoHNSW graphmetrics calculator
13

Production RAG Architectures

Naive vs production RAG, multi-hop retrieval, hallucination reduction, citations, agentic RAG, caching, permissions/ACL.

citation hoverdecision treeACL demo
14

Custom Embeddings & Retrieval Optimization

Domain adaptation, hard negatives, training losses (contrastive/triplet/InfoNCE), product quantization, drift monitoring.

PR curve sliderhard negatives

Part V — Inference & Hardware

15

Text Generation, Decoding & Serving

Temperature/top-k/top-p, beam search, streaming, batching, KV cache, quantization (FP16/INT8/INT4), scalable LLM architecture.

sampling slidersbeam search treesystem diagram
16

GPU Inference: How LLMs Run on Hardware

GPU architecture, VRAM allocation, token generation on hardware, memory bandwidth bottleneck, batching efficiency, tensor parallelism.

VRAM calculatorinference walkthroughGPU diagram

Part VI — Frontiers

17

Practical: nanochat

Karpathy's $100 ChatGPT — full pipeline from BPE tokenizer to RL, connecting every concept from chapters 1-16 in ~8,000 lines of code.

depth sliderpipeline walkthrougharchitecture comparison
18

Advanced Topics & Extensions

Mixture of Experts, knowledge graphs, adaptive softmax, model ecosystems, bias/fairness, interpretability, privacy, deployment optimization.

MoE routerLR scheduleknowledge graph