Skip to content

Lecture Slides

One deck per chapter, for instructors who teach the book in a course and for readers who want a chapter they can page through in ten minutes.

Every deck follows its chapter in order. It opens with the question the chapter answers and with where the chapter sits on the book's map. Then come the goals and the words to know, one idea per slide with the chapter's own figure, the code and its real output, a lab step, a business example and a discussion question. It closes with a recap, the check-your-understanding questions, the chapter's assignment and the references.

Every number and every line of terminal output on the slides comes from the book, whose scripts produced them, so nothing is typed in by hand. Each deck's Markdown source opens with a timing budget for a 75-minute class and carries speaker notes with a source line for every fact.

Table S.1: The decks, one per chapter.

Module Deck
1: Foundations Chapter 1: Environment Setup
Chapter 2: What Is an LLM?
Chapter 3: Tensors and PyTorch
Chapter 4: Tokenization
Chapter 5: Embeddings
2: Building the Model Chapter 6: Self-Attention
Chapter 7: Multi-Head Attention
Chapter 8: Feed-Forward and Norms
Chapter 9: The Transformer Block
Chapter 10: The Full GPT Architecture
Chapter 11: Causal Language Modeling
3: Training and Generation Chapter 12: Dataset and DataLoader
Chapter 13: The Training Loop
Chapter 14: Checkpointing
Chapter 15: Greedy and Sampling
Chapter 16: Temperature and Top-k
Chapter 17: Putting It All Together

Every slide has a kind

The decks are written for students and non-specialists who have not programmed before. The color down the left edge of a slide, and the chip in its top right corner, say what a student does with it. The book's pages use the same colors for the same parts.

  • Idea Listen and look: one idea, with the chapter's own figure.
  • Read the code A few lines, beside what they do.
  • Run it Predict a number, then watch the script print it.
  • Your turn Try it, discuss it, check your understanding.
  • In business What the idea means at work.
  • Watch out The common mistake, shown beside the fix.
  • Summary The chapter in four or five points.
  • Assignment Fifteen minutes to take home: run it, change one number, explain it.

Teaching with the decks

  • One chapter per class. Each deck is budgeted for a 75-minute session and marks the live run or lab as the part to protect when time runs short.
  • Easy to read from the back row. No slide carries more than 85 words of prose, and the goals, the words to know and the assignment each have a slide of their own.
  • The live run is the point. Every deck has a slide where the instructor runs one of the book's scripts in front of the class, and the numbers on the slide are what the script prints.
  • Students read the PDF afterwards. Every technical term is glossed on the slide itself, so the deck stands on its own without the notes.
  • The sources are editable. The decks are written in Marp Markdown, with a shared theme and a build script. Write to hello@jackluu.io for the source files. The notes and the timing budget are in the source.

The slides carry the same license as the book text, CC BY-NC-ND 4.0.