Tags

Nlp

deep-learning2 min

CS336 — Language Modeling from Scratch

Course: Stanford CS336 — Spring 2026
Instructors: Percy Liang & Tatsunori Hashimoto
Unit value: 5 units — implementation-heavy

“We will lead students through every aspect of language model creation, including data collection and cleaning for pre-training, transformer model construction, model training, and evaluation before deployment.”

Prerequisites

Assignments

# Topic Key Skills
1 Basics Tokenisation, embeddings, transformer forward pass
2 Systems Kernel optimisation, memory-efficient attention, distributed training
3 Scaling Multi-GPU training, pipeline & tensor parallelism
4 Data Data collection, cleaning, deduplication, mixing strategies
5 Alignment & RL RLHF, DPO, reasoning-oriented RL

Logistics

Why this course matters

Most LLM courses treat the model as a black box API. CS336 is the opposite — you implement everything from scratch, mirroring the approach of an OS course where you build a full operating system. This gives you:

Read more →