查询
最新公告

构建大型语言模型(从头开始)(最终版本)

English | 2024 | ISBN: 1633437167 | 370 pages | True PDF | 17.29 MB

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) bestselling author Sebastian Raschka guides you step by step through creating your own LLM. Each stage is explained with clear text, diagrams, and examples. You’ll go from the initial design and creation, to pretraining on a general corpus, and on to fine-tuning 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 • Fine-tune LLMs for text classification and with your own data • Use human feedback to ensure your LLM follows instructions • Load pretrained weights into an LLM

Build a Large Language Model (from Scratch) takes you inside the AI black box to tinker with the internal systems that power generative AI. As you work through each key stage of LLM creation, you’ll develop an in-depth understanding of how LLMs work, their limitations, and their customization methods. Your LLM can be developed on an ordinary laptop, and used as your own personal assistant.

Purchase of the print book includes a free eBook in PDF and ePub formats from Manning Publications.

About the technology

Physicist Richard P. Feynman reportedly said, “I don’t understand anything I can’t build.” Based on this same powerful principle, bestselling author Sebastian Raschka guides you step by step as you build a GPT-style LLM that you can run on your laptop. This is an engaging book that covers each stage of the process, from planning and coding to training and fine-tuning.

About the book

Build a Large Language Model (From Scratch) is a practical and eminently-satisfying hands-on journey into the foundations of generative AI. Without relying on any existing LLM libraries, you’ll code a base model, evolve it into a text classifier, and ultimately create a chatbot that can follow your conversational instructions. And you’ll really understand it because you built it yourself!

What's inside

• Plan and code an LLM comparable to GPT-2 • Load pretrained weights • Construct a complete training pipeline • Fine-tune your LLM for text classification • Develop LLMs that follow human instructions

About the reader

Readers need intermediate Python skills and some knowledge of machine learning. The LLM you create will run on any modern laptop and can optionally utilize GPUs.

About the author

Sebastian Raschka is a Staff Research Engineer at Lightning AI, where he works on LLM research and develops open-source software.

The technical editor on this book was David Caswell.

Table of Contents

1 Understanding large language models 2 Working with text data 3 Coding attention mechanisms 4 Implementing a GPT model from scratch to generate text 5 Pretraining on unlabeled data 6 Fine-tuning for classification 7 Fine-tuning to follow instructions A Introduction to PyTorch B References and further reading C Exercise solutions D Adding bells and whistles to the training loop E Parameter-efficient fine-tuning with LoRA

中文|2024|ISBN:1633437167|370页|True PDF|17.29 MB从头开始构建大型语言模型(LLM),学习如何创建、训练和调整LLM! 在《构建大型语言模型(从头开始)》一书中,畅销书作者Sebastian Raschka将逐步指导您创建自己的LLM。每个阶段都有清晰的文本、图表和示例进行解释。您将从最初的设计和创建,到对通用语料库进行预训练,再到对特定任务进行微调。 构建一个大型语言模型(从头开始)教你如何 •规划和编码LLM的所有部分•准备适合LLM培训的数据集•根据文本分类和您自己的数据微调LLM•使用人工反馈确保您的LLM遵循说明•将预训练的权重加载到LLM中 构建大型语言模型(从头开始)将带您进入人工智能黑盒子,修补为生成人工智能提供动力的内部系统。当您完成LLM创建的每个关键阶段时,您将深入了解LLM的工作原理、局限性和定制方法。您的LLM可以在普通笔记本电脑上开发,并用作您自己的个人助理。 购买纸质书包括曼宁出版公司提供的PDF和ePub格式的免费电子书。 关于技术 据报道,物理学家理查德·P·费曼说:“我不明白任何我不能构建的东西。”基于这一强大的原理,畅销书作家塞巴斯蒂安·拉斯卡在构建可以在笔记本电脑上运行的GPT风格的LLM时,会一步一步地指导你。这是一本引人入胜的书,涵盖了从规划和编码到培训和微调的每个阶段。 关于本书 构建大型语言模型(从头开始)是一个实用且非常令人满意的生成式人工智能基础实践之旅。在不依赖任何现有LLM库的情况下,您将编写一个基础模型,将其演化为文本分类器,并最终创建一个可以遵循您的对话指令的聊天机器人。你会真正理解它,因为它是你自己建造的! 里面是什么 •规划和编码与GPT-2相当的LLM•加载预训练权重•构建完整的培训管道•微调LLM以进行文本分类•开发遵循人工指令的LLM 关于读者 读者需要中级Python技能和一些机器学习知识。您创建的LLM可以在任何现代笔记本电脑上运行,并且可以选择使用GPU。 关于作者 Sebastian Raschka是Lightning AI的研究工程师,从事LLM研究并开发开源软件。 这本书的技术编辑是大卫·卡斯维尔。 目录 1了解大型语言模型2处理文本数据3编码注意力机制4从头开始实现GPT模型以生成文本5对未标记数据进行预训练6对分类进行微调7按照说明进行微调a PyTorch简介B参考文献和进一步阅读C练习解决方案D在训练循环中添加花里胡哨E使用LoRA进行参数高效微调
Download from free file storage


本站不对文件进行储存,仅提供文件链接,请自行下载,本站不对文件内容负责,请自行判断文件是否安全,如发现文件有侵权行为,请联系管理员删除。