Stanford · Hashimoto & Liang · Spring 2026

Language models, built from scratch.


All 18 recorded lectures of CS336 rebuilt as structured lessons — the lecture's own arc, reorganized for reading, with the code walked through, the resource math typeset, key remarks pulled out, and exercises to check yourself. The five assignments get companion pages that point you at the real work. Watch, read, work, tick it off.

Part 1

Basics

  1. 01 Overview, Tokenization
  2. 02 PyTorch (einops), Resource Accounting
  3. 03 Architectures, Hyperparameters
  4. 04 Attention Alternatives, Mixture of Experts
  5. Assignment 1 · Basics
Part 2

Systems

  1. 05 GPUs, TPUs
  2. 06 Kernels, Triton, XLA
  3. 07 Parallelism I
  4. 08 Parallelism II
  5. Assignment 2 · Systems
Part 3

Scaling, Inference, Evaluation

  1. 09 Scaling Laws I
  2. 10 Inference
  3. 11 Scaling Laws II
  4. 12 Evaluation
  5. Assignment 3 · Scaling
Part 4

Data

  1. 13 Data: Sources, Datasets
  2. 14 Data: Filtering, Deduplication
  3. Assignment 4 · Data
Part 5

Post-Training & Alignment

  1. 15 Mid/Post-Training: SFT, RLHF
  2. 16 Post-Training: RLVR
  3. 17 Alignment, Multimodality
  4. Assignment 5 · Alignment & Reasoning RL
Part 6

Guest Lectures

  1. 18 Guest Lecture: Dan Fu

Personal study companion for Stanford CS336 (Profs. Tatsunori Hashimoto & Percy Liang). Lectures, slides, and assignments © Stanford University and the CS336 staff. Private, non-commercial study use; not affiliated with Stanford. The Daniel Selsam guest lecture was not published and is not included.