What is the difference between Volume I and Volume II?
Volume I covers foundations and the complete transformer architecture in nine chapters: tokenization, embeddings, positional encoding, attention, residuals, layer norm, the feed-forward network, and a complete GPT built from scratch in PyTorch. Volume II covers what happens after a model is trained: inference internals, KV cache, quantization, batching, RLHF, instruction tuning, LoRA, QLoRA, and four end-to-end applied projects on real domains.
Which volume should I read first?
If you want to understand how transformers work and read research papers without bouncing, start with Volume I. If you need to ship a fine-tuned LLM into production for a specific domain like legal, SQL, function-calling, or classification, Volume II is the faster path to the answers you need.
What background do I need before reading this book?
Comfort with Python (loops, classes, NumPy basics) and a working understanding of neural networks at a high level. You do not need a graduate degree, you do not need to have read the original transformer paper, and you do not need linear algebra beyond matrix multiplication and dot products. Every concept is built up from intuition first, math second.
What programming language and framework is used?
PyTorch throughout. Volume I builds a complete GPT from scratch in PyTorch in Chapter 9. Volume II uses PyTorch with Hugging Face Transformers and PEFT for the four applied fine-tuning projects.
Does the book cover the latest models like GPT-4, Claude, and Llama?
The mechanisms taught in the book are what every modern LLM is built on: decoder architecture, tokenization, attention, KV cache, RLHF, LoRA. Once you understand these, every commercial model you use, including GPT-4, Claude, Gemini, and the Llama family, becomes legible. The book teaches the substrate, not the API surface.
How is this book different from other LLM books that build a GPT from scratch?
Most build-from-scratch books stop at training a small GPT. Inside Large Language Models keeps going. After Volume I builds and trains the model, Volume II walks through production inference, optimization, RLHF, and four applied fine-tuning projects on real domains: contract classification, legal QLoRA, text-to-SQL, and function calling. You finish with a model in production, not just a model on disk.
Will I be able to build a GPT from scratch after reading?
Chapter 9 of Volume I is exactly this exercise. By the end you will have written every component of a GPT in PyTorch and trained it on real text. Every line is annotated. Every tensor shape is shown.
Does this book cover AI agents and agentic AI?
Chapter 17 of Volume II covers function calling end to end: the LLM-side capability that AI agents and agentic AI workflows depend on. Tool use, structured output, the model-side mechanics that let an LLM decide which function to call and what arguments to pass. The book does not cover specific agent frameworks like LangChain, AutoGPT, or CrewAI. It teaches the LLM-side foundation that every agent framework builds on. Once you understand function calling at the level this book teaches, every agent framework becomes a thin wrapper around what you already know.
Where can I buy the book?
Volume I is available on Leanpub and Amazon. Volume II is available on Amazon. Direct links are at the top and bottom of this page.