Build your own GPT from Scratch [Jan 2025 cohort archive] thumbnail

Build your own GPT from Scratch [Jan 2025 cohort archive]

59 lessons9 topics51h 23mself-paced

About this course

"Build Your Own GPT from Scratch" is an intensive course designed to empower students with the skills and knowledge required to understand and construct large language models (LLMs) from the ground up. This course dives deeply into the core concepts of language models, including pre-training, fine-tuning, and the emergent properties that arise as models scale. Through a series of lectures and practical coding exercises, students will explore fundamental processes such as tokenization, byte pair encoding, and attention mechanisms, all critical to building an efficient GPT model. Detailed lessons guide participants through creating word-based tokenizers, implementing self-attention from scratch, and understanding multi-head attention and feed-forward networks within the transformer architecture. The curriculum goes beyond theoretical concepts with hands-on experience using Google Colab for coding assignments and constructing production-level language models tailored for children's linguistic capabilities. The course also addresses technical challenges like loss function optimization and instruction and classification fine-tuning, ensuring learners can adapt large models for specific tasks such as spam detection. This program is ideal for aspiring AI professionals, machine learning enthusiasts, and researchers eager to deepen their expertise in natural language processing and model deployment. Active participation is encouraged through assignments and discussions on Discord, fostering a collaborative learning environment. With a blend of advanced theoretical insights and extensive coding practice, students will complete this course ready to innovate in the fields of AI and LLMs, meeting both industrial and academic demands.

Course curriculum

9 topics • 59 lessons

51h 23m
Introduction21 items
  1. Zoom Link for all lectures (Sat-Sun, 8-9:30 am IST)
  2. Lecture 1 Video Recording: Introduction to LLMs
  3. Lecture 2 Video Recording: Scaling laws and emergent properties
  4. Lecture 1-2 Lesson Notes
  5. Lecture 3 Video Recording: Pre-training, finetuning, Zero-Few shot learning
  6. Lesson 3 Lesson Notes
  7. Lecture 4 Video Recording (Tokenization intro, Building a Word based tokenizer)
  8. Lecture 4 Lesson Notes (Tokenization)
  9. Google Colab: Build a word based tokenizer
  10. Lesson 5: Byte Pair Encoding Introduction
  11. Lesson 5 Lecture Notes (Byte Pair Encoding)
  12. Lesson 6 Video Recording (BPE Coded from Scratch)
  13. Lesson 6 Google Colab Notebook
  14. Lecture 7 Video Recording (Create Input-Target Pairs)
  15. Lecture 7, 8 Lesson Notes (Input-Target Pairs, Token Embeddings)
  16. Lecture 8 Video Recording (Token Embeddings)
  17. Teaching Assignment 1: Explaining Large Language Models to a 15-Year-Oldassignment
  18. Assignment 2: Tokenizationassignment
  19. Mid-Term Take Home Assignment: Tokenization in Depth
  20. Lecture 9 Video Recording (Positional Encoding, LLM Data Pipeline Summary)
  21. Lecture 9 Lesson Notes (Positional Encodings)
Language Model Architecture20 items
  1. Lecture 10 Video Recording (The need for an attention mechanism)
  2. Lecture 10 Lesson Notes (Need for an attention mechanism)
  3. Lecture 11 Video Recording (Self attention calculation and mathematics)
  4. Lecture 11 Lesson Notes (Self attention calculation and mathematics)
  5. Lecture 12 Video Recording (Self Attention Coding, Causal Attention)
  6. Lecture 12 Google Colab Notebook (Self Attention)
  7. Lecture 13 Video Recording (Multi-head Attention Introduction)
  8. Lecture 14 Video Recording (Multi-Head Attention Coded from Scratch)
  9. Lecture 12, 13, 14 Lesson Notes (Self Attention, Multi-head Attention)
  10. Google Colab Notebook Self-Causal-Multi head attention
  11. Lesson 15 Video Recording (Layer Normalization Theory + Code)
  12. Lesson 15 Lecture Notes (Layer Norm Theory + Code)
  13. Lesson 16 Lesson Notes (Feed Forward Neural Network + Shortcut Connections)
  14. Lecture 17 Lesson Notes (Assembling the GPT Architecture)
  15. Lecture 17 Video Recording (Assembling the GPT Architecture)
  16. Lecture 18 Lesson Notes (LLM Loss Functions Theory + Code)
  17. Google Colab Notebook: Entire LLM Architecture
  18. Lesson 16 Video Recording (Feed Forward Neural Network + Shortcut Connections)
  19. Lecture 18 Video Recording (LLM Loss Functions Theory + Code)
  20. Google Colab Notebook: LLM Loss Function
Training Large Language Models3 items
  1. Google Colab: Pre-train and entire LLM from scratch
  2. Lecture 19 Lesson Notes (Entire LLM Pre-training)
  3. Lecture 19 Video Recording (Entire LLM Pre-training)
Very Important: Course Details (start date, timings, readings etc)9 items
  1. Hear from the course instructor Dr. Raj Dandekar
  2. Why am I not able to access the lecture videos below?
  3. What if I have additional doubts? How can I get these doubts clarified?
  4. Get ready with these things soon
  5. Is attendance mandatory?
  6. Will there be assignments?
  7. What if I miss a lecture?
  8. Where will the lectures happen?
  9. Start date and timings
Build GPT from Scratch Midsemester Examination0 items
    Finetuning LLMs5 items
    1. Lecture 24 Video Recording (Instruction Fine-tuned LLM)
    2. Google Colab: Instruction Fine-tuned LLM
    3. Google Colab: Classification finetuned LLM
    4. Lecture 23, 24 Lesson Notes (Classification finetuned LLM)
    5. Lecture 23 Video Recording (Classification finetuned LLM)
    Build GPT from Scratch MidSem Makeup Exam (11 April)0 items
      Build a Small Language Model (SLM) from Scratch4 items
      1. Google Colab: Build Production Level SLM from Scratch
      2. Lecture 20. 21, 22 (Build a production level SLM from scratch)
      3. Lecture 20, 21, 22 Lesson Notes (Build a production level SLM from Scratch)
      4. Research Assignment: Experiment with the LLM Architecture!assignment
      Course End Test1 items
      1. Course End Testcourse end test