Front Matter

How to Use This Book

Front-matter illustration: How to Use This Book.

There are four reasonable ways to read this book and they look like different books. The structure supports all four; this page tells you which mode fits which goal and where in the appendices the detailed routes live.

Four Ways to Read It

Note: Linear, Chapter 0 to Chapter 78

If you are learning the field from scratch and have a semester or roughly a hundred reading hours, the linear path was designed for you. Concepts compound: attention in Part I returns in alignment in Part IV, decoding in Part I returns in agents in Part VI, evaluation in Part IX returns in product strategy in Part XIV. The Self-Check questions at the end of each section let you gauge whether to move on. Plan on 80-120 reading hours plus lab time across 79 chapters (Chapters 0 through 78); the Researcher / Graduate Student route in Appendix C is the linear-with-research-emphasis variant.

Note: Goal-Based Pathway

If you are reading to ship a specific thing (RAG bot, agent, fine-tuned model, multimodal product, AI gateway), use one of the eight pathways in Appendix C: Reading Pathways. Each pathway names the destination, lists the chapters in order, gives a realistic time estimate (weekend to several weeks), and tells you what you can do at the end. Most pathways skip 60-80% of the book; that is the point.

Note: Course Syllabus (Instructors)

If you are teaching, Appendix B: Course Syllabi has five tested tracks with week-by-week schedules: undergraduate engineering, undergraduate research, graduate engineering, graduate research, and a professional bootcamp. Each track maps to a 14-week semester (or two semesters for the graduate tracks), names the assignments and lab milestones, and references the part-specific Tools of the Trade chapters that close each part for hands-on lab work. The reading-pathway routes in Appendix C complement the syllabi when you want to assign self-paced supplements.

Note: Reference (When Something Breaks)

If something is on fire in production, the book is also a reference. Each Tools of the Trade chapter at the end of every part catalogs the working platforms, libraries, models, and recovery patterns for that part. Use site search (top of every page, via Pagefind) for terms you remember imprecisely, then jump straight to the relevant section: hallucination drift, GPU memory cliff, tokenizer mismatch, eval flakiness, prompt-injection vector all have named home chapters.

The Callout Catalogue

Every chapter uses the same set of callout boxes so you know what to expect at a glance. The five most consequential are below; the full set appears on the actual chapter pages.

Big Picture

Frames the current topic in the context of the full LLM stack. Includes cross-references to earlier and later chapters. Opens every chapter.

Key Insight

The load-bearing idea of a section. If you only remember one thing from the section, this is it.

Warning

A pitfall that has cost real time or real money: silent tokenizer mismatches, GPU memory cliffs, non-deterministic outputs, eval contamination.

Library Shortcut

Appears after a from-scratch implementation, showing the one-liner equivalent in Hugging Face, LangChain, or another popular framework. The from-scratch lab is for understanding; this is for shipping. Each shortcut includes both the install command and a runnable snippet, like this:

# pip install transformers
from transformers import pipeline
classifier = pipeline("sentiment-analysis")
print(classifier("This book makes LLMs less mysterious."))
Research Frontier

Closes every chapter. Maps open questions and 2024-2026 papers worth reading, updated each edition. Especially useful if you are picking a thesis topic or scanning for what is not yet settled.

Additional callouts (Note for clarifications, Tip for practitioner shortcuts, Algorithm for language-neutral pseudocode, Practical Example for a worked scenario, Exercise for hands-on problems with expandable answers, Self-Check for end-of-section comprehension questions) follow the same pattern: the visual style tells you what kind of content you are about to read.

Code Conventions

Code uses Python 3.10+ throughout. Inline code appears in monospace; longer listings appear in syntax-highlighted blocks; output blocks show expected results. All code is tested and runnable, with fixed random seeds and pinned dependency versions; the lab repository linked at the end of each chapter contains the runnable files. The book assumes a recent PyTorch (2.4+) and the current major versions of Hugging Face transformers, datasets, and peft. Where a 2024-2026 model is referenced by name (DeepSeek-R1, Claude 4, GPT-5-omni, Llama 4 Scout, Veo 3, Sora 2, pi-0.5, Genie 3), the code targets the public API or open-weight release available at the time of writing.

Start Here

What Comes Next

The next page is brief: who wrote the book and why. Then the front matter ends and the book begins. Proceed to FM.6 About the Authors, or jump directly to Chapter 0.