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.
See full terms...
Kick off your book project in 2 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Tuesday, June 16, 2026. Learn more…
Simple Arithmetic and beginners Python based approach
Most books about ChatGPT explain the magic. This one shows you the math. Inside Large Language Models, Volume I takes a curious beginner from "what is an LLM" to a complete, trained GPT, with nothing more than high-school algebra, a working laptop, and a willingness to read carefully. Every formula is walked through by hand. Every line of code comes with a plain-English explanation. By the end you will have built, trained, and run your own transformer from scratch, and you will know exactly what is happening inside.
No PhD or Data Science required. No prior machine learning needed. Just curiosity and a calculator.
Minimum price
$19.99
$24.99
About the Book
Inside Large Language Models, Volume I is the book the field has been missing: a plain-English, math-light, code-first introduction to the technology behind every modern AI assistant. No prior machine learning experience is assumed. No graduate-level mathematics is required. Every concept is walked through with simple arithmetic that a motivated high-school student can follow on paper.
Volume I takes you from the very first question, "what is a large language model, really?" to building and training a complete GPT-style model from scratch in Python. Along the way you will:
Most LLM books fall into one of two camps: the popular-science books that explain the ideas without ever showing the math, and the academic textbooks that bury the ideas under a wall of notation. Inside Large Language Models takes a third path. It treats the reader as a serious adult who wants the real machinery, but it refuses to require any background the reader does not already have. Every formula is preceded by a plain-English paragraph that explains what the formula is doing. Every code listing is followed by a line-by-line table that explains what each line is doing. Every concept is paired with a concrete numerical example you can verify on paper.
Volume I is the foundation: tokenisation, embeddings, positional encoding, attention in all its forms, the complete transformer block, training, and a from-scratch GPT. Volume II takes those foundations into production: inference, alignment, fine-tuning, and four end-to-end fine-tuning projects.
By the end of Volume I, you will not just know how a transformer works. You will have built one yourself, trained it, and watched it generate text. The mystery will be gone. What is left is mastery.
Companion code: every listing in the book is available as a runnable Python file at https://github.com/ritesh-modi/inside-llm. Clone it, run it, modify it, break it, fix it.
Bundles that include this book
About the Author
Ritesh Modi is Head of AI at MarketOnce and a former Forward Deployed Engineer at Microsoft. He has spent more than a decade building and shipping production systems across cloud, distributed computing, and applied machine learning, working with organizations ranging from global enterprises to fast-moving startups. His recent work focuses on applied large language models, designing systems that turn pretrained models into reliable, task-specific tools.
Ritesh has authored multiple technology books and speaks regularly at industry conferences on AI, cloud architecture, and software engineering. His writing philosophy rests on a simple belief: the best technical books are written by practitioners who still remember what it felt like to not understand something, not by experts who have forgotten. Every explanation in this book was tested against that standard, if it would not have made sense to him when he was first learning this material, it was rewritten until it did.
He writes, shares ideas, and connects with readers at www.riteshmodi.com. When he is not writing or building AI systems, he can be found mentoring engineers, exploring new architectures, or debugging a training run that should have converged three hours ago.
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms...
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 earned over $15 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
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
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.