Let's build GPT from scratch, in code
Tip: use the player's CC button to enable or switch subtitles; English captions are available on these videos.
| Item | Details |
|---|---|
| Speaker | Andrej Karpathy |
| Channel | Andrej Karpathy |
| Date | Jan 17, 2023 |
| Duration | 1:56:20 |
| Format | Video |
| Topics | #llm · #engineering · #open-source |
Why it matters
The classic hands-on Transformer tutorial: Karpathy opens an empty file and builds a working nano-GPT in under two hours. Self-attention, multi-head attention, residual connections and LayerNorm become runnable PyTorch. The single most effective video for de-magicking LLMs.
Key takeaways
- Core of GPT: attention lets tokens 'communicate' by relevance, then predict the next one.
- Full Transformer from scratch: embeddings → multi-head attention → feed-forward → residuals + LayerNorm → output head.
- Training: sample text batches → compute loss → backprop — all in a few hundred lines.
- The tiny Shakespeare-style model shows viscerally how intelligence grows out of prediction.
- After this, the GPT-2/GPT-3 papers read like old friends.
Original video
- Speaker
- Andrej Karpathy
- Channel
- Andrej Karpathy
- Venue
- Part of his 'Zero to Hero' series
- Date · Duration
- Jan 17, 2023 · 1:56:20
Let's build GPT: from scratch, in code, spelled out.
Watch the original on YouTubeSources & Further Reading
This page is grounded in the authoritative sources below — verifiable and citable by AI engines and readers.
- 👤 Person: Andrej Karpathy
- # Topic: LLMsLLM capabilities, products and best practices
- # Topic: EngineeringAPIs, prompting and system design
- # Topic: Open SourceOpen models, frameworks and ecosystems
Citation: Please attribute Laojin Global (laojinchuhai.com) and keep the original link.
Made by Laojin · AI that ships
AllModelsAPIOne key for many models
AllModelsAPI is a multi-model API gateway: one key reaches many models through an OpenAI-compatible interface — point your existing code at a new base URL and you're migrated. It's not a demo: our own production workloads run on it every day.
More from Laojin: Sellenca · 365AIOrg · 365Loopa · 365 Ops · 365Skill
Related
Linked by topic, people and hubs