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.

Reference

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.LayerIn one lineTerms to listen for
1Overview 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
2Model 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
3Application 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
4Application 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
5Application 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)
6Application 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
7Model 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
8Model Getting the data you train and evaluate on: curation, synthesis, and processing. data quality/coverage/quantity, annotation, data synthesis, instruction data, distillation, deduplication
9Model 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
10System 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.

LayerResponsibilitiesChapters
Application developmentEvaluation, prompt engineering and context construction, AI interface3, 4, 5, 6, 10
Model developmentModeling and training (incl. finetuning), dataset engineering, inference optimization; evaluation again2, 7, 8, 9
InfrastructureModel serving, managing data and compute, monitoring9, 10 (touched on)

Adaptation, from cheapest to heaviest

TechniqueChanges weights?Data neededChapter
Prompt engineeringNoLeast5
RAG (context construction)NoA document store to retrieve from6
FinetuningYesMore7, 8
Pre-training from scratchYes (starts from random weights)The most by far; rarely your job2

← Lesson 1: The big pictureSampling · Evaluation · Glossary

Related ideas