@GitHub_Daily: 想搞懂大语言模型底层原理,大部分资料只介绍理论知识,或者只给源码,看完还是一头雾水。 偶然看到 EveryonesLLM 这个开源教程,手把手带我们在 Google Colab 上从零搭建一个完整的大语言模型,全程动手写代码。 整套教程分…

X AI KOLs Timeline 工具

摘要

EveryonesLLM 是一个开源教程,提供29个章节的Colab笔记本,手把手教用户从零在Google Colab上搭建完整的大语言模型,包括预训练和指令微调,并支持中文。

想搞懂大语言模型底层原理,大部分资料只介绍理论知识,或者只给源码,看完还是一头雾水。 偶然看到 EveryonesLLM 这个开源教程,手把手带我们在 Google Colab 上从零搭建一个完整的大语言模型,全程动手写代码。 整套教程分成 29 个章节,从最基础的数据加载、词嵌入,一步步搭到注意力机制、Transformer 模块,最后完成预训练和指令微调。 GitHub:http://github.com/HayatoHongo/EveryonesLLM… 每个章节都是独立的 Colab 笔记本,打开浏览器就能跑,不用折腾本地环境。 而且采用「练习+答案」的模式,先自己填代码再对答案,学得更扎实。 教程一直在持续更新,最近还新增了视觉大模型(Vision LLM)的章节。 学完教程之后,我们能训练出一个能对话的小型 AI,还能在线体验效果。
查看原文
查看缓存全文

缓存时间: 2026/06/16 13:38

想搞懂大语言模型底层原理,大部分资料只介绍理论知识,或者只给源码,看完还是一头雾水。

偶然看到 EveryonesLLM 这个开源教程,手把手带我们在 Google Colab 上从零搭建一个完整的大语言模型,全程动手写代码。

整套教程分成 29 个章节,从最基础的数据加载、词嵌入,一步步搭到注意力机制、Transformer 模块,最后完成预训练和指令微调。

GitHub:http://github.com/HayatoHongo/EveryonesLLM…

每个章节都是独立的 Colab 笔记本,打开浏览器就能跑,不用折腾本地环境。

而且采用「练习+答案」的模式,先自己填代码再对答案,学得更扎实。

教程一直在持续更新,最近还新增了视觉大模型(Vision LLM)的章节。

学完教程之后,我们能训练出一个能对话的小型 AI,还能在线体验效果。


HayatoHongo/EveryonesLLM

Source: https://github.com/HayatoHongo/EveryonesLLM

🌐 Select Language / 日本語 🇯🇵 | 中文 🇨🇳

colab-badge.svg) Build LLM on Google Colab from scratch

EveryonesLLM_demo.gif

Click-> AI YOU build in Chapter29😘


Table of Contents

WebUI.png

WebApp Released (Now only in Japanese)

EveryonesLLM

ChapterEstimated TimeNotebook
Chapter 00: Start Tutorial1-2 hoursOpen in Colab
Chapter 01: Dataloader1-2 hoursOpen in Colab
Chapter 02: TokenEmbedding0.5-1 hourOpen in Colab
Chapter 03: PositionEmbedding0.5-1 hourOpen in Colab
Chapter 04: EmbeddingModule0.5-1 hourOpen in Colab
Chapter 05: LayerNorm1-2 hoursOpen in Colab
Chapter 06: AttentionHead3-4 hoursOpen in Colab
Chapter 07: MultiHeadAttention1-2 hoursOpen in Colab
Chapter 08: FeedForward1-2 hoursOpen in Colab
Chapter 09: TransformerBlock0.5-1 hourOpen in Colab
Chapter 10: VocabularyLogits0.5-1 hourOpen in Colab
Chapter 11: nanoGPT1-2 hoursOpen in Colab
Chapter 12: Trainer1-2 hoursOpen in Colab
Chapter 13: Tokens per second(CPU)1-2 hoursOpen in Colab
Chapter 14: Tokens per second(T4 GPU)0.5-1 hourOpen in Colab
Chapter 15: Train nanoGPT with GPU0.5-1 hourOpen in Colab
Chapter 16: Make only the model size bigger0.5-1 hour (+ 1 hour model training)Open in Colab
Chapter 17: Make the dataset bigger1-2 hours (+ 1 hour model training)Open in Colab
Chapter 18: tiktoken1-2 hours (+ 1 hour model training)Open in Colab
Chapter 19: Long Train1-2 hours (+ 6 hours model training)Open in Colab
Chapter 20: Learning rate0.5-1 hourOpen in Colab
Chapter 21: Scaling Law1-2 hoursOpen in Colab
Chapter 22: TinyStories(Main)1-2 hoursOpen in Colab
Chapter 22: TinyStories(Model Training)1 hourOpen in Colab
Chapter 23: RPE(OverSimplified)2-3 hoursOpen in Colab
Chapter 24: RPE(Simplified)1-2 hours (+ 1 hour model training)Open in Colab
Chapter 25: LR schedule1 hourOpen in Colab
Chapter 26: Checkpoint1 hourOpen in Colab
Chapter 27: Pretraining0.5 hour (+ 20 hours model training)Open in Colab
Chapter 28: Instruction Tuning0.5 hour (+ 0.5 hour model training)Open in Colab
Chapter 29: Magpie (Prompt mask)1.5 hours (+ 2 hours model training)Open in Colab

2026/6/5 Vision LLM beta is now available!

Explanations and exercises are not available yet. Evaluation on major benchmarks is also not available yet.

Please use it for early preview learning. We plan to update it from time to time, so we recommend working on it after future updates.

ChapterEstimated timeNotebook
Chapter 30: Vision Pretraining (Beta)3 hours model trainingOpen in Colab
Chapter 31: Vision Instruction Tuning (Beta)2 hours model trainingOpen in Colab

EveryonesVLM_demo

Link to Web App (Vision LLM)



Tensor Map (Full Tensor Overview)

Try making the tensor map below by yourself!
Do not worry, I prepared lots of hints for you.
View the full-resolution Tensor Map of the nanoGPT model on Canva

Everyones TensorMap


About the Development Environment

To keep setup easy, please try running all the samples on Google Colab.

However, Google Colab does not save checkmarks in checkboxes.
If you want to track your progress, or if you want to work little by little, say every 30 minutes, I recommend VS Code.
In that case, fork this repository and clone it to your own PC. Just use Google Colab extension for your VS code, then you can use Colab CPU and GPU.


Answers

ChapterEstimated TimeNotebook
Chapter 00: Start Tutorial1-2 hoursOpen in Colab
Chapter 01: Dataloader1-2 hoursOpen in Colab
Chapter 02: TokenEmbedding0.5-1 hourOpen in Colab
Chapter 03: PositionEmbedding0.5-1 hourOpen in Colab
Chapter 04: EmbeddingModule0.5-1 hourOpen in Colab
Chapter 05: LayerNorm1-2 hoursOpen in Colab
Chapter 06: AttentionHead3-4 hoursOpen in Colab
Chapter 07: MultiHeadAttention1-2 hoursOpen in Colab
Chapter 08: FeedForward1-2 hoursOpen in Colab
Chapter 09: TransformerBlock0.5-1 hourOpen in Colab
Chapter 10: VocabularyLogits0.5-1 hourOpen in Colab
Chapter 11: nanoGPT1-2 hoursOpen in Colab
Chapter 12: Trainer1-2 hoursOpen in Colab
Chapter 13: Tokens per second(CPU)1-2 hoursOpen in Colab
Chapter 14: Tokens per second(T4 GPU)0.5-1 hourOpen in Colab
Chapter 15: Train nanoGPT with GPU0.5-1 hourOpen in Colab
Chapter 16: Make only the model size bigger0.5-1 hour (+ 1 hour model training)Open in Colab
Chapter 17: Make the dataset bigger1-2 hours (+ 1 hour model training)Open in Colab
Chapter 18: tiktoken1-2 hours (+ 1 hour model training)Open in Colab
Chapter 19: Long Train1-2 hours (+ 6 hours model training)Open in Colab
Chapter 20: Learning rate0.5-1 hourOpen in Colab
Chapter 21: Scaling Law1-2 hoursOpen in Colab
Chapter 22: TinyStories(Main)1-2 hoursOpen in Colab
Chapter 22: TinyStories(Model Training)1 hourOpen in Colab
Chapter 23: RPE(OverSimplified)2-3 hoursOpen in Colab
Chapter 24: RPE(Simplified)1-2 hours (+ 1 hour model training)Open in Colab
Chapter 25: LR schedule1 hourOpen in Colab
Chapter 26: Checkpoint1 hourOpen in Colab
Chapter 27: Pretraining0.5 hour (+ 20 hours model training)Open in Colab
Chapter 28: Instruction Tuning0.5 hour (+ 1 hour model training)Open in Colab
Chapter 29: Magpie (Prompt mask)1.5 hours (+ 2 hours model training)Open in Colab

Sources

This tutorial is based on Andrej Karpathy’s nanoGPT and jingyaogong’s Minimind. For Instruction Tuning, it refers to Sebastian Raschka’s book Build a Large Language Model (From Scratch). For Vision LLM, it refers to LLaVA. I would like to take this opportunity to express my sincere gratitude.

Notice

This project is a community-based open-source educational project and is not affiliated with Google in any way.

About Project EveryonesLLM

EveryonesLLM Logo
EveryonesLLM Goal
EveryonesLLM Idea
EveryonesLLM Prerequites

相似文章

@GitHub_Daily: 想了解大语言模型到底是怎么工作的,找到的资料都太过于学术看不懂,或者说的太浅只讲概念,就没一个从头到尾讲清楚的内容。 无独有偶,看到 how-llms-work 这个项目,把大模型的完整流程做成了一个可视化交互网页,内容基于 Karpat…

X AI KOLs Timeline

An interactive visual guide, 'how-llms-work', breaks down the entire lifecycle of Large Language Models based on Andrej Karpathy's lectures, covering data collection to post-training.

@Xx15573208: 看了很多 Transformer 的文章,能听懂原理,但真正坐下来写代码,完全无从下手。 LLMs-from-scratch 专门解决这个问题:配套《Build a Large Language Model》一书,带你用 PyTorch …

X AI KOLs Timeline

LLMs-from-scratch 是一个 GitHub 仓库,配套《Build a Large Language Model》一书,提供从零用 PyTorch 实现 GPT 的完整代码,涵盖预训练、微调、RLHF 等全流程,已获 93K+ stars,适合想深入理解大模型原理的开发者。

@XAMTO_AI: 别再收藏那些看着热闹、用不上的 AI 教程了。 这本 《动手学大模型》 才是真正需要的——开源、免费、代码能跑。 全书 12 章,手把手带你走完大模型落地的完整流程: ① 语言模型基础 ② 提示词工程 ③ 语义搜索 ④ 模型微调 ⑤ 多模…

X AI KOLs Timeline

推荐一本开源免费的《动手学大模型》教程,涵盖语言模型基础、提示词工程、语义搜索、模型微调、多模态应用等12章,所有代码可直接在Colab中运行。

@wsl8297: 加州大学开放课程《大语言模型的强化学习》,用“理论 + 实战”的方式,把 AI 训练的关键技术从零到一讲透,帮你系统建立从强化学习到 LLM 训练的完整框架。 课程内容覆盖全面,配套资源齐全:讲座幻灯片、完整视频、实践练习一应俱全,学完就…

X AI KOLs Timeline

加州大学助理教授Ernest K. Ryu推出《大语言模型的强化学习》开放课程,结合理论与实践全面解析RLHF、PPO/DPO等LLM训练关键技术及配套资源。该课程为开发者与研究者提供了从基础算法到实战部署的系统学习路径。