Well, if you have been living under the rock since October 2022, made yourself visible in September 2026, and now wish to get a baseline understanding of AI terms and how they differ from the earlier ML-heavy terminology of 2010s, here is a book you can get started on
This book “AI Engineering — Building Applications with Foundation Models” by Chip Huyen is a fairly technical book for building applications on top of foundation models. It covers the entire application stack including foundation models, evaluation, prompting, RAG and agents, finetuning, data, inference optimization, application architecture and user feedback
One reason I liked the book is that it focuses more on the fundamentals than on specific tools (which anyway keep changing every few months or days in AI!). In fact, a running joke is that one needs to be unemployed to just keep pace with the latest developments in AI!

Here are my key learnings from the book. I have retained a lot of the wording verbatim from the book since many of the definitions are precise enough as they are
1. AI Engineering is different from traditional ML Engineering
- ML engineering focuses on building applications on top of traditional ML models, which involves more tabular data annotations, feature engineering, and model training. AIE focuses on building applications on top of foundation models, which involves more prompt engineering, context construction, and parameter-efficient finetuning
- This means that AI engineering focuses less on modeling and training, and more on model adaptation
- There are three layers to any AI application stack: application development, model development, and infrastructure
2. At its heart, a language model is probabilistic
- A language model encodes statistical information about one or more languages. Intuitively, this information tells us how likely a word is to appear in a given context.
- There are two main types of language models: masked language models and autoregressive language models.
- An autoregressive language model is trained to predict the next token in a sequence, using only the preceding tokens.
- A model that can generate open-ended outputs is called generative, hence the term generative AI.
3. Self-supervision was one of the big unlocks for scaling language models
- Self-supervision helps overcome this data labeling bottleneck to create larger datasets for models to learn from, effectively allowing models to scale up.
- Language modeling is self-supervised because each input sequence provides both the labels (tokens to be predicted) and the contexts the model can use to predict these labels.
This is an important distinction from supervised ML where someone might have to manually label millions of examples.
4. Prompting, RAG and finetuning are three ways of adapting a foundation model
- Prompt-based techniques, which include prompt engineering, adapt a model without updating the model weights. You adapt a model by giving it instructions and context instead of changing the model itself
- Finetuning, on the other hand, requires updating model weights. You adapt a model by making changes to the model itself
- Using a database to supplement the instructions is called retrieval-augmented generation (RAG). You can also finetune the model on a dataset of high-quality product descriptions
5. Inference optimization means making models faster and cheaper
6. There are some interesting Product Management considerations unique to AI products because users don’t ask for proactive features, they can view them as intrusive or annoying if the quality is low. Therefore, proactive predictions and generations typically have a higher quality bar
7. Sampling is an underrated part of understanding how foundation models behave. Sampling is how a model chooses an output from all possible options. It is perhaps one of the most underrated concepts in AI. A lot of seemingly strange behaviour of LLMs starts making more sense once you remember that the model is not retrieving “the answer”; it is sampling an output
8. Transformers solved one major problem through attention. The attention mechanism allows the model to weigh the importance of different input tokens when generating each output token. This is like generating answers by referencing any page in the book
9. Bigger models are generally better, but “bigger” alone can be misleading
- The number of parameters can be misleading if the model is sparse. A sparse model has a large percentage of zero-value parameters
- A larger model can also underperform a smaller model if it’s not trained on enough data
10. There are already visible limits to simply scaling forever. There are already two visible bottlenecks for scaling: training data and electricity
11. Pre-training gives capability while post-training makes the model more useful to humans. The goal of post-training is to align the model with human preferences. The earliest successful preference finetuning algorithm, which is still popular today, is RLHF
12. A counterintuitive observation is that a weak model can judge a stronger model, as judging is believed to be easier than generation
13. Inconsistency and hallucination are different problems. Inconsistency is when a model generates very different responses for the same or slightly different prompts. Hallucination is when a model gives a response that isn’t grounded in facts. Hallucinations are desirable for creative tasks, not for tasks that depend on factuality. So “zero hallucination” isn’t necessarily a universally sensible product requirement
14. Evaluation may be the most important—and difficult—part of building AI applications. Being able to build reliable evaluation pipelines will unlock many new applications
15. Traditional ground-truth based evaluation doesn’t work as well for foundation models since the open-ended nature of foundation models undermines the traditional approach of evaluating a model against ground truths
16. An AI judge itself needs to be treated as a system. An AI judge is not just a model, it’s a system that includes both a model and a prompt. Altering the model, the prompt, or the model’s sampling parameters results in a different judge
17. AI judges have their own biases including self-bias (AI nepotism!), first-position bias or verbosity bias!
18. Comparative evaluation shouldn’t be confused with A/B testing. In A/B testing, a user sees the output from one candidate model at a time. In comparative evaluation, a user sees outputs from multiple models at the same time
19. Ultimately, task success matters more than whether individual responses look good. This is PM’ing 101 i.e. to evaluate the user outcome, not merely whether the AI generated an impressive response
20. Define the evaluation guideline before obsessing over evaluation tools
- Creating a clear evaluation guideline is the most important step of the evaluation pipeline
- When creating the evaluation guideline, it’s important to define not only what the application should do, but also what it shouldn’t do
- Slicing means separating your data into subsets and looking at your system’s performance on each subset separately
21. Benchmarks are useful, but have their own limitations. As AI models improve, old benchmarks saturate, necessitating the introduction of new benchmarks
22. Teaching models what to do via prompts is also known as in-context learning. The familiar zero-shot/few-shot terminology comes from this: Each example provided in the prompt is called a shot. Teaching a model to learn from examples in the prompt is also called few-shot learning. When no example is provided, it’s zero-shot learning
23. You can think of the system prompt as the task description and the user prompt as the task
24. Some prompt engineering advice is just good communication advice. Communicating with AI is the same as communicating with humans: clarity helps. The simplest way to do CoT is to add “think step by step” or “explain your decision” in your prompt. Version your prompts
25. For systems that can actually take actions:
- If your system involves executing generated code, execute this code only in a virtual machine separated from the user’s main machine
- Another good practice is to not allow any potentially impactful commands to be executed without explicit human approvals
26. Two dominating patterns for context construction are RAG, or retrieval-augmented generation, and agents. The RAG pattern allows the model to retrieve relevant information from external data sources. The agentic pattern allows the model to use tools such as web search and news APIs to gather information
27. RAG is only as good as retrieval. RAG is a technique that enhances a model’s generation by retrieving the relevant information from external memory sources. The success of a RAG system depends on the quality of its retriever
28. Given an environment, the success of an agent in an environment depends on the tool inventory it has access to and the strength of its AI planner. Planning, at its core, is a search problem
When working with agents, always ask the system to report what parameter values it uses for each function call. Inspect these values to make sure they are correct
29. Agents can fail in surprisingly human-looking ways. The most common mode of planning failure is tool use failure
30. Memory is another important part of agentic systems. Memory refers to mechanisms that allow a model to retain and utilize information
31. Finetuning is the process of adapting a model to a specific task by further training the whole model or part of the model. If you’re just starting to experiment with a project, finetuning is rarely the first thing you should attempt
32. The distinction between RAG and finetuning is particularly useful:
- If the model fails because it lacks information, a RAG system that gives the model access to the relevant sources of information can help
- If the model has behavioral issues, finetuning might help
33. PEFT tries to make finetuning practical for very large models. Reducing the number of trainable parameters is the motivation for PEFT, parameter-efficient finetuning. LoRA is by far the most popular adapter-based method. The main drawback of LoRA is that it doesn’t offer performance as strong as full finetuning
34. Quantization is another important optimization. Quantization refers to the practice of converting a model from a format with more bits to a format with fewer bits
The broad benefit: Reduced precision not only reduces the memory footprint but also often improves computation speed
35. On-device deployment is necessary for use cases where data can’t leave the device (often due to privacy), or where there’s limited or unreliable internet access. On-device deployment can also significantly reduce inference costs
36. Data quality is much more than just correctness. In general, data can be considered high-quality if it has the following six characteristics: relevant, aligned with task requirements, consistent, correctly formatted, unique, and compliant
37. Synthetic data and augmented data are different
- Data augmentation creates new data from existing data (which is real)
- Data synthesis generates data to mimic the properties of real data
- In other words, augmented data is derived from real data, whereas synthetic data isn’t real
38. AI-generated training data comes with a pretty serious long-term risk. Some studies have shown that recursively using AI-generated data in training causes irreversible defects in the resulting models, degrading their performance over time. The book refers to this phenomenon as model collapse
39. Model distillation (also called knowledge distillation) is a method in which a small model (student) is trained to mimic a larger model (teacher). This is one way of getting some of the capabilities of an expensive model into a smaller and cheaper one
40. Sometimes the boring work on data has the highest leverage. “Manual inspection of data has probably the highest value-to-prestige ratio of any activity in machine learning.”
41. Training refers to the process of building a model. Inference refers to the process of using a model to compute an output for a given input. Inference optimization can be done at the model, hardware, and service levels
42. Two important computational bottlenecks are compute and memory bandwidth
43. Don’t use average latency alone. It’s more helpful to look at latency in percentiles, as they tell you something about a certain percentage of your requests
44. Throughput, latency and cost need to be looked at together. Throughput measures the number of output tokens per second an inference service can generate across all users and requests. Goodput measures the number of requests per second that satisfies the SLO, software-level objective
45. The goal isn’t to get the chips with the highest utilization. What you really care about is how to get your jobs done faster and cheaper. A higher utilization rate means nothing if the cost and latency both increase
46. Across model API providers, an output token costs approximately two to four times an input token. This is worth keeping in mind while designing AI UX. A product that produces thousands of unnecessary output tokens isn’t merely verbose but can be expensive too!
47. The cache that stores key and value vectors for reuse is called the KV cache. A KV cache is used only during inference, not training
48. Two families of parallelization strategies that can be applied across all models are data parallelism and model parallelism. While pipeline parallelism enables serving large models on multiple machines, it increases the total latency for each request due to extra communication between pipeline stages
49. Context construction is like feature engineering for foundation models. It gives the model the necessary information to produce an output
50. A model gateway is an intermediate layer that allows your organization to interface with different models in a unified and secure manner
51. Monitoring and observability aren’t quite the same. Monitoring makes no assumption about the relationship between the internal state of a system and its outputs. Observability, on the other hand, makes an assumption stronger than traditional monitoring: that a system’s internal states can be inferred from knowledge of its external outputs
52. Feedback extracted from the content of messages is called natural language feedback. This is quite different from traditional thumbs-up/down, ratings, clicks etc. Users may tell the product exactly what went wrong within the conversation itself
53. Design AI products so users can recover from AI mistakes. For example: If the model wrongly categorizes a product, users can edit the category.. This is perhaps a better product-design objective than pretending that AI will never make an error
54. A degenerate feedback loop can happen when the predictions themselves influence the feedback, which, in turn, influences the next iteration of the model, amplifying initial biases
55. AI Engineering is moving closer to Product. This was one of the more interesting observations for me from the book. Since user feedback is a crucial source of data for continuously improving AI models, more AI engineers are now becoming involved in the process to ensure they receive the data they need. This reinforces the idea from Chapter 1 that, compared to traditional ML engineering, AI engineering is moving closer to product. This is because of both the increasing importance of data flywheel and product experience as competitive advantages
Indispensable book, it can be ordered from Amazon from here!
Leave a Reply