Build LLM from scratch [July 2026] thumbnail 1
Build LLM from scratch [July 2026] thumbnail 2
Build LLM from scratch [July 2026]

Build LLM from scratch [July 2026]

A comprehensive, hands-on journey into the architecture of Large Language Models, from tokenization and attention mechanisms to building a fully functional GPT model from scratch.

View course on Vizuara
ModeSelf-Paced
LevelAdvanced
Sessions10 lessons
AudienceLearners
Course Description

This course provides a deep dive into the engineering and mathematical foundations of Large Language Models (LLMs).

Students will progress from basic tokenization and embedding concepts to implementing complex transformer blocks, self-attention, and feed-forward networks.

Learning Outcomes

By the end of this course, you will be able to:

Prerequisites
Course Sessions
Orientation
01

Course Logistics & Kick-off

Introduction to the course structure, office hour schedules, and the kick-off session.

Ensure you review the readme and schedule details before starting the technical modules.

Topics Covered

  • Course introduction and expectations
  • Office hour scheduling and Zoom access
  • Kick-off meeting highlights

Resources

Course ReadmeOffice Hours ScheduleKick-off Session Recording
Week 1
02

Introduction to LLMs

Understanding the fundamental mechanics of next-token prediction and the scaling laws that drive model performance.

Focus on the probability distribution of token predictions.

Topics Covered

  • Next token prediction mechanics
  • Scaling laws and emergent properties
  • Evolution of transformer architectures

Resources

Lecture 1 & 2 Video RecordingsNext Token Prediction Colab NotebookLecture Notes
Week 2
03

Pre-training, Fine-tuning & Tokenization

Exploring the training lifecycle and building a word-based tokenizer from scratch.

Pay close attention to handling out-of-vocabulary tokens.

Topics Covered

  • Pre-training vs. Fine-tuning
  • Zero and Few-shot learning
  • Building a word-based tokenizer

Resources

Lecture 3 & 4 Video RecordingsWord-based Tokenizer Colab NotebookLecture Notes
Week 3
04

Byte Pair Encoding (BPE)

Implementing BPE to solve the out-of-vocabulary problem in modern NLP.

BPE is the standard for models like GPT-2.

Topics Covered

  • BPE history and data compression roots
  • Subword tokenization
  • Implementing BPE from scratch

Resources

Lecture 5 & 6 Video RecordingsBPE Colab NotebookLecture Notes
Week 4
05

Token Embeddings

Converting token IDs into meaningful numerical vectors to capture semantic relationships.

Understand why random numerical assignments are insufficient.

Topics Covered

  • Input-target pair creation
  • Token embedding theory
  • Vector space representation

Resources

Lecture 7 & 8 Video RecordingsToken Embedding Colab NotebookLecture Notes
Week 5
06

Positional Encoding & Attention

Addressing the need for sequence order and the transition from RNNs to attention mechanisms.

Focus on why attention overcomes the context bottleneck.

Topics Covered

  • Positional encoding
  • Limitations of RNNs
  • Introduction to attention mechanisms

Resources

Lecture 9 & 10 Video RecordingsMiro NotesLecture Notes
Week 6
07

Self-Attention

Deep dive into the mathematics of self-attention and its implementation.

Master the query, key, and value matrices.

Topics Covered

  • Self-attention mathematics
  • Causal attention
  • Coding self-attention with trainable weights

Resources

Lecture 11 & 12 Video RecordingsSelf-Attention Colab NotebookLecture Notes
Week 7
08

Multi-Head Attention

Scaling attention to capture multiple perspectives in language data.

Understand the role of dropout and attention masks.

Topics Covered

  • Multi-head attention theory
  • Attention masks and dropout
  • Implementing multi-head attention

Resources

Lecture 13 & 14 Video RecordingsMulti-Head Attention Colab NotebookLecture Notes
Week 8
09

Feed Forward Networks & Normalization

Stabilizing deep models with layer normalization and feed-forward architectures.

Compare ReLU and GELU activation functions.

Topics Covered

  • Layer normalization theory
  • Feed-forward neural networks
  • Shortcut connections

Resources

Lecture 15 & 16 Video RecordingsLLM Architecture Colab NotebookLecture Notes
Week 9
10

Assembling the GPT Architecture

Final assembly of the GPT model and understanding batch processing.

This is the culmination of all previous modules.

Topics Covered

  • Assembling the GPT architecture
  • Parallel batch processing
  • Loss functions for LLMs

Resources

Lecture 17 Video RecordingFull Architecture Colab NotebookLecture Notes
Assessments

Hands-on Coding Labs

Complete the Google Colab notebooks provided for each module to build your own tokenizer, attention mechanism, and GPT model.

Technical Office Hours

Participate in weekly Saturday sessions to clarify doubts and discuss implementation challenges with the team.