Skip to content
Series
18 posts

Reading Stanford CS336 Language Modeling from Scratch

A lecture-by-lecture reading of Stanford CS336: tokenizers, data, scaling, training, parallelism, evaluation, and alignment across the full language-model pipeline.

Series guide

Language Modeling from Scratch: Five Assignments and a GPU Budget You Work Out Yourself | Stanford CS336 Course Overview

CS336 is Stanford's course on building a language model from scratch: five assignments cover the tokenizer and Transformer, training-systems optimization, scaling laws, data processing, and alignment and reasoning RL, with no code skeleton, only tests. The lectures, recordings, all five assignment repos and the leaderboards are public; from Assignment 2 on you supply your own compute, and the course-sponsored compute and grading are not available.

RLVR Scales Reasoning with Verifiable Rewards, but GRPO Is Not Free PPO | Stanford CS336 Lecture 16

Lecture 16 moves from PPO to GRPO and RLVR. Math, code, and environment outcomes provide scalable rewards and avoid some preference-model overoptimization, but group-normalized advantages introduce difficulty and length bias while rollout infrastructure becomes the dominant cost.

Multimodal Models Turn Images into Tokens, Then Reconcile Semantics with Detail | Stanford CS336 Lecture 17

Lecture 17 organizes CLIP/SigLIP, LLaVA, Qwen-VL, and Chameleon into three paths: contrastive encoders learn semantics, vision-encoder/projector/LM stacks provide understanding, and discrete image tokens enable generation. Resolution, token budgets, and modality balance constrain them all.