karpathy/ng-video-lecture — explained in plain English
Analysis updated 2026-06-26
Follow along with Karpathy's Zero To Hero lecture series by running the code cells while watching the video to see each piece of GPT built live.
Walk through the git commit history to replay exactly how the GPT model was assembled step by step during the lecture.
Use the code as a minimal, readable GPT reference to understand the core architecture before studying larger implementations like nanoGPT.
| karpathy/ng-video-lecture | googlefonts/noto-emoji | ronreiter/interactive-tutorials | |
|---|---|---|---|
| Stars | 4,703 | 4,707 | 4,698 |
| Language | Python | Python | Python |
| Setup difficulty | moderate | easy | moderate |
| Complexity | 2/5 | 2/5 | 3/5 |
| Audience | researcher | designer | writer |
Figures from each repo's GitHub metadata at analysis time.
Requires PyTorch, GPU recommended for training but not required for small experiments, intended as a video lecture companion, not a standalone tutorial.
This repository holds the code written during Andrej Karpathy's Neural Networks: Zero To Hero video lecture series, specifically the first lecture covering nanoGPT. NanoGPT is a small, readable implementation of the GPT language model architecture, the same general type of model that powers ChatGPT. The repo is published so viewers can follow along, run the code themselves, and walk through the git history to see how the code was built step by step during the lecture. It is intended as a companion to the video, not a standalone tutorial. The README notes that model weight initialization was not covered in depth during the video, and the current code trains correctly but converges more slowly as a result. The author plans to address this in a future supplementary video and update the code at that time. For now the code remains close to what was shown on screen during the lecture.
The companion code for Andrej Karpathy's Neural Networks: Zero To Hero lecture series, a small, step-by-step Python implementation of the GPT language model you can run alongside the video to learn how it works from scratch.
Mainly Python. The stack also includes Python, PyTorch.
No explicit license is stated in the repository.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Verify against the repo before relying on details.