内容简介 · · · · · ·
Learn how to create, train, and tweak large language models (LLMs) by building one from the ground up!
In Build a Large Language Model (from Scratch), you’ll discover how LLMs work from the inside out. In this insightful book, bestselling author Sebastian Raschka guides you step by step through creating your own LLM, explaining each stage with clear text, diagrams, and examples...
Learn how to create, train, and tweak large language models (LLMs) by building one from the ground up!
In Build a Large Language Model (from Scratch), you’ll discover how LLMs work from the inside out. In this insightful book, bestselling author Sebastian Raschka guides you step by step through creating your own LLM, explaining each stage with clear text, diagrams, and examples. You’ll go from the initial design and creation to pretraining on a general corpus, all the way to finetuning for specific tasks.
Build a Large Language Model (from Scratch) teaches you how to:
Plan and code all the parts of an LLM
Prepare a dataset suitable for LLM training
Finetune LLMs for text classification and with your own data
Use human feedback to ensure your LLM follows instructions
Load pretrained weights into an LLM
The large language models (LLMs) that power cutting-edge AI tools like ChatGPT, Bard, and Copilot seem like a miracle, but they’re not magic. This book demystifies LLMs by helping you build your own from scratch. You’ll get a unique and valuable insight into how LLMs work, learn how to evaluate their quality, and pick up concrete techniques to finetune and improve them.
The process you use to train and develop your own small-but-functional model in this book follows the same steps used to deliver huge-scale foundation models like GPT-4. Your small-scale LLM can be developed on an ordinary laptop, and you’ll be able to use it as your own personal assistant.
about the book
Build a Large Language Model (from Scratch) is a one-of-a-kind guide to building your own working LLM. In it, machine learning expert and author Sebastian Raschka reveals how LLMs work under the hood, tearing the lid off the Generative AI black box. The book is filled with practical insights into constructing LLMs, including building a data loading pipeline, assembling their internal building blocks, and finetuning techniques. As you go, you’ll gradually turn your base model into a text classifier tool, and a chatbot that follows your conversational instructions.
search inside this book
about the reader
For readers who know Python. Experience developing machine learning models is useful but not essential.
about the author
Sebastian Raschka has been working on machine learning and AI for more than a decade. Sebastian joined Lightning AI in 2022, where he now focuses on AI and LLM research, developing open-source software, and creating educational material. Prior to that, Sebastian worked at the University of Wisconsin-Madison as an assistant professor in the Department of Statistics, focusing on deep learning and machine learning research. He has a strong passion for education and is best known for his bestselling books on machine learning using open-source software.
喜欢读"Build a Large Language Model (From Scratch)"的人也喜欢 · · · · · ·
Build a Large Language Model (From Scratch)的书评 · · · · · · ( 全部 4 条 )

很棒的大语言模型入门书籍
这篇书评可能有关键情节透露
跟着书完成了一个自己的大模型,从模型实现/预训练/微调走完流程,github仓库地址: https://github.com/mcuking/PocketLLM 作者做到了深入浅出,用各种图形象的展示了大模型中的技术原理,尤其是注意力机制实现。 不过美中不足的是,缺少了反向传播用到的技术详解,比如梯度下... (展开)
如何手搓一个“微型GPT”小模型,看这本书就够了

这是一本初学AI非常好的书

> 更多书评 4篇
读书笔记 · · · · · ·
我来写笔记-
夏嘉莫察瓦绒 (余生北国,虽闻飞鱼之名...)
LLM is trained on a large, diverse dataset to develop a broad understanding of language. The success behind LLMs can be attributed to the transformer architecture that underpins many LLMs and the vast amounts of data on which LLMs are trained, allowing them to capture a wide variety of linguistic nuances, contexts, and patterns that would be challenging to encode manually. LLMs are trained on v...2024-11-22 10:06:06
-
夏嘉莫察瓦绒 (余生北国,虽闻飞鱼之名...)
Here is the basic concept about AI/Machine Learning/Deep Learning AI is fundamentally about creating coputer systems capable of performing tasks that ususally require human intelligence. These tasks include understanding natural language, recognizing patterns, and making decisions. Machine learning focuses on developing and improving learning algorithms. the key idea behind machine learning is ...2024-11-20 08:11:59
-
夏嘉莫察瓦绒 (余生北国,虽闻飞鱼之名...)
LLM is trained on a large, diverse dataset to develop a broad understanding of language. The success behind LLMs can be attributed to the transformer architecture that underpins many LLMs and the vast amounts of data on which LLMs are trained, allowing them to capture a wide variety of linguistic nuances, contexts, and patterns that would be challenging to encode manually. LLMs are trained on v...2024-11-22 10:06:06
-
夏嘉莫察瓦绒 (余生北国,虽闻飞鱼之名...)
Here is the basic concept about AI/Machine Learning/Deep Learning AI is fundamentally about creating coputer systems capable of performing tasks that ususally require human intelligence. These tasks include understanding natural language, recognizing patterns, and making decisions. Machine learning focuses on developing and improving learning algorithms. the key idea behind machine learning is ...2024-11-20 08:11:59
-
夏嘉莫察瓦绒 (余生北国,虽闻飞鱼之名...)
LLM is trained on a large, diverse dataset to develop a broad understanding of language. The success behind LLMs can be attributed to the transformer architecture that underpins many LLMs and the vast amounts of data on which LLMs are trained, allowing them to capture a wide variety of linguistic nuances, contexts, and patterns that would be challenging to encode manually. LLMs are trained on v...2024-11-22 10:06:06
-
夏嘉莫察瓦绒 (余生北国,虽闻飞鱼之名...)
Here is the basic concept about AI/Machine Learning/Deep Learning AI is fundamentally about creating coputer systems capable of performing tasks that ususally require human intelligence. These tasks include understanding natural language, recognizing patterns, and making decisions. Machine learning focuses on developing and improving learning algorithms. the key idea behind machine learning is ...2024-11-20 08:11:59
论坛 · · · · · ·
在这本书的论坛里发言以下书单推荐 · · · · · · ( 全部 )
- 学习BigData (视界)
- 深度学习与人工智能 (lyb)
- manning系列 (Blackopsgo)
- 书单|AI大模型研发训练营 (欧阳)
- AI生信 (豆友218263518)
谁读这本书? · · · · · ·
二手市场 · · · · · ·
- 在豆瓣转让 有561人想读,手里有一本闲着?
订阅关于Build a Large Language Model (From Scratch)的评论:
feed: rss 2.0
0 有用 无牙仔最乖了 2025-05-21 10:12:45 北京
带朋友入门LLM,看了一下这本书,感觉很合适。作者:Sebastian Raschka 真的是个宝藏。
1 有用 Jayceexu 2024-12-26 07:27:19 波多黎各
Best LLM intro book, 对于attention机制的解释是目前市面上解释的最直观易懂的 最重要的是,提供了end-to-end code demo, 从零到一来解释整个过程,非常难得
1 有用 以地之名 2024-12-21 12:09:53 美国
太神了,讲得真清楚,还有jupyter notebook本地可以完全reproduce
3 有用 yinchaoonline 2024-10-17 08:42:39 中国香港
One of the best LLM book I have ever read, providing a concise explaination of how LLM is built from scratch and how to use and fine-tune the LLM. B.T.W., another is hands-on LLM by Jay Alammar, whose... One of the best LLM book I have ever read, providing a concise explaination of how LLM is built from scratch and how to use and fine-tune the LLM. B.T.W., another is hands-on LLM by Jay Alammar, whose author is the same author of the famous blog "the illustrated transformer" (展开)
0 有用 后火Backfire 2025-04-20 18:05:34 英国
A review of basics of recent trend