Skip to content
All 197 lessons free ยท No account needed

Learn LLM Engineering

Build from computing foundations to production AI systems. Follow the curriculum in order, or make a plan for your goals and experience.

Git, Shell, Linux for AI ยท 20 min

Search topics, concepts, or lesson text. Use arrow keys to browse and Enter to open a lesson.

197 topics15 modules118h total contentOpen curriculum

Step-by-step roadmap

Follow these modules in order. Each step builds directly on the previous one.

Explore the 15-module roadmap
  1. 1
    Step 1 of 15

    ๐Ÿ› ๏ธComputing Foundations

    Current step

    NumPy shapes, accelerator basics, data structures, SQL, and algorithmic cost for practical ML systems

    9 topics~3hNext: Step 2
  2. 2
    Step 2 of 15

    ๐Ÿ“ŠMath & Statistics

    Upcoming

    Probability, statistics, distributions, uncertainty, hypothesis testing, bootstrap, and pass@k

    9 topics~3hNext: Step 3
  3. 3
    Step 3 of 15

    ๐Ÿ“šPreparation & Prerequisites

    Upcoming

    Background knowledge for readers new to ML. Skip ahead if you already know neural networks and how models train.

    13 topics~5hNext: Step 4
  4. 4
    Step 4 of 15

    ๐ŸงฎML Algorithms & Evaluation

    Upcoming

    Regression, validation, PCA, retrieval, decoding, experiments, PyTorch loops, and dataset quality

    15 topics~8hNext: Step 5
  5. 5
    Step 5 of 15

    ๐Ÿ“ฆProduction ML Systems

    Upcoming

    Feature pipelines, tabular prediction, ranking, forecasting, monitoring, and continuous training for production ML

    6 topics~3hNext: Step 6
  6. 6
    Step 6 of 15

    ๐ŸงชCore LLM Foundations

    Upcoming

    First working mental models: tokenization, embeddings, evaluation basics, file ingestion, chunking, and instruction-tuned chat

    8 topics~4hNext: Step 7
  7. 7
    Step 7 of 15

    ๐ŸงฐApplied LLM Engineering

    Upcoming

    Practical medium-depth patterns for reasoning, tools, context, RAG, evaluation, prompt optimization, observability, cost, and first product design

    25 topics~13hNext: Step 8
  8. 8
    Step 8 of 15

    ๐ŸŽ“Portfolio Capstones

    Upcoming

    Shippable predictive ML, LLM, and research artifacts: prediction, vision, pipelines, document QA, evaluation, classifiers, and reproducible studies

    9 topics~6hNext: Step 9
  9. 9
    Step 9 of 15

    ๐Ÿง Transformer Deep Dives

    Upcoming

    Harder internals: sentence embeddings, vector scoring, attention, positions, normalization, and decoding

    8 topics~7hNext: Step 10
  10. 10
    Step 10 of 15

    ๐ŸงฌAdvanced Training & Adaptation

    Upcoming

    Scaling laws, mixed-precision and distributed training, fine-tuning, training-run operations, alignment, rewards, distillation, and model merging

    18 topics~13hNext: Step 11
  11. 11
    Step 11 of 15

    ๐Ÿค–Advanced Agents & Retrieval

    Upcoming

    Advanced retrieval and agent systems: vector indexes, GraphRAG, security, orchestration, memory, recovery, RLMs, and a production capstone

    16 topics~12hNext: Step 12
  12. 12
    Step 12 of 15

    โšกInference & Production Scale

    Upcoming

    Accelerator architecture, GPU kernels, serving mechanics, distributed data planes, benchmarking, deployment, and experiments

    31 topics~20hNext: Step 13
  13. 13
    Step 13 of 15

    ๐Ÿ—๏ธSystem Design Capstones

    Upcoming

    End-to-end hard system design breakdowns for real AI products

    9 topics~7hNext: Step 14
  14. 14
    Step 14 of 15

    ๐ŸŽคAI Lab Interviewing

    Upcoming

    Final interview practice for frontier AI labs: Python systems, design, behavioral evidence, and technical presentation

    4 topics~2hNext: Step 15
  15. 15
    Step 15 of 15

    ๐Ÿ”ฌProject Deep Dives

    Upcoming

    Code-level studies of influential open AI infrastructure projects, their core mechanisms, tradeoffs, teams, and research foundations

    17 topics~11hFinal step
๐Ÿ› ๏ธ

Computing Foundations

NumPy shapes, accelerator basics, data structures, SQL, and algorithmic cost for practical ML systems

1

Git, Shell, Linux for AI

Build a reproducible AI repo with safe Git defaults, a clean-clone eval gate, shell diagnostics, and Linux process habits.

Easy ยท 20 min
2

Docker for Reproducible AI

Package the access-request scorer in a portable Docker image with a small build context, mounted data, runtime configuration, a non-root user, and a reproducible gate.

Easy ยท 20 min
3

Python for AI Engineering

Learn Python by building a small evaluator: read JSONL, validate fields, count correct predictions, and test the difference between bad input and a wrong answer.

Easy ยท 20 min
4

NumPy and Tensor Shapes

Learn NumPy shape reasoning from first principles: name axes, predict indexing and broadcasting, reduce safely, distinguish reshape from transpose, and add shape guards.

Easy ยท 22 min
5

CUDA for ML Training

Follow one access-ticket batch from CPU memory into CUDA kernels. Learn thread and memory hierarchy, coalesced access, roofline decisions, safe device placement, honest timing, and first-line diagnosis for setup, OOM, and throughput failures.

Easy ยท 25 min
6

MPS & Metal for ML on Mac

Train the same PyTorch ticket classifier on Apple silicon: select the `mps` device, keep tensors together, handle unsupported ops, time queued work honestly, and respond to unified-memory pressure.

Easy ยท 18 min
7

Data Structures for AI

Choose Python lists, hash-based collections, deques, heaps, trees, graphs, tries, and caches by the operations an AI system must serve.

Easy ยท 24 min
8

SQL and Data Modeling

Turn an in-memory support retriever into durable SQL tables. Model versioned sources, query safely, preserve permissions and lineage, and inspect the paths that keep retrieval correct as data changes.

Easy ยท 27 min
9

Algorithms for ML Engineers

Count work in a small retriever, compare scans, heaps, and radix trees, evaluate prefill versus decode complexity, and enforce latency budgets in production AI pipelines.

Easy ยท 28 min
๐Ÿ“Š

Math & Statistics

Probability, statistics, distributions, uncertainty, hypothesis testing, bootstrap, and pass@k

1

Gradients and Backprop

Train a one-weight latency predictor by reading a slope, taking a downhill step, tracing chain-rule paths, and checking the same gradient in PyTorch.

Easy ยท 25 min
2

Vectors, Matrices & Tensors

Trace one latency prediction into matrix products and token tensors. Check shapes, distinguish dot products from cosine similarity, and catch silent axis mistakes.

Easy ยท 19 min
3

Linear Algebra for ML

Find hidden directions in a support-incident matrix with SVD, then use rank, PCA, truncation, and condition numbers without losing sight of what the numbers mean.

Easy ยท 21 min
4

Adam, Momentum, Schedulers

Trace SGD, momentum, RMSProp, Adam, AdamW, schedules, and gradient clipping on a 100-to-1 loss valley. Learn what each optimizer buffer measures and how to validate a training choice.

Easy ยท 23 min
5

Probability for Machine Learning

Use one API abuse-risk detector to learn events, random variables, distributions, conditional probability, independence, Bayes rule, and base-rate mistakes.

Easy ยท 23 min
6

Bayesian Inference from Evidence

Update a coding agent's unknown success rate with beta-binomial evidence, compare priors, measure uncertainty, and expose sampling failures.

Easy ยท 16 min
7

Statistics and Uncertainty

Estimate a review queue's abuse rate with bootstrap and Wilson intervals, distinguish sampling variation from bias, and assess calibration without overstating the evidence.

Easy ยท 21 min
8

Distributions and Sampling

Match binary outcomes, routes, tool-call counts, and latency to first distributions, then reject a simulation that doesn't fit the traces.

Easy ยท 34 min
9

Hypothesis Tests, Intervals, and pass@k

Compare a code-generation model with paired evidence, uncertainty for lift, and pass@k under a fixed sampling budget.

Easy ยท 26 min
๐Ÿ“š

Preparation & Prerequisites

Background knowledge for readers new to ML. Skip ahead if you already know neural networks and how models train.

1

Neural Networks from Scratch

Build a CodeAssist timeout-risk neural network from scratch: derive affine maps, prove why non-linearities prevent layer collapse, compare core activations, track batched tensor shapes, and implement backpropagation with NumPy and PyTorch autograd.

Easy ยท 24 min
2

CNNs from Scratch

Trace a CNN over a 4 by 4 crop: shared kernels, feature-map shapes, pooling winners, padding artifacts, and a matching NumPy-to-PyTorch forward pass.

Easy ยท 19 min
3

Training & Backpropagation

Follow a decode-latency model through reverse-mode autograd, the PyTorch training loop, batching dynamics, vanishing gradients, weight initialization, and early stopping.

Easy ยท 28 min
4

Softmax, Cross-Entropy & Optimization

Turn raw class scores into stable probabilities and a useful learning signal, then apply the same loss to next-token predictions.

Easy ยท 27 min
5

RNNs, LSTMs, GRUs, and Sequence Modeling

Trace an RNN over ordered events, see why gradients fade or grow, and use LSTM and GRU gates to control memory.

Easy ยท 25 min
6

Autoencoders and VAEs

Compress a 5 by 5 screenshot crop through a latent bottleneck, then train a VAE so prior samples can decode.

Easy ยท 22 min
7

The Transformer Architecture End-to-End

Trace a three-token prompt through causal attention, residual updates, and a vocabulary head. Build and test one complete decoder in PyTorch.

Easy ยท 26 min
8

Language Modeling & Next Tokens

Learn how next-token prediction becomes a trainable language model, from bigram counts and neural n-grams to causal Transformer generation and KV-cache serving.

Easy ยท 29 min
9

From GPT to Modern LLMs

Trace how decoder-only models grew into modern LLMs, then inspect scaling, instruction tuning, open weights, MoE, and serving tradeoffs with runnable examples.

Easy ยท 32 min
10

Prompt Engineering Fundamentals

Build an incident-triage prompt with clear roles, useful examples, structured outputs, evidence checks, and a separate authorization boundary.

Easy ยท 15 min
11

Calling LLM APIs in Production

Turn a grounded prompt into a reliable API boundary with server-side secrets, typed results, bounded retries, safe actions, and useful telemetry.

Easy ยท 29 min
12

First AI App End-to-End

Run one local rotation-decision app with a browser form, checked provider boundary, durable traces, and tests of the actual HTTP path.

Easy ยท 14 min
13

The LLM Lifecycle

Follow a decoder language model from training to serving, check the artifacts after compression, and turn production symptoms into evidence-led investigations.

Easy ยท 23 min
๐Ÿงฎ

ML Algorithms & Evaluation

Regression, validation, PCA, retrieval, decoding, experiments, PyTorch loops, and dataset quality

1

Linear Regression from Scratch

Fit assistant latency with a line, derive OLS and gradient descent from first principles, and expose hidden non-linearities through residual diagnostics.

Medium ยท 35 min
2

Logistic Regression and Metrics

Route access-change requests with logistic regression from scratch: derive sigmoid and log loss, fit NumPy weights, select a cost-aware threshold on validation data, audit ranking and calibration, then compare with scikit-learn.

Medium ยท 48 min
3

Decision Trees, Forests, and Boosting

Route the same access-change requests with axis-aligned rules: compute Gini, fit a stump, watch extra depth memorize R3, average bootstrap trees, boost residuals, and audit MDI versus SHAP.

Medium ยท 41 min
4

Reinforcement Learning Basics

Turn the earlier one-shot access-review label into an MDP. Compute discounted returns and Bellman backups, run value iteration and Q-learning, watch abandonment reverse a policy, and connect REINFORCE to LLM post-training.

Medium ยท 31 min
5

Validation and Leakage

Split access-review requests by time and user, block post-decision fields, fit preprocessing on training rows only, and treat public LLM benchmarks as contamination-prone.

Medium ยท 32 min
6

Statistical Learning and Generalization

Audit a prompt sweep with risk bounds, construct a VC shattering proof, measure noise fitting, and test claims about interpolation and sample size.

Medium ยท 26 min
7

Conformal Prediction and Uncertainty

Build finite-sample conformal prediction intervals, compute corrected calibration quantiles, and diagnose subgroup and distribution-shift failures.

Medium ยท 20 min
8

Clustering and PCA

Inspect unlabeled developer-message embeddings with k-means and PCA, then stress-test whether apparent neighborhoods survive scale, metric, and compression choices.

Medium ยท 35 min
9

Probabilistic Generative Models

Fit a Gaussian mixture from six latencies, reproduce EM's lower-bound argument, diagnose collapsed and symmetric components, and connect exact inference to VAEs.

Medium ยท 22 min
10

Core Retrieval Algorithms

Build and evaluate the evidence-selection stage of a technical-docs assistant with BM25, dense similarity, rank fusion, reranking, and approximate search audits.

Medium ยท 30 min
11

Decoding Algorithms

Explore exponential token search spaces. Implement stable softmax, greedy and beam search with length and repetition penalties, top-k/top-p/min-p sampling, and test-time reasoning verifiers.

Medium ยท 34 min
12

Experiment Design and A/B Testing

Design a trustworthy online experiment for an incident-assistant change: randomize incidents, measure useful outcomes, quantify uncertainty, and reject false wins.

Medium ยท 41 min
13

Causal Inference and Counterfactuals

Separate correlation from intervention, diagnose Simpson's reversal, estimate adjusted treatment effects, and inspect overlap before trusting observational AI evaluations.

Medium ยท 29 min
14

PyTorch Training Loops

Trace logits, gradients, updates, and validation in runnable PyTorch loops. Work through unequal micro-batches, CUDA AMP ordering, independent snapshots, and checkpoint resumption.

Medium ยท 36 min
15

Dataset Pipelines and Data Quality

Build versioned AI datasets with schema gates, grouped splits, contamination checks, and auditable receipts.

Medium ยท 30 min
๐Ÿ“ฆ

Production ML Systems

Feature pipelines, tabular prediction, ranking, forecasting, monitoring, and continuous training for production ML

๐Ÿงช

Core LLM Foundations

First working mental models: tokenization, embeddings, evaluation basics, file ingestion, chunking, and instruction-tuned chat

1

The Bitter Lesson & Compute

Explore Sutton's Bitter Lesson across search, learning, and heuristics, then analyze the compute economy across pretraining, serving, and test-time search.

Medium ยท 24 min
2

BPE, WordPiece, and SentencePiece

Build a subword tokenizer, master BPE, WordPiece, and SentencePiece Unigram, and debug production failure modes from fertility tax to glitch tokens.

Medium ยท 32 min
3

Static to Contextual Embeddings

Turn token IDs into vectors, learn what nearby usage captures, and see why a word such as charge needs sentence-dependent representations.

Medium ยท 25 min
4

Perplexity & Model Evaluation

Compute perplexity from held-out token probabilities, compare models under a fixed protocol, normalize across tokenizers, and decide what PPL can't tell you.

Medium ยท 29 min
5

File Ingestion for AI

Turn PDFs, scans, HTML, and Markdown into faithful evidence records with provenance and quality checks before retrieval.

Medium ยท 21 min
6

Chunking Strategies

Turn clean documents into retrieval units that preserve answers, citations, and measurable search quality.

Medium ยท 21 min
7

LLM Benchmarks & Limitations

Build an evaluation suite for a policy-answering LLM: score evidence use, understand public benchmark contracts, control judge bias, and make release decisions from private tests.

Medium ยท 34 min
8

Instruction Tuning & Chat Templates

Teach a base language model to answer as an assistant: curate grounded SFT rows, serialize chat turns exactly, choose loss targets, pack safely, and detect serving-time template drift.

Medium ยท 32 min
๐Ÿงฐ

Applied LLM Engineering

Practical medium-depth patterns for reasoning, tools, context, RAG, evaluation, prompt optimization, observability, cost, and first product design

1

Dimensionality Reduction for Embeddings

Shrink and inspect embedding indexes without guessing: measure recall while testing PCA, projections, native shortening, and quantization.

Medium ยท 38 min
2

CoT, ToT & Self-Consistency Prompting

Build and evaluate reasoning controllers: single traces, answer voting, and bounded tree search for multi-step LLM decisions.

Medium ยท 30 min
3

Function Calling & Tool Use

Build a safe tool-calling runtime that validates model requests, executes controlled actions, feeds observations back, and evaluates complete workflows.

Medium ยท 29 min
4

MCP & Tool Protocol Standards

Trace stateless MCP requests, test a local stdio tool, and separate connection health, protocol validity, and permission.

Medium ยท 23 min
5

Context Engineering

Curate the evidence, tools, and notes in each model request. Test token budgets, package reusable Agent Skills, and resume work from checked artifacts rather than status claims.

Medium ยท 25 min
6

Prompt Injection Defense

Build a prompt-injection-resistant agent boundary: quarantine untrusted tool content, validate typed action proposals, require approval, and measure unsafe side effects.

Medium ยท 29 min
7

Responsible AI Governance

Turn a tool-bearing LLM workflow into auditable evidence: classify its use, own risks, version controls, preserve traces, and gate releases.

Medium ยท 31 min
8

Privacy-Preserving Machine Learning

Define neighboring datasets and privacy budgets, implement protected-unit-aware clipping, distinguish DP-SGD from redaction, and audit membership leakage.

Medium ยท 22 min
9

Data Labeling and Human Feedback

Turn traces into reviewed feedback data: preserve privacy, measure agreement, select useful cases, and protect independent evaluation.

Medium ยท 31 min
10

Evaluating AI Agents

Evaluate model-promotion agent runs by final state, observable trace, safety gates, cost, and repeatability, then map private tests to public benchmarks.

Medium ยท 32 min
11

Production RAG Pipelines

Design a secure, traceable RAG service around versioned policy evidence, grounded answers, abstention, release gates, and latency budgets.

Medium ยท 38 min
12

Hybrid Search: Dense + Sparse

Upgrade a permission-safe RAG retriever with BM25, semantic scores, rank fusion, and recall gates for exact codes and paraphrased policy questions.

Medium ยท 32 min
13

Reranking and Cross-Encoders for RAG

Rank retrieved passages with cross-encoders, measure candidate recall and ordering, and preserve source permissions, text boundaries, and serving budgets.

Medium ยท 33 min
14

RAG Evaluation for Reliable Answers

Separate evidence support, citation accuracy, relevance, and completeness. Build a small RAG evaluation harness, test misleading answers, and interpret abstention and slice-level results.

Medium ยท 30 min
15

LLM-as-a-Judge Evaluation

Build rubric-based judges, detect unstable preferences, and measure agreement without mistaking a plausible score for ground truth.

Medium ยท 25 min
16

Bias & Fairness in LLMs

Build a matched-pair fairness audit for an LLM judge, measure routing gaps, and block release when evidence is too weak.

Medium ยท 30 min
17

Hallucination Detection & Mitigation

Build a structured grounding gate for incident updates, test its failure cases, and distinguish evidence support from consistency, freshness, and real-world truth.

Medium ยท 30 min
18

LLM Observability & Monitoring

Connect answer-quality checks to latency, cost, traces, and actionable alerts without confusing missing evidence with a healthy service.

Medium ยท 31 min
19

Experiment Tracking with MLflow and W&B

Record the inputs, results, artifacts, and limits behind a candidate decision, then verify them with local MLflow and W&B examples.

Medium ยท 31 min
20

Prompt Optimization with DSPy

Define a DSPy program and a metric, inspect how demonstrations are selected, and separate prompt search from held-out evaluation and deployment.

Medium ยท 16 min
21

Model Versioning & Deployment

Turn an evaluated LLM change into an immutable release bundle, promote it through measured traffic, and roll back without losing lineage.

Medium ยท 32 min
22

Semantic Caching & Cost Optimization

Test whether policy answers can be reused across paraphrases within release, access, and freshness boundaries; compare quality, cost, and tail latency before serving hits.

Medium ยท 32 min
23

LLM Cost Engineering & Token Economics

Build an auditable LLM cost ledger from usage traces, cache decisions, output contracts, offline batch work, and release budget gates.

Medium ยท 33 min
24

Model Gateways, Routing, and Fallbacks

Compile route requirements, reject incompatible fallbacks, and test shared deadlines and spending reservations in a local gateway lab.

Medium ยท 31 min
25

Design an Automated Support Agent

Keep invoice facts, policy evidence, draft generation, credit authorization, and human handoff separate in a runnable support workflow.

Medium ยท 39 min
๐ŸŽ“

Portfolio Capstones

Shippable predictive ML, LLM, and research artifacts: prediction, vision, pipelines, document QA, evaluation, classifiers, and reproducible studies

1

Capstone: Delivery ETA Prediction

Compare as-of arrival estimates and warning policies using delayed labels, meaningful baselines, and honest uncertainty.

Hard ยท 35 min
2

Capstone: Product Ranking

Fit a small ranking model, expose misleading metrics, and audit eligibility, delayed labels, and click bias before planning an experiment.

Hard ยท 41 min
3

Capstone: Demand Forecasting

Fit rolling demand forecasts, compare capacity signals with later errors, and catch misleading backtest evidence.

Hard ยท 24 min
4

Capstone: Image Damage Classifier

Test photo review routes, expose misleading quality scores, and plan a real-image classifier with case-level evaluation.

Hard ยท 37 min
5

Capstone: Production ML Pipeline

Build a point-in-time training and reload path, then test offline gates, simulated canary decisions, promotion, and rollback.

Hard ยท 46 min
6

Capstone: Document QA

Build an approved-policy lookup, test citations and refusals, and trace source-bound reviews through a research-job simulation.

Hard ยท 52 min
7

Capstone: Eval Dashboard

Build a document QA dashboard that exposes unsafe citations, checks comparable rows, and keeps display filters out of release gates.

Hard ยท 35 min
8

Capstone: Fine-Tuned Classifier

Fit a ticket classifier, compare held-out baselines, and check labels, thresholds, scoring evidence, and agent intake.

Hard ยท 45 min
9

Capstone: Reproducible ML Study

Test a reward-shaping claim with paired trials, inspect regressions, and package the code, uncertainty, and evidence for review.

Hard ยท 52 min
๐Ÿง 

Transformer Deep Dives

Harder internals: sentence embeddings, vector scoring, attention, positions, normalization, and decoding

1

Sentence Embeddings & Contrastive Loss

Build sentence embeddings with contrastive losses, audit negative labels, and measure retrieval recall, latency, and vector storage.

Hard ยท 65 min
2

Embedding Similarity & Quantization

Compare vector scores, test shorter prefixes, and measure scalar, product, and binary quantization against retrieval requirements.

Hard ยท 53 min
3

Scaled Dot-Product Attention

Build scaled dot-product attention from a token sequence: Q/K/V routing, variance scaling, masks, multi-head shapes, KV-cache cost, and FlashAttention.

Hard ยท 64 min
4

Vision Transformers and Image Encoders

Understand how Vision Transformers split images into patches, build visual tokens, train encoders, and connect to CLIP and multimodal LLMs.

Hard ยท 40 min
5

Positional Encoding: RoPE & ALiBi

Understand why transformers need position information, how sinusoidal encodings work, how RoPE and ALiBi encode relative position, and why long-context extrapolation needs careful evaluation.

Hard ยท 53 min
6

Layer Normalization: Pre-LN vs Post-LN

Understand LayerNorm mechanics, Pre-LN versus Post-LN placement, RMSNorm simplification, gradient stability, and hybrid normalization layouts for deep transformers.

Hard ยท 41 min
7

Mechanistic Interpretability

Learn how sparse autoencoders decompose transformer activations into candidate interpretable features, support circuit tracing, and enable controlled activation-steering experiments.

Hard ยท 46 min
8

Decoding Strategies: Greedy to Nucleus

Compare decoding strategies for text generation: greedy, beam search, top-k, nucleus (top-p), temperature, repetition controls, and newer variants like min-p.

Hard ยท 48 min
๐Ÿงฌ

Advanced Training & Adaptation

Scaling laws, mixed-precision and distributed training, fine-tuning, training-run operations, alignment, rewards, distillation, and model merging

1

Scaling Laws & Compute-Optimal Training

Learn how Kaplan, Chinchilla, and inference-aware fits split a training budget across parameters and tokens, and when a smaller over-trained model wins on lifetime cost.

Hard ยท 42 min
2

Pre-training Data at Scale

Understand how web-scale pre-training data is extracted, filtered, deduplicated, mixed, tokenized, and packed into training-ready shards, including decontamination, late-stage annealing, and synthetic-data tradeoffs.

Hard ยท 42 min
3

Build GPT from Scratch Lab

Build and train a tiny GPT end to end on Shakespeare: tokenize with GPT-style subwords, remap active token IDs, run causal self-attention, track validation loss, save a checkpoint, and sample text.

Hard ยท 35 min
4

JAX for PyTorch Researchers

Read and modify JAX research code after the PyTorch GPT lab by making state, randomness, transformations, compilation, and timing explicit.

Hard ยท 45 min
5

Continued Pretraining for Domain Shift

Learn when to keep the causal language-modeling objective and continue pretraining on domain text instead of jumping straight to SFT, and how to evaluate the trade-off against forgetting, cost, and downstream gain.

Hard ยท 38 min
6

Synthetic Data Pipelines

Build post-training synthetic data as a gated pipeline: Self-Instruct, Evol-Instruct, grounded execution, calibrated judges, preference pairs, diversity, decontamination, and versioned shards.

Hard ยท 34 min
7

Supervised Fine-Tuning Pipeline

Run supervised fine-tuning as a real training system: choose the learning objective before the update surface, verify response-token loss and packing, track the real batch budget, save resumable checkpoints, and export on held-out behavior.

Hard ยท 38 min
8

Mixed Precision Training

Explore disappearing gradients, asymmetric rounding, and loss scaling. Test why ordinary AMP keeps FP32 updates before comparing training speed and memory.

Hard ยท 44 min
9

Distributed Training: FSDP & ZeRO

Master ZeRO stages, FSDP2 fully_shard architecture, 4D parallelism topology (DP, TP, PP, CP), and NCCL collective communication trade-offs.

Hard ยท 65 min
10

LoRA & Parameter-Efficient Tuning

Understand the mathematics of Low-Rank Adaptation (LoRA), modern adapter targeting strategies, and the real memory tradeoffs compared to full fine-tuning and QLoRA.

Hard ยท 53 min
11

Training Run Operations

Recover training state after interruption, budget checkpoint time, preserve effective batch and scheduler progress, and choose an adaptation recipe that fits the data and memory.

Hard ยท 31 min
12

Reward Modeling from Preference Data

Train reward models as a first-class post-training stage: validate chosen/rejected pairs and splits, fit a scalar reward head with Bradley-Terry loss, audit generalization, and decide when explicit rewards are worth the extra complexity.

Hard ยท 41 min
13

RLHF & DPO Alignment

Follow preference labels into PPO-style RLHF or DPO. Calculate KL-shaped rewards, clipped policy updates, and response-only DPO gradients, then check whether better training scores improve held-out behavior.

Hard ยท 56 min
14

Constitutional AI & Red Teaming

Trace Constitutional AI from critique and revision to AI preference labels, then build honest red-team evaluations that separate model failures, false refusals, and judge errors.

Hard ยท 33 min
15

RLVR & Verifiable Rewards

Understand RLVR, a post-training approach that uses programmatic verification instead of learned human-preference rewards to improve checked outcomes in math, code, and other contract-driven tasks.

Hard ยท 43 min
16

Knowledge Distillation for LLMs

Understand the main forms of knowledge distillation for LLMs, from logit matching and response-based supervision to on-policy KD. Learn when distillation helps, where student capacity becomes the bottleneck, and how to implement a correct teacher-student training loop.

Hard ยท 47 min
17

Decision Models: Jev and Kev

Trace a typed decision from labeled state to option scores, compare Jev with inspectable Kev and SemIf methods, and learn the training and evaluation gates that make a decision model useful.

Hard ยท 16 min
18

Model Merging and Weight Interpolation

Learn model merging techniques, from simple weight averaging and task arithmetic to TIES-Merging and DARE, including practical guidance on tokenizer compatibility, mergekit workflows, and evaluation.

Hard ยท 47 min
๐Ÿค–

Advanced Agents & Retrieval

Advanced retrieval and agent systems: vector indexes, GraphRAG, security, orchestration, memory, recovery, RLMs, and a production capstone

1

Vector DB Internals: HNSW & IVF

Trace graph hops, expose an IVF boundary miss, and test why compressed scores, filters, and shard tails can change nearest-neighbor results.

Hard ยท 55 min
2

Advanced RAG: HyDE & Self-RAG

Compare query rewriting, HyDE, Self-RAG, and CRAG, then test retrieval coverage, support checks, fallback policy, and added cost on a docs assistant.

Hard ยท 54 min
3

GraphRAG & Knowledge Graphs

Build source-linked incident graphs, compare local retrieval with community-report search, and test where graph coverage, identity, and authorization can fail.

Hard ยท 55 min
4

RAG Security & Access Control

Stop a signing-key query from exposing a restricted runbook: authorize before export, isolate tenants, and audit the reject path.

Hard ยท 55 min
5

Structured Output Generation

Build reliable LLM interfaces with JSON mode, structured outputs, schema validation, and grammar-guided decoding.

Hard ยท 38 min
6

ReAct & Plan-and-Execute

Compare ReAct for tightly coupled tool use with Plan-and-Execute for longer workflows with explicit planning and replanning.

Hard ยท 66 min
7

Guardrails & Safety Filters

Build layered runtime guardrails for prompt injection, sensitive-data controls, structured outputs, policy enforcement, and safe tool use.

Hard ยท 61 min
8

Code Generation & Sandboxing

Build code agents that repair programs from runtime evidence while keeping untrusted execution separate from host authority and grading.

Hard ยท 27 min
9

Computer-Use / GUI / Browser Agents

Build browser and desktop agents whose proposed clicks and keystrokes stay behind host policy, approval, verification, and sandbox controls.

Hard ยท 49 min
10

Human-in-the-Loop Agent Architecture

Build approval gates, durable checkpoints, and guarded resumes for agent actions that change external state.

Hard ยท 51 min
11

AI Coding Workflow with Agents

Turn coding tasks into bounded agent work with restricted execution, review branches, before-and-after evidence, and human-owned merge decisions.

Hard ยท 32 min
12

Agent Memory & Persistence

Keep coding-agent context across sessions with scoped stores, sourced recall, and checkpoints, without letting a recalled note authorize a merge.

Hard ยท 55 min
13

Agent Failure & Recovery

Recover from invalid proposals, lost replies, stalled plans, and dependency outages without duplicating actions or inventing success. Build and fault-test the runtime boundaries.

Hard ยท 31 min
14

Recursive Language Models (RLM)

Learn Recursive Language Models (RLMs): keep long context in a programmable environment, delegate targeted sub-calls, and release the design only after measured quality, cost, and safety checks.

Hard ยท 33 min
15

Multi-Agent Orchestration

Decide when multiple agents earn their cost, then orchestrate them with typed shared state, parallel reads, a validated merge, and one approval-bound writer.

Hard ยท 36 min
16

Capstone: Production Agent

Build and test an agent runtime with fixture-based intake and evidence, bound tool calls, durable local approvals, and execution-derived evaluation rows.

Hard ยท 28 min
โšก

Inference & Production Scale

Accelerator architecture, GPU kernels, serving mechanics, distributed data planes, benchmarking, deployment, and experiments

1

Inference: TTFT, TPS & KV Cache

Map prefill vs decode bottlenecks, measure TTFT and decode cadence, and size KV cache so concurrent sequences fit on one GPU.

Hard ยท 44 min
2

Multi-Query & Grouped-Query Attention

Compare MHA, MQA, and GQA architectures, calculate their KV cache footprint, and reason about memory-limited serving tradeoffs.

Hard ยท 49 min
3

KV Cache & PagedAttention

Calculate KV cache capacity, trace paged block allocation, and separate memory packing from prefix reuse and scheduling tradeoffs.

Hard ยท 48 min
4

Prefix Caching and Prompt Caching

Structure exact reusable prefixes, validate cache hits from usage fields, and enforce invalidation and tenant-isolation boundaries.

Hard ยท 31 min
5

FlashAttention & Memory Efficiency

Understand how FlashAttention cuts auxiliary attention memory from O(nยฒ) to O(n) with tiling and online softmax, and analyze its IO complexity.

Hard ยท 51 min
6

Continuous Batching & Scheduling

Trace iteration-level slot reuse, budget prefill and decode work, and evaluate chunking or phase separation against TTFT, TPOT, and inter-token latency targets.

Hard ยท 44 min
7

Scaling LLM Inference

Size LLM serving from HBM bandwidth and KV residency: pick a throughput-latency-cost operating point, then compose batching, paging, speculation, and precision as capacity levers.

Hard ยท 43 min
8

Model Parallelism for LLM Inference

Learn tensor parallelism, pipeline parallelism, context parallelism, and how multi-GPU serving trades memory capacity for communication overhead.

Hard ยท 36 min
9

Accelerator Architecture Field Guide

Compare accelerator execution, memory, interconnect, and programming models through one LLM workload, then choose what must be remeasured when moving between NVIDIA, AMD, TPU, Trainium, and Apple silicon.

Hard ยท 39 min
10

Correct GPU Profiling and Benchmarking

Build trustworthy GPU performance evidence: check kernel correctness, choose system or kernel profiling scope, control benchmark state, and preserve a reproducible receipt before claiming a speedup.

Hard ยท 40 min
11

GPU Kernel Performance Engineering Lab

Optimize one CUDA matrix-transpose kernel through a repeatable evidence loop. Diagnose coalescing, shared-memory bank conflicts, occupancy limits, correctness failures, and the point where a reduction or scan is the right primitive.

Hard ยท 29 min
12

GPU Parallel Primitives Lab

Trace reduction, prefix scan and online softmax through concrete values, then check CUDA indexing and compare custom collectives with CUB.

Hard ยท 31 min
13

GPU Compilers and Kernel Languages

Trace a GPU kernel from CUDA C++ or a tile language through compiler IR, PTX, cubin, and native instructions, then choose an authoring model by control, portability, and inspectable evidence.

Hard ยท 38 min
14

GEMM From Naive CUDA to Tensor Cores

Build one matrix multiplication through coalesced scalar CUDA, shared-memory tiling, register blocking, Tensor Core MMA, and the boundary where async copies and CUTLASS take over.

Hard ยท 36 min
15

Low-Precision GPU Programming

Build numerically sound FP16, BF16, TF32, FP8, and MXFP8 GPU paths by making scale, accumulation, layout, and kernel contracts explicit.

Hard ยท 28 min
16

GPU Runtime Execution Lab

Master asynchronous CUDA submission with streams, events, graph capture, replay, updates, runtime dispatch, and correctness-first benchmark receipts.

Hard ยท 25 min
17

AI-Generated Kernel Engineering

Turn generated GPU code into a promotable library kernel through explicit operator contracts, hidden correctness tests, sanitizer gates, fair benchmarks, reproducible receipts, and controlled rollout.

Hard ยท 32 min
18

Model Quantization: GPTQ, AWQ & GGUF

Pack INT4 codes, follow GPTQ error compensation, and search AWQ channel scales. Budget GGUF tensors and test quality separately from storage and speed.

Hard ยท 32 min
19

Local LLM Deployment

Build local model memory budgets, check GPU placement, distinguish offload from paging, choose a runtime, and verify latency and private-data boundaries.

Hard ยท 27 min
20

SLM Specialization & Edge Deployment

Choose and adapt a small model for a device job: compare training signals and compact architectures, inspect runtime placement, and evaluate quality, memory, sustained speed, energy, privacy, and update recovery.

Hard ยท 41 min
21

Speculative Decoding

Propose tokens cheaply, verify with the target, and correct rejections without changing its distribution in exact arithmetic. Practice cache dependencies, tree masks, and performance decisions under load.

Hard ยท 36 min
22

Long Context Window Management

Master long-context LLM engineering: KV-cache math, prefill-vs-decode bottlenecks, RoPE scaling, lost-in-the-middle behavior, and long-context vs. RAG trade-offs.

Hard ยท 45 min
23

Mixture of Experts Architecture

Trace selected-expert computation, test routing and balancing assumptions, and account for stored weights, cache state, and dispatch from Mixtral to current hybrid MoE models.

Hard ยท 45 min
24

Mamba & State Space Models

Compute selective recurrences and prefix scans, compare Mamba-1/2/3, and test what fixed-state decoding saves, loses, and must restore when streams branch.

Hard ยท 44 min
25

Reasoning & Test-Time Compute

Choose between more samples, revision, and guided search. Test verifier failures, distinguish effort from hard limits, and account for reasoning tokens and shared cache state.

Hard ยท 46 min
26

Advanced MLOps & DevOps for AI

Follow a missing feature transform through release manifests, historical joins, canaries, and rollback. Test actual vector parity and reject stale controller decisions.

Hard ยท 34 min
27

GPU Serving & Autoscaling

Serve one incident-summary request through continuous batching, paged KV, and an autoscaler driven by queue, cache, and TTFT pressure.

Hard ยท 61 min
28

GPU Failure Operations

Diagnose one failing GPU replica, contain the smallest safe scope, preserve evidence, and re-admit hardware through explicit gates.

Hard ยท 26 min
29

Distributed Inference Data Plane

Follow an 8K prompt through rank collectives and KV handoff, calculate transfer and memory budgets, and test why expired buffers aren't immediately reusable.

Hard ยท 22 min
30

Serving Benchmark Engineering

Build a reproducible serving benchmark with a frozen arrival trace, explicit streaming timing boundaries, complete failure accounting, and SLO-qualified capacity estimates.

Hard ยท 23 min
31

A/B Testing for LLMs

Take one docs-assistant prompt duel from a golden-set rubric to a live resolution-rate test with sticky routing and registered guardrails.

Hard ยท 61 min
๐Ÿ—๏ธ

System Design Capstones

End-to-end hard system design breakdowns for real AI products

1

Content Moderation System

Design StreamShield's cascade: chat send decisions, upload holds, policy judges, appeals, and 10K RPS without one-model screening.

Hard ยท 58 min
2

Code Completion System

Design a real-time code completion path with context construction, measured serving latency, privacy controls, and stale-result suppression.

Hard ยท 49 min
3

Multi-Tenant LLM Platform

Design shared LLM serving with trusted tenant identity, atomic reservations, fair scheduling, scoped caches, and reconcilable usage records.

Hard ยท 29 min
4

LLM-Powered Search Engine

Design a permission-aware search pipeline with current evidence, hybrid ranking, auditable citations, checked streaming, and realistic latency and capacity boundaries.

Hard ยท 30 min
5

Vision-Language Models & CLIP

Design a visual inspection and search product around CLIP, SigLIP, zero-shot prompts, visual token budgets, grounding, and generative VLM connectors.

Hard ยท 59 min
6

Multimodal LLM Architecture

Design a multimodal incident-evidence copilot while learning encoders, connectors, fusion, token budgets, training, grounding, and serving constraints.

Hard ยท 58 min
7

Diffusion Models: Images & Text

Design a governed image-generation service while learning DDPM noising, stochastic sampling, latent diffusion, classifier-free guidance, DiT backbones, and text diffusion.

Hard ยท 58 min
8

Real-Time Voice AI Agent

Design an incident-hotline voice agent: turn detection, streaming STT/LLM/TTS, native-audio trade-offs, WebRTC transport, and barge-in state.

Hard ยท 52 min
9

Reasoning Agent System Design

Design a production reasoning agent that routes by difficulty, evaluates candidate work, requires evidence before release, and survives serving bottlenecks like key-value (KV) cache growth.

Hard ยท 52 min
๐ŸŽค

AI Lab Interviewing

Final interview practice for frontier AI labs: Python systems, design, behavioral evidence, and technical presentation

๐Ÿ”ฌ

Project Deep Dives

Code-level studies of influential open AI infrastructure projects, their core mechanisms, tradeoffs, teams, and research foundations

1

Deep Dive - vLLM

Read vLLM as a living serving system: PagedAttention's memory idea, the V1 engine loop, block-pool caching, scheduling, kernels, APIs, and production tradeoffs.

Hard ยท 37 min
2

Deep Dive - SkyRL

Read SkyRL as replaceable RL interfaces: environments, generators, HTTP inference, trainers, weight sync, and async staleness control.

Hard ยท 44 min
3

Deep Dive - FlashAttention

Read the Dao-AILab FlashAttention repo: exact tiled attention, online softmax, causal 2.1 alignment, FA2/FA3/FA4 packages, and when PyTorch SDPA is the better call.

Hard ยท 35 min
4

Deep Dive - FlashInfer

Trace FlashInfer from irregular KV-cache layouts through load-balanced attention kernels, composable state, and production serving boundaries.

Hard ยท 38 min
5

Deep Dive - DeepGEMM

Read DeepGEMM as a GPU-kernel case study: tiled GEMMs, FP8/FP4 scaling, runtime JIT, the DeepSeek indexer, and Mega MoE overlap on a Flash-shaped expert layer.

Hard ยท 53 min
6

Deep Dive - NCCL

Read NCCL as the communication engine beneath distributed AI: collective contracts, rings and trees, topology discovery, CUDA streams, transports, profiling, and hang diagnosis.

Hard ยท 37 min
7

Deep Dive - Megatron

Read Megatron-LM and Megatron Core as a distributed training system: rank groups, parallel axes, optimizer sharding, MoE dispatch, low precision, and checkpoint operations.

Hard ยท 41 min
8

Deep Dive - DeepSpeed

Trace DeepSpeed from ZeRO ownership and dtype-aware memory accounting through gathered working sets, sharded Adam updates, offload, and checkpoint recovery.

Hard ยท 23 min
9

Deep Dive - Ray

Trace a real local Ray job through tasks, actors, object references, placement groups, and process failure, then connect those contracts to distributed AI libraries and serving.

Hard ยท 20 min
10

Deep Dive - MLflow

Read MLflow as an evidence and lineage system for models and LLM applications: tracking, artifacts, traces, evaluation datasets, prompts, registries, storage, and governance.

Hard ยท 27 min
11

Deep Dive - PyTorch

Read PyTorch from storage and strides through dispatch, autograd, torch.compile, SDPA, FSDP2, DTensor, and distributed checkpoint, then debug the contracts that make LLM training work.

Hard ยท 49 min
12

Deep Dive - Transformers

Read Hugging Face Transformers as a model-definition boundary: Hub revisions, AutoClass dispatch, PreTrainedModel lifecycle, device_map dispatch, tokenizers, multimodal processors, generation, caches, and serving integrations.

Hard ยท 42 min
13

Deep Dive - SGLang

Read SGLang from a frontend program to a GPU step: RadixAttention, scheduling, constrained decoding, speculative execution, parallelism, and production boundaries.

Hard ยท 41 min
14

Deep Dive - slime

Read slime as a SGLang-native RL post-training system: Ray placement, Megatron training, a token-level Sample contract, async rollouts, agent hooks, and weight-sync failure boundaries.

Hard ยท 41 min
15

Deep Dive - DeepEP

Trace DeepEP routing, gates, events, and logical bandwidth through pinned V2 kernels, then migrate to V2.5's EPBuffer, deferred epilogues, DeepJIT, and stricter runtime requirements.

Hard ยท 51 min
16

Deep Dive - Tinker

Read Tinker as a hosted LoRA post-training service: local control loops, remote GPU workers, token-level RL contracts, pipelined clock cycles, checkpoint export, and the boundaries that separate an SDK from infrastructure such as DeepEP.

Hard ยท 45 min
17

Deep Dive - Light-PEFT

Read Light-PEFT as an academic early-pruning research release: frozen-backbone PEFT still pays forward cost, masks become physical structured pruning, and PEFT modules and ranks shrink before a longer fine-tuning run.

Hard ยท 50 min