liveBook · Manning

What you will learn in The AI Pocket Book

by Emmanuel Maggiori

Chapter by chapter

Chapter 1: How AI works

The chapter introduces its scope and explains how AI and machine learning relate.

1.1 How LLMs work · 1.2 Text generation · 1.3 End of text · 1.4 Chat · 1.5 The system prompt · 1.6 Calling external software functions · 1.7 Retrieval-augmented generation · 1.8 The concept of tokens · 1.9 One token at a time · 1.10 Billed by the token · 1.11 What about languages other than English? · 1.12 Why do LLMs need tokens anyway? · 1.13 Embeddings: A way to represent meaning · 1.14 Machine learning and embeddings · 1.15 Visualizing embeddings · 1.16 Why embeddings are useful · 1.17 Why LLMs struggle to analyze individual letters · 1.18 The transformer architecture · 1.19 Step 1: Initial embeddings · 1.20 Step 2: Contextualization · 1.21 Step 3: Predictions · 1.22 Temperature · 1.23 Can you get an LLM to always output the same thing? · 1.24 Where to learn more · 1.25 Machine learning · 1.26 Deep learning · 1.27 Types of machine learning · 1.28 How LLMs are trained (and tamed) · 1.29 Loss · 1.30 Stochastic gradient descent · 1.31 Convolutions (images, video, and audio) · 1.32 Multimodal AI · 1.33 No free lunch · 1.34 Summary

What you learn in chapter 1 →

Chapter 2: Hallucinations

Introduces hallucinations as a major AI limitation and explains the author’s concern that improvements may reduce mistakes without eliminating them.

2.1 What are hallucinations? · 2.2 Made-up facts · 2.3 Misinterpretation · 2.4 Incorrect solutions to problems · 2.5 Overconfidence · 2.6 Unpredictability · 2.7 Why does AI hallucinate? · 2.8 Inadequate world models · 2.9 World models: Theory vs. practice · 2.10 Misaligned objectives · 2.11 Toy hallucination example: Price optimization · 2.12 Will hallucinations go away? · 2.13 Mitigation · 2.14 Hallucinations can kill a product · 2.15 Living with hallucinations · 2.16 Summary

What you learn in chapter 2 →

Chapter 3: Selecting and evaluating AI tools

The chapter introduces the AI-tool selection and performance-evaluation topics it will cover.

3.1 Proprietary vs. open source · 3.2 How to decide · 3.3 Off-the-shelf vs. fine-tuning · 3.4 How to decide · 3.5 Customer-facing AI apps vs. foundation models · 3.6 How to decide · 3.7 Model validation, selection, and testing · 3.8 Training set · 3.9 Validation set · 3.10 Test set · 3.11 Performance measures · 3.12 Accuracy · 3.13 Precision and recall · 3.14 Mean absolute error and root mean squared error · 3.15 Summary

What you learn in chapter 3 →

Chapter 4: When to use (and not to use) AI

The chapter introduction previews seven questions for deciding when to build an AI product, use conversational AI at work, or build an LLM wrapper.

4.1 Building an AI-based product · 4.2 Am I putting AI before the customer? · 4.3 Are hallucinations okay? · 4.4 Do I need to explain how the output is generated? · 4.5 Using conversational AI as an assistant · 4.6 Can I describe the task succinctly and validate the output easily? · 4.7 Has anyone done it before? · 4.8 What does an excellent job look like? · 4.9 Building LLM wrappers · 4.10 Will users interact with my product using natural language? · 4.11 Summary

What you learn in chapter 4 →

Chapter 5: How AI will affect jobs and how to stay ahead

The chapter introduction frames software engineers’ concern about AI replacing coding work and previews the questions the chapter will address.

5.1 Excellence gap · 5.2 Excellence gap in software engineering · 5.3 Recommendations · 5.4 Stringent validation · 5.5 Validation in software engineering · 5.6 Recommendations · 5.7 Tight control · 5.8 Control in software · 5.9 Recommendations · 5.10 A new opportunity: Making the web more human · 5.11 Philosophical detour: Automation and mass unemployment · 5.12 Summary

What you learn in chapter 5 →

Chapter 6: The fine print

The chapter introduces reasons to examine AI claims critically and consider the broader effects of using or building AI products.

6.1 Copyright · 6.2 Economics of AI · 6.3 Smoke and mirrors · 6.4 Regulation · 6.5 Prohibited AI practices · 6.6 High-risk systems · 6.7 Transparency obligations · 6.8 Foundation models · 6.9 Resource consumption · 6.10 Brains and consciousness · 6.11 Summary

What you learn in chapter 6 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.