The Hundred-Page Language Models Book
The Hundred-Page Language Models Book
hands-on with PyTorch
About the Book
Master language models through mathematics, illustrations, and code―and build your own from scratch!
The Hundred-Page Language Models Book by Andriy Burkov, the follow-up to his bestselling The Hundred-Page Machine Learning Book (now in 12 languages), offers a concise yet thorough journey from language modeling fundamentals to the cutting edge of modern Large Language Models (LLMs). Within Andriy's famous "hundred-page" format, readers will master both theoretical concepts and practical implementations, making it an invaluable resource for developers, data scientists, and machine learning engineers.
The Hundred-Page Language Models Book allows you to:
- Master the mathematical foundations of modern machine learning and neural networks
- Build and train three architectures of language models in Python
- Understand and code a Transformer language model from scratch in PyTorch
- Work with LLMs, including instruction finetuning and prompt engineering
Written in a hands-on style with working Python code examples, this book progressively builds your understanding from basic machine learning concepts to advanced language model architectures. All code examples run on Google Colab, making it accessible to anyone with a modern laptop.
About the technology
Language models have evolved from simple n-gram statistics to become one of the most transformative technologies in AI, rivaling only personal computers in their impact. This book spans the complete evolution—from count-based methods to modern Transformer architectures—delivering a thorough understanding of both how these models work and how to implement them.
About the book
The Hundred-Page Language Models Book takes a unique approach by introducing language modeling concepts gradually, starting with foundational methods before advancing to modern architectures. Each chapter builds upon the previous one, making complex concepts accessible through clear explanations, diagrams, and practical implementations.
What's inside
- Essential machine learning and neural network fundamentals
- Text representation techniques and basic language modeling
- Implementation of RNNs and Transformer architectures with PyTorch
- Practical guidance on finetuning language models and prompt engineering
- Important considerations on hallucinations and ways to evaluate models
- Additional resources for advanced topics through the book's wiki
The complete code and additional resources are available through the book's website at thelmbook.com/wiki.
About the reader
Readers should have programming experience in Python. While familiarity with PyTorch and tensors is helpful, it's not required. College-level math knowledge is beneficial, but the book presents mathematical concepts intuitively with clear examples and diagrams.
About the author
Andriy Burkov holds a Ph.D. in Artificial Intelligence and is a recognized expert in machine learning and natural language processing. As a machine learning expert and leader, Andriy has successfully led dozens of production-grade AI projects in different business domains at Fujitsu and Gartner. His previous books have been translated into a dozen languages and are used as textbooks in many universities worldwide. His work has impacted millions of machine learning practitioners and researchers worldwide.
Vint Cerf, Internet pioneer and Turing Award recipient: "This book cleared up a lot of conceptual confusion for me about how Machine Learning actually works - it is a gem of clarity."
Tomáš Mikolov, the author of word2vec and FastText: "The book is a good start for anyone new to language modeling who aspires to improve on state of the art."
Table of Contents
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them