Preface
Author: Chip Huyen (also wrote Designing Machine Learning Systems)
Publisher: O’Reilly, 2025
What This Book Is About
A framework for adapting foundation models (LLMs + LMMs) to real-world applications. Covers the end-to-end process: evaluation, prompt engineering, RAG, agents, finetuning, dataset engineering, inference optimization, and architecture.
Key questions the book answers:
- Should I build this AI application?
- How do I evaluate outputs? Can AI evaluate AI?
- What causes hallucinations, and how to detect/mitigate them?
- When to finetune vs. not finetune?
- How much data do I need?
- How to make models faster, cheaper, and secure?
What This Book Is Not
- Not a tutorial (framework for selecting tools, not how to use them)
- Not an ML theory book (practical focus)
What You Should Already Know (Helpful but Not Required)
- Probabilistic concepts: sampling, determinism, distribution
- ML concepts: supervision, self-supervision, log-likelihood, gradient descent, backpropagation
- Neural network architectures: feedforward, recurrent, transformer
- Metrics: accuracy, F1, cosine similarity, cross entropy
Book Structure (Chapter Map)
| Chapter | Focus |
|---|---|
| 1 | What AI engineering is; use cases; planning |
| 2 | How foundation models work under the hood |
| 3–4 | Evaluation methodology and pipelines |
| 5 | Prompt engineering |
| 6 | RAG and agents (context construction) |
| 7 | Finetuning (model adaptation) |
| 8 | Dataset engineering |
| 9 | Inference optimization |
| 10 | End-to-end architecture + user feedback |
Companion Book
Designing Machine Learning Systems (DMLS) — covers traditional ML (tabular data, feature engineering, model training). AI Engineering covers foundation model apps (prompting, context construction, parameter-efficient finetuning). Both are self-contained and modular.
Author’s Criteria for “What Lasts”
- Does the problem result from fundamental AI limitations, or will it go away with better models?
- What do top researchers and engineers consider most important?
- Lindy’s Law: if something has been around for a while, it will continue to exist.