Course 09  ·  Advanced

LLMs from Scratch

How large language models actually work: transformers, tokenization, pretraining, RLHF, inference efficiency, and scaling laws. No handwaving. No metaphors that stop short of the math.

Advanced 6 modules Capstone included Free forever ~4 hours total
Before this course

You should be comfortable reading Python, understand what a neural network is at a high level, and have completed or skimmed Fine-Tuning Models or AI Agents. You do not need to know matrix algebra, but you should be willing to read equations and think about what they mean.


Is this course for me?
This IS for you if
  • You are an engineer who uses LLMs and wants to understand the mechanism, not just the API
  • You are a technical PM who needs to have credible conversations with model teams
  • You have read blog posts about transformers but want to go deeper with real math
  • You want to understand why models behave the way they do at inference time
  • You are preparing for an ML engineering role and need a mental model of the full stack
This is NOT for you if
  • You want to use LLMs via an API without understanding internals
  • You are looking for a business-level overview of AI strategy
  • You need to implement a transformer from scratch in code right now
  • You have never worked with code before

What you will learn

Modules
M1
How Transformers Work
Self-attention, multi-head attention, Q/K/V matrices, dot-product attention, softmax scaling, the transformer block. The architecture that powers every modern LLM.
35 min
M2
Tokenization and Embeddings
BPE, WordPiece, SentencePiece. Token embeddings vs positional embeddings. Why vocabulary size is a design decision with real tradeoffs in cost and quality.
30 min
M3
Pretraining
Next-token prediction, cross-entropy loss, gradient descent at scale. Data curation, deduplication, and the Chinchilla laws (Hoffmann et al. arXiv:2203.06840).
35 min
M4
Fine-Tuning and RLHF
Supervised fine-tuning, the RLHF pipeline (Ouyang et al. arXiv:2203.02155), DPO (Rafailov et al. arXiv:2305.18290). How alignment changes model behavior and why it matters.
35 min
M5
Inference and Efficiency
Autoregressive decoding, KV cache, quantization (INT8/INT4), speculative decoding, and cost routing with FrugalGPT (Chen et al. arXiv:2310.11409).
30 min
M6
Scaling Laws and Emergent Behavior
Scaling laws (Kaplan et al. arXiv:2001.08361, Hoffmann et al. arXiv:2203.06840), what emergent capabilities actually are, and what the empirical evidence says about them.
30 min
CP
Capstone: The Complete LLM Pipeline
Summary of the full architecture from token to output, an interactive transformer forward pass visualizer, and your certificate of completion.
45 min
Start Module 1: How Transformers Work →
Related courses

Supporting blog series

Want to go deeper on LLM architecture for your organization's AI strategy?

Schedule a call with Arjun