Let's build GPT: from scratch, in code, spelled out.

17 Jan 2023 · 116 min
1:56:19

Andrej Karpathy builds a GPT from scratch, scaling a decoder-only transformer on Shakespeare data from validation loss 2.07 to 1.48. He walks through the NanoGPT codebase, explains why GPT uses causal self-attention instead of encoder-decoder architecture, and outlines ChatGPT's two-stage training: pre-training on 300 billion tokens, then fine-tuning with reinforcement learning.

Chapters

More from Andrej

youtube.com

Skill Issue: Andrej Karpathy on Code Agents, AutoResearch, and the Loopy Era of AI

6mo ago
youtube.com

Andrej Karpathy — “We’re summoning ghosts, not building animals”

1y ago
youtube.com

How I use LLMs

1y ago
youtube.com

CUDA Mode Keynote | Andrej Karpathy | Eureka Labs

2y ago
youtube.com

No Priors Ep. 80 | With Andrej Karpathy from OpenAI and Tesla

2y ago
youtube.com

Let's reproduce GPT-2 (124M)

2y ago
youtube.com

Let's build the GPT Tokenizer

2y ago
youtube.com

[1hr Talk] Intro to Large Language Models

2y ago
youtube.com

Building makemore Part 5: Building a WaveNet

3y ago
youtube.com

Andrej Karpathy: Tesla AI, Self-Driving, Optimus, Aliens, and AGI | Lex Fridman Podcast #333

4y ago
youtube.com

Building makemore Part 4: Becoming a Backprop Ninja

4y ago
See all content