From dca7f223f2a5c96540c4eb963fde0fed2087bdfc Mon Sep 17 00:00:00 2001 From: long_long_ago <149533107@qq.com> Date: Sun, 27 Jul 2025 16:09:12 +0800 Subject: [PATCH 1/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index da47563..8c52c55 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ ## 最新文章 +[大模型上下文工程之Prefix Caching技术详解](https://mp.weixin.qq.com/s/TA7DY1cynVNPYW-sVI2zHw)
[产品级AI应用的核心:上下文工程](https://mp.weixin.qq.com/s/93rEhMY7rIUlHIiPPDvEag)
[如何让Cursor精通鸿蒙开发?](https://mp.weixin.qq.com/s/gLgP7gGU0pmGc2x1hS-0UQ)
[深度解读斯坦福AI就业报告:未来哪些工作是“绿灯”,哪些是“红灯”?](https://mp.weixin.qq.com/s/8RUntvEMcbYCTbD56-rQKg)
From 15bc6c55b3f5da5987ecbf87f39b4108b793dba0 Mon Sep 17 00:00:00 2001 From: long_long_ago <149533107@qq.com> Date: Sun, 27 Jul 2025 16:09:35 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Revert=20"=E5=8D=87=E7=BA=A7=E4=B8=BA=20doc?= =?UTF-8?q?sify=20=E6=A8=A1=E6=9D=BF=E7=9A=84=EF=BC=9A=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=BD=91=E7=AB=99=EF=BC=8C=E6=94=AF=E6=8C=81=E5=8F=8B=E5=A5=BD?= =?UTF-8?q?=E7=9A=84=E4=BA=A4=E4=BA=92=E5=BD=A2=E5=BC=8F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 - .nojekyll | 0 _sidebar.md | 17 ------ cn-Book/1.理解大语言模型.md | 2 - cn-Book/2.处理文本数据.md | 2 - cn-Book/3.实现注意力机制.md | 2 - ...从零开始实现一个用于文本生成的 GPT 模型.md | 2 - cn-Book/5.在无标记数据集上进行预训练.md | 2 - cn-Book/6.用于分类任务的微调.md | 2 - cn-Book/7.指令遵循微调.md | 2 - cn-Book/附录A.PyTorch简介.md | 2 - cn-Book/附录B.参考文献和扩展阅读.md | 2 - cn-Book/附录C.习题解答.md | 2 - cn-Book/附录D.给训练循环添加高级技巧.md | 2 - cn-Book/附录E.使用LoRA的参数高效微调.md | 2 - index.html | 59 ------------------- run_docsify.sh | 3 - 17 files changed, 106 deletions(-) delete mode 100644 .nojekyll delete mode 100644 _sidebar.md delete mode 100644 index.html delete mode 100644 run_docsify.sh diff --git a/.gitignore b/.gitignore index 3d41e4c..e43b0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ .DS_Store - -.cursor - diff --git a/.nojekyll b/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/_sidebar.md b/_sidebar.md deleted file mode 100644 index 21d00a1..0000000 --- a/_sidebar.md +++ /dev/null @@ -1,17 +0,0 @@ -- **从零构建大模型** - - - [1.理解大语言模型](./cn-Book/1.理解大语言模型.md) - - [2.处理文本数据](./cn-Book/2.处理文本数据.md) - - [3.实现注意力机制](./cn-Book/3.实现注意力机制.md) - - [4.从零开始实现一个用于文本生成的 GPT 模型](./cn-Book/4.从零开始实现一个用于文本生成的%20GPT%20模型.md) - - [5.在无标记数据集上进行预训练](./cn-Book/5.在无标记数据集上进行预训练.md) - - [6.用于分类任务的微调](./cn-Book/6.用于分类任务的微调.md) - - [7.指令遵循微调](./cn-Book/7.指令遵循微调.md) - -- **附录** - - - [附录A. PyTorch简介](./cn-Book/附录A.PyTorch简介.md) - - [附录B. 参考文献和扩展阅读](./cn-Book/附录B.参考文献和扩展阅读.md) - - [附录C. 习题解答](./cn-Book/附录C.习题解答.md) - - [附录D. 给训练循环添加高级技巧](./cn-Book/附录D.给训练循环添加高级技巧.md) - - [附录E. 使用LoRA的参数高效微调](./cn-Book/附录E.使用LoRA的参数高效微调.md) diff --git a/cn-Book/1.理解大语言模型.md b/cn-Book/1.理解大语言模型.md index 2ca4fa5..24e0f96 100644 --- a/cn-Book/1.理解大语言模型.md +++ b/cn-Book/1.理解大语言模型.md @@ -1,5 +1,3 @@ -# 1.理解大语言模型 - 本章涵盖以下内容: - **大语言模型(LLM)背后基本概念的高级解释** diff --git a/cn-Book/2.处理文本数据.md b/cn-Book/2.处理文本数据.md index 1311885..b67b787 100644 --- a/cn-Book/2.处理文本数据.md +++ b/cn-Book/2.处理文本数据.md @@ -1,5 +1,3 @@ -# 2.处理文本数据 - 本章涵盖以下内容: + **为大语言模型的训练准备文本数据集** diff --git a/cn-Book/3.实现注意力机制.md b/cn-Book/3.实现注意力机制.md index 0054e13..801a557 100644 --- a/cn-Book/3.实现注意力机制.md +++ b/cn-Book/3.实现注意力机制.md @@ -1,7 +1,5 @@ -# 3.实现注意力机制 - 本章涵盖以下内容: + **探讨在神经网络中使用注意力机制的原因** diff --git a/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md b/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md index 0b7bbb4..8839fca 100644 --- a/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md +++ b/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md @@ -1,5 +1,3 @@ -# 4.从零开始实现一个用于文本生成的 GPT 模型 - 本章涵盖以下内容: + **编写一个类 GPT 的大语言模型(LLM),可以训练其生成类人文本(指的是由人工智能模型生成的文本,这些文本在语言表达、语法结构、情感表达等方面与人类自然书写的文本非常相似)** diff --git a/cn-Book/5.在无标记数据集上进行预训练.md b/cn-Book/5.在无标记数据集上进行预训练.md index 7e81c0f..079d8f0 100644 --- a/cn-Book/5.在无标记数据集上进行预训练.md +++ b/cn-Book/5.在无标记数据集上进行预训练.md @@ -1,5 +1,3 @@ -# 5.在无标记数据集上进行预训练 - 本章涵盖以下内容: + **计算训练集和验证集的损失,以评估训练过程中大型语言模型生成文本的质量** diff --git a/cn-Book/6.用于分类任务的微调.md b/cn-Book/6.用于分类任务的微调.md index 82c57b2..2314149 100644 --- a/cn-Book/6.用于分类任务的微调.md +++ b/cn-Book/6.用于分类任务的微调.md @@ -1,5 +1,3 @@ -# 6.用于分类任务的微调 - 本章涵盖以下内容: + **介绍不同的LLM微调方法** diff --git a/cn-Book/7.指令遵循微调.md b/cn-Book/7.指令遵循微调.md index 5171f73..87497d6 100644 --- a/cn-Book/7.指令遵循微调.md +++ b/cn-Book/7.指令遵循微调.md @@ -1,5 +1,3 @@ -# 7.指令遵循微调 - 本章涵盖以下内容: + **LLM 指令微调过程概述** diff --git a/cn-Book/附录A.PyTorch简介.md b/cn-Book/附录A.PyTorch简介.md index 659205a..6ecd85b 100644 --- a/cn-Book/附录A.PyTorch简介.md +++ b/cn-Book/附录A.PyTorch简介.md @@ -1,5 +1,3 @@ -# 附录A. PyTorch简介 - 本章涵盖以下内容: + **PyTorch深度学习框架概述** diff --git a/cn-Book/附录B.参考文献和扩展阅读.md b/cn-Book/附录B.参考文献和扩展阅读.md index c0b2b29..699a4ad 100644 --- a/cn-Book/附录B.参考文献和扩展阅读.md +++ b/cn-Book/附录B.参考文献和扩展阅读.md @@ -1,6 +1,4 @@ -# 附录B. 参考文献和扩展阅读 - - [第一章](#第一章) - [第二掌](#第二掌) - [第三章](#第三章) diff --git a/cn-Book/附录C.习题解答.md b/cn-Book/附录C.习题解答.md index 014c27a..0161020 100644 --- a/cn-Book/附录C.习题解答.md +++ b/cn-Book/附录C.习题解答.md @@ -1,6 +1,4 @@ -# 附录C. 习题解答 - - [第二掌](#第二掌) - [练习 2.1](#练习-21) - [练习 2.2](#练习-22) diff --git a/cn-Book/附录D.给训练循环添加高级技巧.md b/cn-Book/附录D.给训练循环添加高级技巧.md index 4224f25..be7ab62 100644 --- a/cn-Book/附录D.给训练循环添加高级技巧.md +++ b/cn-Book/附录D.给训练循环添加高级技巧.md @@ -1,5 +1,3 @@ -# 附录D. 给训练循环添加高级技巧 - - [D.1 学习率预热](#d1-学习率预热) - [D.2 余弦衰减](#d2-余弦衰减) - [D.3 梯度裁剪](#d3-梯度裁剪) diff --git a/cn-Book/附录E.使用LoRA的参数高效微调.md b/cn-Book/附录E.使用LoRA的参数高效微调.md index ec168db..3c338b3 100644 --- a/cn-Book/附录E.使用LoRA的参数高效微调.md +++ b/cn-Book/附录E.使用LoRA的参数高效微调.md @@ -1,5 +1,3 @@ -# 附录E. 使用LoRA的参数高效微调 - 本附录介绍低秩适应 (LoRA),这是最广泛使用的参数高效微调技术之一。在解释 LoRA 背后的主要思想之后,本附录将基于第 6 章中的垃圾邮件分类微调示例并对 LLM 进行微调。然而,需要注意的是,LoRA 微调也适用于第 7 章中讨论的有监督的指令微调。 ----- diff --git a/index.html b/index.html deleted file mode 100644 index 63beea7..0000000 --- a/index.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - Build a Large Language Model (From Scratch) 中文版 - - - - - - - -
- - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/run_docsify.sh b/run_docsify.sh deleted file mode 100644 index d3e5028..0000000 --- a/run_docsify.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -docsify serve . \ No newline at end of file From 84d96d107d05a4bdb95c0c2ea32e99329ebc2fdc Mon Sep 17 00:00:00 2001 From: long_long_ago <149533107@qq.com> Date: Sun, 27 Jul 2025 16:15:21 +0800 Subject: [PATCH 3/4] =?UTF-8?q?Revert=20"Revert=20"=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E4=B8=BA=20docsify=20=E6=A8=A1=E6=9D=BF=E7=9A=84=EF=BC=9A?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=BD=91=E7=AB=99=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=8B=E5=A5=BD=E7=9A=84=E4=BA=A4=E4=BA=92=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 + .nojekyll | 0 _sidebar.md | 17 ++++++ cn-Book/1.理解大语言模型.md | 2 + cn-Book/2.处理文本数据.md | 2 + cn-Book/3.实现注意力机制.md | 2 + ...从零开始实现一个用于文本生成的 GPT 模型.md | 2 + cn-Book/5.在无标记数据集上进行预训练.md | 2 + cn-Book/6.用于分类任务的微调.md | 2 + cn-Book/7.指令遵循微调.md | 2 + cn-Book/附录A.PyTorch简介.md | 2 + cn-Book/附录B.参考文献和扩展阅读.md | 2 + cn-Book/附录C.习题解答.md | 2 + cn-Book/附录D.给训练循环添加高级技巧.md | 2 + cn-Book/附录E.使用LoRA的参数高效微调.md | 2 + index.html | 59 +++++++++++++++++++ run_docsify.sh | 3 + 17 files changed, 106 insertions(+) create mode 100644 .nojekyll create mode 100644 _sidebar.md create mode 100644 index.html create mode 100644 run_docsify.sh diff --git a/.gitignore b/.gitignore index e43b0f9..3d41e4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .DS_Store + +.cursor + diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/_sidebar.md b/_sidebar.md new file mode 100644 index 0000000..21d00a1 --- /dev/null +++ b/_sidebar.md @@ -0,0 +1,17 @@ +- **从零构建大模型** + + - [1.理解大语言模型](./cn-Book/1.理解大语言模型.md) + - [2.处理文本数据](./cn-Book/2.处理文本数据.md) + - [3.实现注意力机制](./cn-Book/3.实现注意力机制.md) + - [4.从零开始实现一个用于文本生成的 GPT 模型](./cn-Book/4.从零开始实现一个用于文本生成的%20GPT%20模型.md) + - [5.在无标记数据集上进行预训练](./cn-Book/5.在无标记数据集上进行预训练.md) + - [6.用于分类任务的微调](./cn-Book/6.用于分类任务的微调.md) + - [7.指令遵循微调](./cn-Book/7.指令遵循微调.md) + +- **附录** + + - [附录A. PyTorch简介](./cn-Book/附录A.PyTorch简介.md) + - [附录B. 参考文献和扩展阅读](./cn-Book/附录B.参考文献和扩展阅读.md) + - [附录C. 习题解答](./cn-Book/附录C.习题解答.md) + - [附录D. 给训练循环添加高级技巧](./cn-Book/附录D.给训练循环添加高级技巧.md) + - [附录E. 使用LoRA的参数高效微调](./cn-Book/附录E.使用LoRA的参数高效微调.md) diff --git a/cn-Book/1.理解大语言模型.md b/cn-Book/1.理解大语言模型.md index 24e0f96..2ca4fa5 100644 --- a/cn-Book/1.理解大语言模型.md +++ b/cn-Book/1.理解大语言模型.md @@ -1,3 +1,5 @@ +# 1.理解大语言模型 + 本章涵盖以下内容: - **大语言模型(LLM)背后基本概念的高级解释** diff --git a/cn-Book/2.处理文本数据.md b/cn-Book/2.处理文本数据.md index b67b787..1311885 100644 --- a/cn-Book/2.处理文本数据.md +++ b/cn-Book/2.处理文本数据.md @@ -1,3 +1,5 @@ +# 2.处理文本数据 + 本章涵盖以下内容: + **为大语言模型的训练准备文本数据集** diff --git a/cn-Book/3.实现注意力机制.md b/cn-Book/3.实现注意力机制.md index 801a557..0054e13 100644 --- a/cn-Book/3.实现注意力机制.md +++ b/cn-Book/3.实现注意力机制.md @@ -1,5 +1,7 @@ +# 3.实现注意力机制 + 本章涵盖以下内容: + **探讨在神经网络中使用注意力机制的原因** diff --git a/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md b/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md index 8839fca..0b7bbb4 100644 --- a/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md +++ b/cn-Book/4.从零开始实现一个用于文本生成的 GPT 模型.md @@ -1,3 +1,5 @@ +# 4.从零开始实现一个用于文本生成的 GPT 模型 + 本章涵盖以下内容: + **编写一个类 GPT 的大语言模型(LLM),可以训练其生成类人文本(指的是由人工智能模型生成的文本,这些文本在语言表达、语法结构、情感表达等方面与人类自然书写的文本非常相似)** diff --git a/cn-Book/5.在无标记数据集上进行预训练.md b/cn-Book/5.在无标记数据集上进行预训练.md index 079d8f0..7e81c0f 100644 --- a/cn-Book/5.在无标记数据集上进行预训练.md +++ b/cn-Book/5.在无标记数据集上进行预训练.md @@ -1,3 +1,5 @@ +# 5.在无标记数据集上进行预训练 + 本章涵盖以下内容: + **计算训练集和验证集的损失,以评估训练过程中大型语言模型生成文本的质量** diff --git a/cn-Book/6.用于分类任务的微调.md b/cn-Book/6.用于分类任务的微调.md index 2314149..82c57b2 100644 --- a/cn-Book/6.用于分类任务的微调.md +++ b/cn-Book/6.用于分类任务的微调.md @@ -1,3 +1,5 @@ +# 6.用于分类任务的微调 + 本章涵盖以下内容: + **介绍不同的LLM微调方法** diff --git a/cn-Book/7.指令遵循微调.md b/cn-Book/7.指令遵循微调.md index 87497d6..5171f73 100644 --- a/cn-Book/7.指令遵循微调.md +++ b/cn-Book/7.指令遵循微调.md @@ -1,3 +1,5 @@ +# 7.指令遵循微调 + 本章涵盖以下内容: + **LLM 指令微调过程概述** diff --git a/cn-Book/附录A.PyTorch简介.md b/cn-Book/附录A.PyTorch简介.md index 6ecd85b..659205a 100644 --- a/cn-Book/附录A.PyTorch简介.md +++ b/cn-Book/附录A.PyTorch简介.md @@ -1,3 +1,5 @@ +# 附录A. PyTorch简介 + 本章涵盖以下内容: + **PyTorch深度学习框架概述** diff --git a/cn-Book/附录B.参考文献和扩展阅读.md b/cn-Book/附录B.参考文献和扩展阅读.md index 699a4ad..c0b2b29 100644 --- a/cn-Book/附录B.参考文献和扩展阅读.md +++ b/cn-Book/附录B.参考文献和扩展阅读.md @@ -1,4 +1,6 @@ +# 附录B. 参考文献和扩展阅读 + - [第一章](#第一章) - [第二掌](#第二掌) - [第三章](#第三章) diff --git a/cn-Book/附录C.习题解答.md b/cn-Book/附录C.习题解答.md index 0161020..014c27a 100644 --- a/cn-Book/附录C.习题解答.md +++ b/cn-Book/附录C.习题解答.md @@ -1,4 +1,6 @@ +# 附录C. 习题解答 + - [第二掌](#第二掌) - [练习 2.1](#练习-21) - [练习 2.2](#练习-22) diff --git a/cn-Book/附录D.给训练循环添加高级技巧.md b/cn-Book/附录D.给训练循环添加高级技巧.md index be7ab62..4224f25 100644 --- a/cn-Book/附录D.给训练循环添加高级技巧.md +++ b/cn-Book/附录D.给训练循环添加高级技巧.md @@ -1,3 +1,5 @@ +# 附录D. 给训练循环添加高级技巧 + - [D.1 学习率预热](#d1-学习率预热) - [D.2 余弦衰减](#d2-余弦衰减) - [D.3 梯度裁剪](#d3-梯度裁剪) diff --git a/cn-Book/附录E.使用LoRA的参数高效微调.md b/cn-Book/附录E.使用LoRA的参数高效微调.md index 3c338b3..ec168db 100644 --- a/cn-Book/附录E.使用LoRA的参数高效微调.md +++ b/cn-Book/附录E.使用LoRA的参数高效微调.md @@ -1,3 +1,5 @@ +# 附录E. 使用LoRA的参数高效微调 + 本附录介绍低秩适应 (LoRA),这是最广泛使用的参数高效微调技术之一。在解释 LoRA 背后的主要思想之后,本附录将基于第 6 章中的垃圾邮件分类微调示例并对 LLM 进行微调。然而,需要注意的是,LoRA 微调也适用于第 7 章中讨论的有监督的指令微调。 ----- diff --git a/index.html b/index.html new file mode 100644 index 0000000..63beea7 --- /dev/null +++ b/index.html @@ -0,0 +1,59 @@ + + + + + + Build a Large Language Model (From Scratch) 中文版 + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/run_docsify.sh b/run_docsify.sh new file mode 100644 index 0000000..d3e5028 --- /dev/null +++ b/run_docsify.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +docsify serve . \ No newline at end of file From 1774e1903717c48b2d9865c010cab14f01d1505a Mon Sep 17 00:00:00 2001 From: Ning Guo Date: Wed, 30 Jul 2025 11:36:15 +0800 Subject: [PATCH 4/4] add link to Image --- cn-Book/Image | 1 + 1 file changed, 1 insertion(+) create mode 120000 cn-Book/Image diff --git a/cn-Book/Image b/cn-Book/Image new file mode 120000 index 0000000..8e7c774 --- /dev/null +++ b/cn-Book/Image @@ -0,0 +1 @@ +../Image \ No newline at end of file