15 Minutes
Cover of Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications

Technology and the Future · 15 min

Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications

Chip Huyen · 2022

Who it's for

For anyone who works with data, programming or product and wants to understand why so many models that look great in a notebook fail once they go live. It also suits managers who need to talk with the technical team without being fooled by artificial intelligence hype.

Read it in the app

⚡ Free to download • 🎁 One full book free every day

3 ideas to take with you

1

The algorithm is a small piece of a machine learning system: data, infrastructure and monitoring decide whether it really works.

2

A model put into production starts aging the very next day, because the world it learned from keeps changing.

3

When the system's output changes how people behave, the model starts learning from the effects of its own decisions.

“
Before asking for artificial intelligence, ask what a simple rule would already solve.
An idea from Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications, in the words of 15 Minutes

Preview

Start reading now

The algorithm is the small part of the system

People who learn machine learning in a course tend to spend all their time on the model: which algorithm, which parameters, which score. Chip Huyen opens the book by taking that picture apart. In a system that runs for real, the algorithm is just one piece, surrounded by data, supporting code, servers, dashboards and people making decisions.

The proposal is a systems view. A bank that uses a model to block credit card fraud doesn't depend only on how precise the calculation is. It depends on how the data arrives, how long the answer takes, who reviews the doubtful cases and how the team notices that something has changed.

That is why the subtitle talks about an iterative process. Building the system is not a one-time task. It is a cycle of planning, training, going live, observing and adjusting, repeated for as long as the product exists.

Before using ML, ask whether you need it

The book argues that machine learning doesn't solve everything. It works well when patterns repeat, when a mistake costs little, when predictions need to happen at large scale and when the pattern changes over time, so that hand-written rules would go stale.

In many cases, a simple rule or a well-written database query does the job better and costs less. A small shop that wants to pick out customers who buy every month may not need a model at all, just a well-organized spreadsheet.

When ML can't solve the problem alone, it can still be one part of the solution. The honest question before starting is: what happens if I do this without artificial intelligence, and how much will I lose by that?

Think of a bakery owner who wants to predict doughnut sales. Before building a model, she can look at the history by day of the week. If that simple calculation is already accurate enough, a model would only bring cost and headaches.

Research and production are different worlds

The book pays attention to the differences between a model in a scientific paper and a model in a product. In research, the goal is to beat the best known result. In production, the goal is to be good enough, fast enough and cheap enough.

There are other differences. Research data tends to be clean and fixed, while production data is messy and keeps changing. In research, almost nobody cares about response time. In production, every fraction of a second can be noticed by the customer.

That is why a giant model that wins an accuracy contest can be useless in a phone app. The right choice is the one that meets the product's constraints, not the one at the top of the leaderboard.

12 more sections and the quiz

Continue in the app

Read the whole summary, finish with the Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications quiz and follow the guided Journeys. No ads in the app.

About Chip Huyen

Chip Huyen is a writer and computer engineer of Vietnamese origin who has worked at technology companies in the United States. She taught machine learning systems at Stanford University, and that course was the basis for the book. She co-founded Claypot AI, a real-time data infrastructure company that Voltron Data acquired in 2024. Designing Machine Learning Systems was published by O'Reilly in 2022.

Explore