Let's build GPT: from scratch, in code, spelled out.
14 人推荐 · 跨 8 个月 · 2023–2025

中文导读
前 OpenAI 研究员兼特斯拉 AI 总监 Andrej Karpathy 用两小时手把手教学,基于 PyTorch 从零手写实现 GPT。对照经典论文《Attention Is All You Need》与 GPT-2/3 架构,层层拆解自注意力机制与大模型核心机理。
为什么 HN 推它
理解 Transformer 和大语言模型底层逻辑的首选必看视频,Karpathy 行云流水的代码讲解将抽象理论讲得清晰透彻。
「关于这个主题,我至今看过的最棒的视频,没有之一。」HN 网友原话:the best video I have seen on the topic
英文原摘要(HackerTube / Claude 整理)
Andrej Karpathy builds a GPT from scratch in code, following Attention Is All You Need and GPT-2/3, in about two hours using PyTorch. He connects it to ChatGPT and assumes familiarity with his earlier makemore videos.
It is the go-to recommendation for learning how transformers and LLMs actually work, praised for its clarity and Karpathy's teaching.
HN 上的提及
I recommend this video on the subject.
Andrej Karpathy's GPT video is a must have companion for this
Karpathy discusses a challenging part.
I was blown away
I would highly recommend watching and working though the code (if possible) of NanoGPT by Andrej Karpathy.