Book Map
All ten chapters of Huyen's AI Engineering on one page: what each chapter covers, where it sits in the stack, and the terms to listen for.
The book follows the three-layer AI stack from Chapter 1. Most of it lives in Application. Chapters 7–9 go down into Model, and Chapter 10 puts the pieces together into a production System. Section names below come straight from the book's table of contents.
| Ch. | Layer | In one line | Terms to listen for |
|---|---|---|---|
| 1 | Overview | What foundation models are, why AI engineering became its own discipline, how to plan an AI product, and the three-layer stack. | token, self-supervision, foundation model, multimodal, prompt engineering vs finetuning, AI stack |
| 2 | Model | How the models you'll use are made (training data, transformer, scale, post-training) and how they produce output (sampling). | transformer, scaling law, SFT, preference finetuning/RLHF, reward model, temperature, top-k, top-p, structured outputs, hallucination |
| 3 | Application | Ways to evaluate open-ended outputs: language-model metrics, exact evaluation, AI as a judge, comparative ranking. | entropy, cross entropy, perplexity, functional correctness, exact match, lexical/semantic similarity, embedding, AI judge, Elo-style ranking |
| 4 | Application | Evaluating a whole system: what to measure, how to choose a model (build vs buy), and how to design an evaluation pipeline. | evaluation-driven development, factual consistency, instruction following, open weight, model API, public benchmarks, data contamination, rubric |
| 5 | Application | Prompting best practices, plus defending against attacks on your prompts. | in-context learning, zero-/few-shot, system prompt, context length, chain of thought, jailbreak, prompt injection (direct/indirect) |
| 6 | Application | Building context: retrieval-augmented generation, agents that plan and use tools, and memory. | RAG, sparse vs dense retrieval, BM25, vector search, chunking, reranking, query rewriting, tools, planning, reflection, memory |
| 7 | Model | When to finetune (and when RAG is the better fit), why finetuning is memory-hungry, and how parameter-efficient methods help. | finetuning vs RAG, backpropagation, trainable parameters, memory math, numerical precision (FP16/BF16/INT8), quantization, PEFT, LoRA, model merging |
| 8 | Model | Getting the data you train and evaluate on: curation, synthesis, and processing. | data quality/coverage/quantity, annotation, data synthesis, instruction data, distillation, deduplication |
| 9 | Model | Making inference faster and cheaper, at the model level and at the serving level. | compute- vs memory-bound, TTFT, TPOT, throughput, goodput, MFU/MBU, accelerators, KV cache, speculative decoding, batching, prefill/decode, prompt caching, parallelism |
| 10 | System | A reference architecture assembled step by step, plus monitoring and collecting user feedback. | context enhancement, input/output guardrails, model router, gateway, exact/semantic cache, observability, drift, user feedback, degenerate feedback loop |
The three layers
Paraphrased from Ch. 1, “Three Layers of the AI Stack.” You usually start at the top and move down only when you need to.
| Layer | Responsibilities | Chapters |
|---|---|---|
| Application development | Evaluation, prompt engineering and context construction, AI interface | 3, 4, 5, 6, 10 |
| Model development | Modeling and training (incl. finetuning), dataset engineering, inference optimization; evaluation again | 2, 7, 8, 9 |
| Infrastructure | Model serving, managing data and compute, monitoring | 9, 10 (touched on) |
Adaptation, from cheapest to heaviest
| Technique | Changes weights? | Data needed | Chapter |
|---|---|---|---|
| Prompt engineering | No | Least | 5 |
| RAG (context construction) | No | A document store to retrieve from | 6 |
| Finetuning | Yes | More | 7, 8 |
| Pre-training from scratch | Yes (starts from random weights) | The most by far; rarely your job | 2 |