Mohammad Khalid
(03)Case study← All work

A comprehensive first-principles course that reverse-engineers every single line of a 200-line GPT implementation, teaching how language models work from scratch.

Index
03 / 09
Stack
Python · MkDocs · Machine Learning
Live
iamkhalid2.github.io ↗
Fig. 03 · SpectrumOne emission line per tool, each at a fixed wavelength, so projects built with the same tool light the same line.Same lines as Pilot, KWealth

Overview

MicroGPT Course is an educational deep-dive that deconstructs Andrej Karpathy's minimal GPT implementation line-by-line, building understanding from fundamental math to a working language model.

Key Features

  • 33 Comprehensive Lessons: Organized into 6 modules covering data, autograd, architecture, training, and inference
  • No Prerequisites: Assumes only 10th-grade math and basic Python knowledge
  • First-Principles Approach: Every concept explained from the ground up with no hand-waving
  • Interactive Learning: Mermaid diagrams, KaTeX equations, and styled admonitions

Course Structure

  1. Data & Tokenization: Character-level encoding and vocabulary
  2. Calculus & Autograd: Custom automatic differentiation engine
  3. Architecture: Transformer with attention, MLP, and residual connections
  4. Training: Adam optimizer and backpropagation
  5. Inference: Temperature-controlled text generation

Technical Details

Built with MkDocs Material for an elegant reading experience. The course deconstructs a complete GPT model written in pure Python with zero external dependencies—proving that modern AI isn't magic, just math and careful engineering.

→ Next project04 / 09

Black Hole Simulation