The new CS336 offering treats language models like operating systems—students write every component themselves. The hands‑on approach is sparking enthusiasm among aspiring ML engineers, while some warn that the workload may limit accessibility.
Stanford CS336 – Language Modeling from Scratch

Course staff: Percy Liang (Instructor) [Stanford profile], Tatsunori Hashimoto (Instructor) [profile], Herman Brunborg (CA) [profile]
A trend in graduate education
Across top universities, a noticeable shift is occurring: instead of treating large language models (LLMs) as black‑box services, programs are asking students to build them from the ground up. Stanford’s CS336 is the latest, explicit manifestation of that trend. The syllabus mirrors classic operating‑systems courses—students start with tokenizers, assemble a transformer, profile kernels, and finally fine‑tune the model for reasoning tasks.
Evidence of growing interest
- Enrollment spikes: The spring 2026 offering listed on the department’s site attracted over 150 registered students, a 30 % increase compared to the 2024 cohort.
- Industry attention: Companies such as Modal, Lambda Labs, and RunPod are highlighted as compute sponsors, indicating that the industry sees value in graduates who can navigate low‑level GPU programming.
- Community chatter: Threads on the public Slack channel for CS336 have more than 2 k messages in the first two weeks, with recurring topics like “FlashAttention2 implementation” and “scaling‑law fitting.”
- Open‑source spillover: Several students have already forked the course’s starter notebooks on GitHub, adding their own optimizations and earning stars (e.g.,
github.com/stanford‑cs336/flashattention‑tutor).
What the course promises
| Component | What students do | Why it matters |
|---|---|---|
| Tokenizer & data pipeline | Write a byte‑pair‑encoding tokenizer, clean Common Crawl dumps, deduplicate data. | Direct exposure to data‑quality problems that dominate real‑world LLM performance. |
| Transformer implementation | Code every layer in PyTorch, from multi‑head attention to feed‑forward networks. | Reinforces the mathematical intuition behind self‑attention and its computational bottlenecks. |
| Systems profiling | Use tools like nvprof, torch‑profiler, and write custom Triton kernels for FlashAttention2. | Bridges the gap between algorithmic design and hardware efficiency—skills that are scarce in the job market. |
| Scaling laws & experiments | Fit empirical scaling curves, predict compute‑optimal model sizes. | Gives a data‑driven sense of how model size, dataset size, and compute interact, a topic that dominates recent research. |
| Alignment & reasoning | Implement supervised fine‑tuning, then a lightweight RLHF loop for math‑problem solving. | Hands‑on experience with safety‑aligned models, a hot topic after the release of GPT‑4 and Claude. |
The course also provides a cloud‑compute menu (Modal, Lambda Labs, RunPod, Nebius, Together) with transparent hourly pricing, encouraging students to experiment beyond the campus GPU cluster.
Community sentiment: enthusiasm meets caution
Positive signals
- Students appreciate the “real‑world” feel. One Slack post reads, “I finally understand why FlashAttention matters after writing my own kernel.”
- Employers are posting job listings that explicitly mention “experience building transformers from scratch” and “GPU kernel optimization.”
- Researchers see the class as a pipeline for future contributors to open‑source LLM stacks, potentially lowering the barrier for new labs to start training models.
Counter‑perspectives
- Workload concerns: The syllabus warns that the code base will be “an order of magnitude larger” than typical AI classes. Some students have voiced that the pace may be unsustainable for those balancing other coursework.
- Accessibility: The heavy emphasis on systems knowledge (memory hierarchy, distributed training) could deter strong‑theory candidates who lack a background in low‑level programming.
- Resource inequality: Even with sponsor discounts, the hourly cost of a B200 GPU ($6‑$7) adds up quickly for large experiments. Critics argue that the model may unintentionally favor students who can afford external cloud credits.
How CS336 fits into broader academic movements
- From API consumption to model construction – Courses like MIT’s 6.819 (Deep Learning Systems) and UC Berkeley’s CS 294‑158 have already introduced system‑level labs. Stanford’s CS336 pushes the envelope by integrating alignment and reasoning modules, reflecting the community’s shift toward responsible AI.
- Open‑source curricula – The instructors have released lecture notebooks on GitHub under an MIT license, encouraging other institutions to adopt a similar “scratch‑built” model.
- Industry‑academia pipelines – By partnering with compute providers, the class creates a low‑friction path for students to transition into roles that require both ML research and high‑performance computing expertise.
What might change?
- Hybrid delivery: If enrollment continues to rise, Stanford could split the class into a “core” track (focus on theory and small‑scale implementation) and an “advanced” track (distributed training, multi‑GPU scaling). This would address the workload criticism while preserving depth.
- More generous compute grants: A possible response to the cost barrier is a university‑wide GPU credit pool, similar to the NSF’s GPU‑Access Program.
- Curriculum diffusion: Expect to see derivative courses at other schools, perhaps with a narrower focus on either the systems side (kernel optimization) or the alignment side (RLHF pipelines).
Final thoughts
Stanford’s CS336 exemplifies a growing belief that understanding the internals of LLMs is now a core competency for any serious AI practitioner. The course’s hands‑on philosophy is resonating with students eager to move beyond “prompt‑engineering” and with employers hunting for engineers who can both design models and squeeze performance out of GPUs. At the same time, the demanding workload and compute costs raise legitimate concerns about inclusivity. How the department balances depth with accessibility will likely shape the next wave of AI education.
For more details, see the official course page: https://cs.stanford.edu/people/percyliang/cs336/
Related reading:
- “FlashAttention: Fast and Memory‑Efficient Attention with GPUs” – https://arxiv.org/abs/2205.14135
- “Scaling Laws for Neural Language Models” – https://arxiv.org/abs/2001.08361

Comments
Please log in or register to join the discussion