Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
911
18k
source
stringclasses
2 values
chunk_index
int64
0
569
total_chunks
int64
88
570
processed_at
stringdate
2026-08-07 21:56:10
2026-08-07 22:46:08
<!-- image --> AI Engineering Building Applications with Foundation Models <!-- image --> Chip Huyen 'This book of fers a comprehensive, well-structured guide to the essential aspects of building generative AI systems. A must-read for any professional looking to scale AI across the enterprise.' Vittorio Cretella, form...
AI_Engineering.pdf
0
570
2026-08-07T21:56:10.279023
well-structured guide to the essential aspects of building generative AI systems. A must-read for any professional looking to scale AI across the enterprise. -Vittorio Cretella, former global CIO, P&amp;G and Mars Chip Huyen gets generative AI. On top of that, she is a remarkable teacher and writer whose work has been ...
AI_Engineering.pdf
1
570
2026-08-07T21:56:10.279023
with costly fine-tuning. -Rafal Kawala, Senior AI Engineering Director, 16 years of experience working in a Fortune 500 company ## AI Engineering ## Building Applications with Foundation Models Chip Huyen ## AI Engineering by Chip Huyen Copyright © 2025 Developer Experience Advisory LLC. All rights reserved. Printed in...
AI_Engineering.pdf
2
570
2026-08-07T21:56:10.279023
use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure ...
AI_Engineering.pdf
3
570
2026-08-07T21:56:10.279023
37 | | AI Engineering Versus ML Engineering | 39 | | AI Engineering Versus Full-Stack Engineering | 46 | | Summary ...
AI_Engineering.pdf
4
570
2026-08-07T21:56:10.279023
| Why AI as a Judge? | 137 | | How to Use AI as a Judge | 138 | | Limitations of AI as a Judge | 141 | | What Models Can Act as Judges? ...
AI_Engineering.pdf
5
570
2026-08-07T21:56:10.279023
Context Length and Context Efficiency | 218 | | Prompt Engineering Best Practices | 220 | | Write Clear and Explicit Instructions | 220 | | Pr...
AI_Engineering.pdf
6
570
2026-08-07T21:56:10.279023
etune | 311 | | Reasons to Finetune | 311 | | Reasons Not to Finetune | 312 | | Finetuning and RAG ...
AI_Engineering.pdf
7
570
2026-08-07T21:56:10.279023
5 | | Understanding Inference Optimization | 406 | | Inference Overview | 406 | | Inference Performance Metrics | 412 | | AI Accelerators ...
AI_Engineering.pdf
8
570
2026-08-07T21:56:10.279023
2012, the AlexNet authors noted in their landmark paper that: 'All of our experiments suggest that our results can be improved simply by waiting for faster GPUs and bigger datasets to become available.' 1, 2 What surprised me was the sheer number of applications this capability boost unlocked. I thought a...
AI_Engineering.pdf
9
570
2026-08-07T21:56:10.279023
out to write the book because I wanted to learn, and I did learn a lot. I learned from the projects I worked on, the papers I read, and the people I interviewed. During the process of writing this book, I used notes from over 100 conversations and interviews, including researchers from major AI labs (Open...
AI_Engineering.pdf
10
570
2026-08-07T21:56:10.279023
mitigate hallucinations? - What are the best practices for prompt engineering? - Why does RAG work? What are the strategies for doing RAG? - What's an agent? How do I build and evaluate an agent? - When to finetune a model? When not to finetune a model? - How much data do I need? How do I validate the quality of my dat...
AI_Engineering.pdf
11
570
2026-08-07T21:56:10.279023
involves both traditional ML models and foundation models, so knowledge about working with both is often necessary. 3 Teaching a course on how to use TensorFlow in 2017 taught me a painful lesson about how quickly tools and tutorials become outdated. Determining whether something will last, however, is often challengin...
AI_Engineering.pdf
12
570
2026-08-07T21:56:10.279023
build successful AI applications to solve real-world problems. While it's possible to build foundation model-based applications without ML expertise, a basic understanding of ML and statistics can help you build better applications and save you from unnecessary suffering. You can read this book without any prior ML bac...
AI_Engineering.pdf
13
570
2026-08-07T21:56:10.279023
: - Tool developers who want to identify underserved areas in AI engineering to position your products in the ecosystem. - Researchers who want to better understand AI use cases. - Job candidates seeking clarity on the skills needed to pursue a career as an AI engineer. - Anyone wanting to better understand ...
AI_Engineering.pdf
14
570
2026-08-07T21:56:10.279023
part of every step along the way. Evaluation is one of the hardest, if not the hardest, challenges of AI engineering. This book dedicates two chapters, Chapters 3 and 4, to explore different evaluation methods and how to use them to create a reliable and systematic evaluation pipeline for your application. Given a quer...
AI_Engineering.pdf
15
570
2026-08-07T21:56:10.279023
means and how to evaluate the quality of your data. If Chapters 5 to 8 are about improving a model's quality, Chapter 9 is about making its inference cheaper and faster. It discusses optimization both at the model level and inference service level. If you're using a model API-i.e., someone else hosts your m...
AI_Engineering.pdf
16
570
2026-08-07T21:56:10.279023
The repository contains additional resources about AI engineering, including important papers and helpful tools. It also covers topics that are too deep to go into in this book. For those interested in the process of writing this book, the GitHub repository also contains behind-the-scenes inform...
AI_Engineering.pdf
17
570
2026-08-07T21:56:10.279023
share their knowledge and expertise through books, articles, and our online learning platform. O'Reilly's online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O'Reilly and 200+ other...
AI_Engineering.pdf
18
570
2026-08-07T21:56:10.279023
00 companies, Vittorio Cretella and Andrei Lopatenko provided invaluable feedback that combined deep technical expertise with executive insights. Vicki Reyzelman helped me ground my content and keep it relevant for readers with a software engineering background. Eugene Yan, a dear friend and amazing applied scientist, ...
AI_Engineering.pdf
19
570
2026-08-07T21:56:10.279023
me here, but due to the inherent faultiness of human memory, I undoubtedly neglected to mention many. If I forgot to include your name, please know that it wasn't because I don't appreciate your contribution, and please kindly remind me so that I can rectify this as soon as possible! Andrew Francis, Anis...
AI_Engineering.pdf
20
570
2026-08-07T21:56:10.279023
editor I've ever worked with. Nicole Butterfield is a force who oversaw this book from an idea to a final product. This book, after all, is an accumulation of invaluable lessons I learned throughout my career. I owe these lessons to my extremely competent and patient coworkers and former coworkers. Every ...
AI_Engineering.pdf
21
570
2026-08-07T21:56:10.279023
before LLMs became prominent, AI was already powering many applications, including product recommendations, fraud detection, and churn prediction. While many principles of productionizing AI applications remain the same, the new generation of large-scale, readily available models brings about ...
AI_Engineering.pdf
22
570
2026-08-07T21:56:10.279023
in a given context. For example, given the context 'My favorite color is \_\_', a language model that encodes English should predict 'blue' more often than 'car'. 1 In this book, I use traditional ML to refer to all ML before foundation models. The statistical nature of languages was discovered centuries ago. I...
AI_Engineering.pdf
23
570
2026-08-07T21:56:10.279023
75 words. The set of all tokens a model can work with is the model's vocabulary . You can use a small number of tokens to construct a large number of distinct words, similar to how you can use a few letters in the alphabet to construct many words. The Mixtral 8x7B model has a vocabulary size of 32,000. GPT-4's vocabula...
AI_Engineering.pdf
24
570
2026-08-07T21:56:10.279023
A well-known example of a masked language model is bidirectional encoder representations from transformers, or BERT (Devlin et al., 2018). As of writing, masked language models are commonly used for non-generative tasks such as sentiment analysis and text classification. They are also useful for tasks requiring an ...
AI_Engineering.pdf
25
570
2026-08-07T21:56:10.279023
so exciting and frustrating to use. We explore this further in Chapter 2. 4 Technically, a masked language model like BERT can also be used for text generations if you try really hard. | As simple as it sounds, completion is incredibly powerful. Many tasks, including translation, summarization, coding, an...
AI_Engineering.pdf
26
570
2026-08-07T21:56:10.279023
want the model to learn, and then train the model on these examples. Once trained, the model can be applied to new data. For example, to train a fraud detection model, you use examples of transactions, each labeled with 'fraud' or 'not fraud'. Once the model learns from these examples, you can use this model to predict...
AI_Engineering.pdf
27
570
2026-08-07T21:56:10.279023
can use to predict these labels. For example, the sentence 'I love street food.' gives six training samples, as shown in Table 1-1. Table 1-1. Training samples from the sentence 'I love street food.' for language modeling. | Input (context) | Output (next token) | |---------------------------------|...
AI_Engineering.pdf
28
570
2026-08-07T21:56:10.279023
articles, and Reddit comments-it's possible to construct a massive amount of training data, allowing language models to scale up to become LLMs. LLM, however, is hardly a scientific term. How large does a language model have to be to be considered large ? What is large today might be considered tiny tomorrow. A...
AI_Engineering.pdf
29
570
2026-08-07T21:56:10.279023
that larger models require more training data. If a model is more powerful, shouldn't it require fewer examples to learn from? However, we're not trying to get a large model to match the performance of a small model using the same data. We're trying to maximize model performance. For this reason, language models a...
AI_Engineering.pdf
30
570
2026-08-07T21:56:10.279023
model generates the next token conditioned on both text and image tokens, or whichever modalities that the model supports, as shown in Figure 1-3. Figure 1-3. A multimodal model can generate the next token using information from both text and visual tokens. <!-- image --> Just like language models, multimoda...
AI_Engineering.pdf
31
570
2026-08-07T21:56:10.279023
, thanks to their scale and the way they are trained, are capable of a wide range of tasks. Out of the box, general-purpose models can work relatively well for many tasks. An LLM can do both sentiment analysis and translation. However, you can often tweak a general-purpose model to maximize its performance on a specifi...
AI_Engineering.pdf
32
570
2026-08-07T21:56:10.279023
models make it cheaper to develop AI applications and reduce time to market. Exactly how much data is needed to adapt a model depends on what technique you use. This book will also touch on this question when discussing each technique. However, there are still many benefits to task-specific models, for example, the...
AI_Engineering.pdf
33
570
2026-08-07T21:56:10.279023
so on. AI can even be used to synthesize training data, develop algorithms, and write code, all of which will help train even more powerful models in the future. Factor 2: Increased AI investments The success of ChatGPT prompted a sharp increase in investments in AI, both from venture capitalists and enterprises. As AI...
AI_Engineering.pdf
34
570
2026-08-07T21:56:10.279023
model as a service approach popularized by OpenAI and other model providers makes it easier to leverage AI to build applications. In this approach, models are exposed via APIs that receive user queries and return model outputs. Without these APIs, using an AI model requires the infrastructure to host and se...
AI_Engineering.pdf
35
570
2026-08-07T21:56:10.279023
of professionals adding terms like 'Generative AI,' 'ChatGPT,' 'Prompt Engineering,' and 'Prompt Crafting' to their profile increased on average 75% each month. ComputerWorld declared that 'teaching AI to behave is the fastest-growing career skill'. Figure 1-6. Open source AI engineering tools are growing faster than a...
AI_Engineering.pdf
36
570
2026-08-07T21:56:10.279023
. 10 It's impossible to list all potential use cases for AI. Even attempting to categorize these use cases is challenging, as different surveys use different categorizations. For example, Amazon Web Services (AWS) has categorized enterprise generative AI use cases into three buckets: customer experience, employee produ...
AI_Engineering.pdf
37
570
2026-08-07T21:56:10.279023
to exposure to AI models directly, whereas β and ζ refer to exposures to AI-powered software. Table from Eloundou et al. (2023). | Group | Occupations with highest exposure | % Exposure...
AI_Engineering.pdf
38
570
2026-08-07T21:56:10.279023
| | Writing | Email Social media and blog posts | Copywriting, search engine optimization (SEO) Reports, memos, design docs | | Education | Tutoring Essay grading | Employee onboarding Employee upskill training | | Conversational bots | G...
AI_Engineering.pdf
39
570
2026-08-07T21:56:10.279023
built on top of them are still close-ended, such as classification. Classification tasks are easier to evaluate, which makes their risks easier to estimate. Figure 1-8. Companies are more willing to deploy internal-facing applications <!-- image --> Even after seeing hundreds of AI applications, I still find new applic...
AI_Engineering.pdf
40
570
2026-08-07T21:56:10.279023
many software engineering tasks. The question is whether AI can automate software engineering altogether. At one end of the spectrum, Jensen Huang, CEO of NVIDIA, predicts that AI will replace human software engineers and that we should stop saying kids should learn to code. In a leaked recordin...
AI_Engineering.pdf
41
570
2026-08-07T21:56:10.279023
023, at one and a half years old, Midjourney had already generated $200 million in annual recurring revenue. As of December 2023, among the top 10 free apps for Graphics &amp; Design on the Apple App Store, half have AI in their names. I suspect that soon, graphics and design apps will incorporate AI by ...
AI_Engineering.pdf
42
570
2026-08-07T21:56:10.279023
lead to huge savings. On average, 11% of a company's budget is spent on marketing. See 'Marketing Budgets Vary by Industry' (Christine Moorman, WSJ , 2017). It's not a surprise that LLMs are good at writing, given that they are trained for text completion. To study the impact of ChatGPT on writing, an MIT study (Noy an...
AI_Engineering.pdf
43
570
2026-08-07T21:56:10.279023
, Notion, and Gmail all use AI to help users improve their writing. Grammarly, a writing assistant app, finetunes a model to make users' writing more fluent, coherent, and clear. AI's ability to write can also be abused. In 2023, the New York Times reported that Amazon was flooded with shoddy AI-generated travel ...
AI_Engineering.pdf
44
570
2026-08-07T21:56:10.279023
ChatGPT is down, OpenAI's Discord server is flooded with students complaining about being unable to complete their homework. Several education boards, including the New York City Public Schools and the Los Angeles Unified School District, were quick to ban ChatGPT for fear of students using it for cheating...
AI_Engineering.pdf
45
570
2026-08-07T21:56:10.279023
embrace AI to build better products, many find their lunches taken by AI. For example, Chegg, a company that helps students with their homework, saw its share price plummet from $28 when ChatGPT launched in November 2022 to $2 in September 2024, as students have been turning to AI for help. If the risk is that AI can r...
AI_Engineering.pdf
46
570
2026-08-07T21:56:10.279023
-powered 3D characters is smart NPCs, non-player characters (see NVIDIA's demos of Inworld and Convai). 16 NPCs are essential for advancing the storyline of many games. Without AI, NPCs are typically scripted to do simple actions with a limited range of dialogues. AI can make these NPCs...
AI_Engineering.pdf
47
570
2026-08-07T21:56:10.279023
with facts, open questions, and action items. These action items can then be automatically inserted into a project tracking tool and assigned to the right owners. AI can help you surface the critical information about your potential customers and run analyses on your competitors. The more information you ga...
AI_Engineering.pdf
48
570
2026-08-07T21:56:10.279023
For end users, automation can help with boring daily tasks like booking restaurants, requesting refunds, planning trips, and filling out forms. For enterprises, AI can automate repetitive tasks such as lead management, invoicing, reimbursements, managing customer requests, data entry, and so on. One especiall...
AI_Engineering.pdf
49
570
2026-08-07T21:56:10.279023
consider why you're building this and how you should go about it. It's easy to build a cool demo with foundation models. It's hard to create a profitable product. ## Use Case Evaluation The first question to ask is why you want to build this application. Like many business decisions, building an AI application is often...
AI_Engineering.pdf
50
570
2026-08-07T21:56:10.279023
. At bigger companies, this can be part of the R&amp;D department. 19 Once you've found a good reason to develop this use case, you might consider whether you have to build it yourself. If AI poses an existential threat to your business, you might want to do AI in-house instead of outsourcing it...
AI_Engineering.pdf
51
570
2026-08-07T21:56:10.279023
low. Therefore, proactive predictions and generations typically have a higher quality bar. Dynamic or static Dynamic features are updated continually with user feedback, whereas static features are updated periodically. For example, Face ID needs to be updated as people's faces change over time. However, object detecti...
AI_Engineering.pdf
52
570
2026-08-07T21:56:10.279023
example, 95% of AI-suggested responses to simple requests are used by human agents verbatim, you can let customers interact with AI directly for those simple requests. ## AI product defensibility If you're selling AI applications as standalone products, it's important to consider their defensibility....
AI_Engineering.pdf
53
570
2026-08-07T21:56:10.279023
will be their moat. Even for the scenarios where user data can't be used to train models directly, usage information can give invaluable insights into user behaviors and product shortcomings, which can be used to guide the data collection and training process. 21 There have been many successful companies whose original...
AI_Engineering.pdf
54
570
2026-08-07T21:56:10.279023
token), TPOT (time per output token), and total latency. What is considered acceptable latency depends on your use case. If all of your customer requests are currently being processed by humans with a median response time of an hour, anything faster than this might be good enough. - Cost metrics: how mu...
AI_Engineering.pdf
55
570
2026-08-07T21:56:10.279023
sentiment. It took them one month to achieve 80% of the experience they wanted. This initial success made them grossly underestimate how much time it'd take them to improve the product. They found it took them four more months to finally surpass 95%. A lot of time was spent working on the product kinks and dealing with...
AI_Engineering.pdf
56
570
2026-08-07T21:56:10.279023
prices in half, making in-house the expensive option. You might invest in a third-party solution and tailor your infrastructure around it, only for the provider to go out of business after failing to secure funding. Some changes are easier to adapt to. For example, as model providers converge to the same A...
AI_Engineering.pdf
57
570
2026-08-07T21:56:10.279023
techniques, models, and applications introduced every day can be overwhelming. Instead of trying to keep up with the constantly shifting sand, let's look into the fundamental building blocks of AI engineering. To understand AI engineering, it's important to recognize that AI engineerin...
AI_Engineering.pdf
58
570
2026-08-07T21:56:10.279023
and necessary context. This layer requires rigorous evaluation. Good applications also demand good interfaces. ## Model development This layer provides tooling for developing models, including frameworks for modeling, training, finetuning, and inference optimization. Because data is central to model ...
AI_Engineering.pdf
59
570
2026-08-07T21:56:10.279023
unprecedented, many principles of building AI applications remain the same. For enterprise use cases, AI applications still need to solve business problems, and, therefore, it's still essential to map from business metrics to ML metrics and vice versa. You still need to do systematic experimentation. W...
AI_Engineering.pdf
60
570
2026-08-07T21:56:10.279023
engineers who know how to work with GPUs and big clusters. 23 3. AI engineering works with models that can produce open-ended outputs. Openended outputs give models the flexibility to be used for more tasks, but they are also harder to evaluate. This makes evaluation a much bigger problem in AI engineering....
AI_Engineering.pdf
61
570
2026-08-07T21:56:10.279023
commonly associated with traditional ML engineering. It has three main responsibilities: modeling and training, dataset engineering, and inference optimization. Evaluation is also required, but because most people will come across it first in the application development layer, I'll discuss evaluation in the next sectio...
AI_Engineering.pdf
62
570
2026-08-07T21:56:10.279023
a model for text completion. Out of all training steps, pre-training is often the most resourceintensive by a long shot. For the InstructGPT model, pre-training takes up to 98% of the overall compute and data resources. Pre-training also takes a long time to do. A small mistake during ...
AI_Engineering.pdf
63
570
2026-08-07T21:56:10.279023
't correct. I read a Business Insider article where the author said she trained ChatGPT to mimic her younger self. She did so by feeding her childhood journal entries into ChatGPT. Colloquially, the author's usage of the word training is correct, as she's teaching the model to do something. But technically, if you tea...
AI_Engineering.pdf
64
570
2026-08-07T21:56:10.279023
adapter technique you use. Training a model from scratch generally requires more data than finetuning, which, in turn, requires more data than prompt engineering. Regardless of how much data you need, expertise in data is useful when examining a model, as its training data gives important clues about th...
AI_Engineering.pdf
65
570
2026-08-07T21:56:10.279023
Inference optimization techniques, including quantization, distillation, and parallelism, are discussed in Chapters 7 through 9. ## Application development With traditional ML engineering, where teams build applications using their proprietary models, the model quality is a differentiation. With foundation models, wher...
AI_Engineering.pdf
66
570
2026-08-07T21:56:10.279023
was shown only 5 examples. When both were shown five examples, ChatGPT performed better, as shown in Table 1-5. Table 1-5. Different prompts can cause models to perform very differently, as seen in Gemini's technical report (December 2023). | | Gemini Ultra | Gemini Pro | GPT-4 ...
AI_Engineering.pdf
67
570
2026-08-07T21:56:10.279023
necessary context and tools to do a given task. For complex tasks with long context, you might also need to provide the model with a memory management system so that the model can keep track of its history. Chapter 5 discusses prompt engineering, and Chapter 6 discusses context construction. AI interface. AI interface ...
AI_Engineering.pdf
68
570
2026-08-07T21:56:10.279023
6. While the chat interface is the most commonly used, AI interfaces can also be voicebased (such as with voice assistants) or embodied (such as in augmented and virtual reality). These new AI interfaces also mean new ways to collect and extract user feedback. The conversation interface makes it so much easier for user...
AI_Engineering.pdf
69
570
2026-08-07T21:56:10.279023
available today, it's possible to start with building the product first, and only invest in data and models once the product shows promise, as visualized in Figure 1-16. Figure 1-16. The new AI engineering workflow rewards those who can iterate fast. Image recreated from 'The Rise of the AI Engineer' (Shawn Wang, 2023)...
AI_Engineering.pdf
70
570
2026-08-07T21:56:10.279023
, which is the overarching discipline involved with building applications with all ML models. Many principles from ML engineering are still applicable to AI engineering. However, AI engineering also brings with it new challenges and solutions. The last section of the chapter discusses the AI engineering stack, includin...
AI_Engineering.pdf
71
570
2026-08-07T21:56:10.279023
architecture and size, and how they are post-trained to align with human preferences. Since models learn from data, their training data reveals a great deal about their capabilities and limitations. This chapter begins with how model developers curate training data, focusing on the distribution of train...
AI_Engineering.pdf
72
570
2026-08-07T21:56:10.279023
chapter. Concepts covered in this chapter are fundamental for understanding the rest of the book. However, because these concepts are fundamental, you might already be familiar with them. Feel free free to skip any concept that you're confident about. If you encounter a confusing concept later on, you can revisit this ...
AI_Engineering.pdf
73
570
2026-08-07T21:56:10.279023
disclose their training data sources, including OpenAI's GPT-3 and Google's Gemini. I suspect that Common Crawl is also used in models that don't disclose their training data. To avoid scrutiny from both the public and competitors, many companies have stopped disclosing this information. Some teams u...
AI_Engineering.pdf
74
570
2026-08-07T21:56:10.279023
of the data (45.88%), making it eight times more prevalent than the second-most common language, Russian (5.97%) (Lai et al., 2023). See Table 2-1 for a list of languages with at least 1% in Common Crawl. Languages with limited availability as training data-typically languages not included in this list -are con...
AI_Engineering.pdf
75
570
2026-08-07T21:56:10.279023
85 | 1.0299 | H | Many other languages, despite having a lot of speakers today, are severely underrepresented in Common Crawl. Table 2-2 shows some of these languages. Ideally, the ratio between world population representation and Common Crawl representation should be 1. The higher ...
AI_Engineering.pdf
76
570
2026-08-07T21:56:10.279023
58.10 | | Bengali | 272 | 3.40% | 0.0930% | 36.56 | | English | 1452 | 18.15% | 45.88% | 0.40 | a A world population of eight billion was used for this calculation. Given the dom...
AI_Engineering.pdf
77
570
2026-08-07T21:56:10.279023
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
-

Space using iajitpanday/training-docs 1