KARPATHY · ZERO TO HERO · 7 REPOS
LLM Zero to One · A Visual Learning Guide
从 100 行的反向传播引擎出发,一路走到能通宵替你做实验的 Agent。
From a 100-line backprop engine all the way to an agent that runs your training experiments overnight.
阶梯 Ladder · 概览 Overview · 页面内容 Contents · 项目结构 Structure · 本地预览 Run locally
| 层级 Level | 仓库 Repo | 分类 Area | 你会亲手造出 What you build |
|---|---|---|---|
autoresearch |
智能体 Agents |
让 Coding Agent 通宵替你做实验 A coding agent that runs your training experiments overnight |
|
nanochat |
产品 Product |
从分词器到 Web UI 的端到端聊天模型 An end-to-end chat model, from tokenizer to web UI |
|
llm.c |
底层 · 选修 Systems · optional |
不依赖 PyTorch 的 C/CUDA GPT-2 训练器 A GPT-2 trainer in raw C/CUDA, without PyTorch |
|
nanoGPT |
训练 Training |
可复现 GPT-2 的训练 / 微调循环 A training and fine-tuning loop that reproduces GPT-2 |
|
minbpe |
Token Tokens |
与 GPT-4 同款输出的 BPE 分词器 A BPE tokenizer whose output matches GPT-4's |
|
nn-zero-to-hero |
模型 Models |
bigram → MLP → WaveNet → Transformer Eight video lectures, from bigram to Transformer |
|
micrograd |
数学 Math |
约 100 行的标量反向传播引擎 A scalar backprop engine in about 100 lines |
越往上,抽象越高、系统越完整;越往下,越接近第一性原理。L5 是选修分支,主线可以从 L4 直接走到 L6。点击层级标签查看页面上的模块拆解。
Higher levels are more abstract and more complete; lower levels are closer to first principles. L5 is an optional branch: the main path can go straight from L4 to L6. Click a level tag to open its deep dive on the site.
以 Andrej Karpathy 的七个开源仓库为主线,把“从零构建大模型”整理成一份可视化学习手册。
七个仓库对应上面的七级抽象阶梯,每上一级,你都会亲手造出一个能运行的东西。页面把它们的依赖关系、核心机制、工程亮点、投入成本和学习路线放在同一张“地图”上,适合想系统补齐大模型底层能力的工程师。
A visual study guide to building large language models from scratch, following Andrej Karpathy's seven open-source repositories.
The seven repositories form the ladder above, and at every step you build something that actually runs. The page puts their dependencies, core mechanisms, engineering highlights, costs and learning roadmap on a single map, for engineers who want a solid grasp of how LLMs work under the hood.
| 7 | 307.8k | ≈200 h | $75–175 |
|---|---|---|---|
| 个开源仓库 open-source repos |
GitHub Star 合计 GitHub stars in total |
标准路线 · 17 周 standard route · 17 weeks |
全程 GPU 预算 total GPU budget |
| 章节 Section | 内容 What's inside | 主要图表 Key figures |
|---|---|---|
| 00 一页速览 At a glance |
七级抽象阶梯、关键数字、素材中需要校准的 4 处事实 The seven-level ladder, key numbers and 4 commonly misquoted facts |
— |
| 01 技能雷达与图谱架构 Skill radar & dependency map |
七个项目的依赖关系、前置知识与心智门槛 How the seven projects depend on each other, prerequisites and mental hurdles |
FIG.01 项目依赖图谱 · FIG.02 四个关键阶段 FIG.01 Project dependencies · FIG.02 Four key stages |
| 02 核心模块拆解 Module deep dives |
每个仓库的核心机制、工程亮点与关键产出 Core mechanism, engineering highlights and key outputs of each repo |
FIG.03 speedrun 流水线 · FIG.04 实验循环 FIG.03 Speedrun pipeline · FIG.04 Experiment loop |
| 03 多维对比表 Comparison table |
代码量、语言、硬件、抽象层级、成本、门槛、耗时 Code size, language, hardware, abstraction level, cost, difficulty and time |
— |
| 04 可视化看板 Dashboard |
Star 对比、成本断崖、耗时与难度热力表 Star counts, the cost cliff, and a time and difficulty heatmap |
FIG.05 Star 数 · FIG.06 成本曲线 · FIG.07 耗时 × 难度象限 · FIG.08 时间投入分布 FIG.05 Stars · FIG.06 Cost curve · FIG.07 Time × difficulty · FIG.08 Time allocation |
| 05 学习路线与时间表 Roadmap & schedule |
17 周标准路线、阶段验收标准、快速通道、预算与避坑 A 17-week standard route, exit criteria per stage, a fast track, budget and pitfalls |
FIG.09 17 周标准路线 FIG.09 17-week standard route |
| 06 方向建议 Career directions |
结合 Agent、系统与机器人方向的进阶建议 Next steps toward agents, systems and robotics |
— |
| 07 来源 Sources |
全部数据与引用的出处 Where every number and quote comes from |
— |
index.html 页面本体 · the page itself
docs/handbook.md Markdown 版手册 · the handbook in Markdown
tools/audit.js 页面检查脚本 · page check script
.github/workflows/ 推送到 main 后自动发布 · publishes to GitHub Pages on push to main
页面没有构建步骤,直接打开 index.html 即可;也可以起一个本地服务:
There is no build step: open index.html directly, or serve the folder locally:
python3 -m http.server 8000
# 打开 / open http://localhost:8000/- 数据核对于 2026-11-02;Star 数取自各仓库的 GitHub 页面。
Data checked on 2026-11-02; star counts come from each repository's GitHub page. - 耗时、难度与预算为经验估计,云 GPU 成本按约 $3 / GPU·小时计算。
Time, difficulty and budget are experience-based estimates; cloud GPU cost assumes about $3 per GPU-hour. - 页面内全部引用见第 07 节“来源”。
All references are listed in section 07, Sources.
《斯坦福 AI 课程地图》:11 门斯坦福 AI 核心课程的依赖图谱、课程档案、对比矩阵与学习路线。在线访问
Stanford AI Course Map: a dependency graph, course dossiers, a comparison matrix and learning paths for 11 core Stanford AI courses. Live site
《大模型 Attention 架构与技术路线对照》:11 组国产大模型、22 个模型版本如何给注意力减负,涵盖混合线性、滑动窗口与动态稀疏。在线访问
Attention Architectures in Chinese LLMs: how 11 Chinese LLM families (22 model versions) make attention cheaper with hybrid linear, sliding-window and dynamic sparse attention. Live site