walkinglabs / modern-llm-notebook
PublicA hands-on guide with 23 Jupyter Notebooks to master modern Large Language Models from the ground up, using PyTorch to implement core components like BPE Tokenizers, Multi-Head Attention, MoE, RLHF, and on-policy distillation—no pre-built libraries required.
Modern LLM Notebook is an educational course created by Walking Lab that teaches people how modern AI language models work by building each component from scratch. The project contains 23 interactive Jupyter notebooks organized into five chapters: Foundation (tokenizers, embeddings, attention), Training (loss functions, scaling, alignment), Inference (generation, acceleration), Frontiers (long context, reasoning, vision), and Production (evaluation, distillation). Users can learn through traditional Jupyter notebooks or through a polished web viewer built with React. The course emphasizes hands-on learning—every concept is introduced with small examples you can calculate by hand, then implemented in Python code you can run and modify. Both English and Chinese documentation are provided.
How It Works
You've read articles about Transformers and attention mechanisms, but they felt like magic. You wanted to understand what happens inside an AI assistant.
Someone shares Modern LLM Notebook with you—a collection of 23 hands-on lessons that teach you to build each piece of an AI model yourself, starting from tiny examples.
The course offers a beautiful web viewer where you can read through notebooks like chapters in a book, with a guided tour to show you around.
Step by step, you see how words become tokens, how tokens become vectors, and how vectors carry meaning. Each lesson starts with a tiny example you can calculate by hand.
Following the notebooks, you implement the attention mechanism, add position encoding, and assemble your own small GPT that can actually generate text.
Learn how models improve through loss functions, scaling laws, and alignment techniques like RLHF.
Discover how generation works and why caching makes AI responses faster.
Experiment with long context, reasoning chains, and vision-language models.
You've built tokenizers, attention mechanisms, and your own small model. The magic of AI is no longer mysterious—you've created it yourself.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.