Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Chip Huyen

Machine learning systems are both complex and unique. Complex because they consist of many different components and involve many different stakeholders. Unique because they're data dependent, with data varying wildly from one use case to the next. In this book, you'll learn a holistic approach to designing ML systems that are reliable, scalable, maintainable, and adaptive to changing environments and business requirements. Author Chip Huyen, co-founder of Claypot AI, considers each design decision--such as how to process and create training data, which features to use, how often to retrain models, and what to monitor--in the context of how it can help your system as a whole achieve its objectives. The iterative framework in this book uses actual case studies backed by ample references. This book will help you tackle scenarios such as: Engineering data and choosing the right metrics to solve a business problem Automating the process for continually developing, evaluating, deploying, and updating models Developing a monitoring system to quickly detect and address issues your models might encounter in production Architecting an ML platform that serves across use cases Developing responsible ML systems

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications ## 【One-Line Pitch】 A practical, holistic guide for engineers and data scientists who want to move ML models from research prototypes to reliable, scalable production systems—covering everything from data engineering to monitoring and responsible AI. If you've ever wondered why your model works in the notebook but fails in the real world, this book is for you. ## 【Book Arc】 - **Opening (~0%–9%)**: Establishes why ML systems are complex and unique—data-dependent, multi-component, and stakeholder-heavy—and contrasts ML in research versus production, plus how ML systems differ from traditional software. It also frames what problems ML can actually solve (predictive problems, unseen data patterns) and introduces the "system approach" that the rest of the book follows. - **Early (~9%–25%)**: Defines the core system properties—reliability, scalability, maintainability, and adaptability—and explains how ML systems fail silently compared to traditional software. Covers ML task types (classification, regression, etc.) and begins the deep dive into data engineering, including storage formats (row-major vs. columnar), data processing paradigms, and the shift toward declarative ML systems. - **Middle (~25%–44%)**: Explores the data stack in depth—batch vs. stream processing, OLTP vs. OLAP evolution, feature engineering (static vs. dynamic features), and the infrastructure needed to join batch and streaming data. Introduces the training data challenges, including labeling strategies, weak supervision, and the economics of data annotation. - **Middle (~44%–60%)**: Covers the heart of the ML development cycle—model selection, training, evaluation, and the iterative nature of improving models. Discusses the "fake-it-til-you-make-it" approach, continual learning, and how to think about predictions as a product feature rather than just an algorithm output. - **Late (~60%–85%)**: Focuses on deployment, monitoring, and maintenance—how to detect and address issues in production, when to retrain models, and how to architect an ML platform that serves multiple use cases. Emphasizes the operational realities that most ML courses skip. - **Ending (~85%–100%)**: Concludes with responsible ML—fairness, bias, privacy, and the ethical considerations that must be baked into the system design from the start, not bolted on at the end. ## 【Key Takeaways】 - **ML systems fail silently, unlike traditional software** (Early): A system can call `model.predict()` correctly while producing wrong outputs, and users may never notice. This motivates the need for robust monitoring and evaluation strategies that go beyond traditional software testing. - **Reliability, scalability, and maintainability have different meanings for ML** (Early): Scalability isn't just about traffic—it's about model complexity (e.g., growing from 1 GB to 16 GB RAM models), model count, and feature count. Understanding these dimensions helps you design systems that can grow gracefully. - **Data format choices have real performance consequences** (Early): pandas is columnar while NumPy is row-major by default—iterating a DataFrame by row can be 30x slower than by column. Understanding these low-level details prevents common performance pitfalls in data pipelines. - **Batch and streaming features serve different purposes and often need to be combined** (Middle): Static features (batch) capture slow-changing patterns, while dynamic features (streaming) capture real-time state like "drivers available now." Production systems like fraud detection need both, requiring infrastructure that can join them. - **Hand-labeling is expensive, slow, and privacy-risky** (Middle): Labeling chest X-rays requires board-certified radiologists; phonetic transcription takes 400x real-time. This drives the need for alternatives like weak supervision, semi-supervised learning, transfer learning, and active learning. - **The OLTP/OLAP distinction is becoming outdated** (Early): Modern databases like CockroachDB, Apache Iceberg, and DuckDB blur the line between transactional and analytical workloads, and storage-compute separation (BigQuery, Snowflake) is the new paradigm. - **Declarative ML systems are emerging** (Early): Tools like Ludwig and H2O AutoML let you declare features and task types while the system figures out the model architecture—reducing the need for manual model tuning and experimentation. ## 【Reading Tips】 - **Skim the first two chapters** if you're already familiar with ML basics—the research-vs-production contrast is useful context, but the real meat starts with the data engineering chapters. - **Deep-read the data format and processing sections** (around 25%–38%): The pandas/NumPy performance discussion and the batch-vs-streaming feature distinction are practical gold that most ML books skip. - **Pay special attention to the labeling chapter** (around 44%–47%): The comparison of hand-labeling, weak supervision, semi-supervision, transfer learning, and active learning is a decision framework you'll use repeatedly in real projects. - **Don't skip the monitoring and deployment sections** even if you're not yet in production—the "silent failure" concept and the retraining decision framework will shape how you design your system from day one. - **Take notes on the case studies and references**—the book is backed by ample citations (Karpathy on labeling teams, Google's zero-shot translation, etc.) that are worth following up on for deeper dives. ## 【Coverage Limits】 The excerpts cover the book's opening through roughly the middle (data engineering, labeling, and feature engineering), with lighter coverage of the later chapters on deployment, monitoring, and responsible ML. Specific chapter titles and the full depth of the production-focused sections are not fully represented in this guide. ##
Page 9
m engineers, and engineering managers. You might be able to relate to one of the following scenarios: You have been given a business problem and a lot of raw...
View in text
Excerpt 2
ersity (hardware or software faults, and even human error). “Correctness” might be difficult to determine for ML systems. For example, your system might call...
View in text
Excerpt 3
nd response x = train.columns y = "response" x.remove(y) # For binary classification, response should be a factor train[y] = train[y].asfactor() test[y] = te...
View in text
Excerpt 4
ivacy. Hand labeling means that someone has to look at your data, which isn’t always possible if your data has strict privacy requirements. For example, you...
View in text
Excerpt 5
and Conference (APSIPA ASC), 2017, https://oreil.ly/WeW6J. 35 As of July 2021, when you use scikit-learn.metrics.f1_score, pos_label is set to 1 by default,...
View in text
Excerpt 6
sformer paper, if the element is at an even index, use sine. Else, use cosine. See Figure 5-6. Use statistics from only the train split, instead of the entir...
View in text
Excerpt 7
1M (OpenAI’s GPT-3 175B uses a batch size of 3.2M in 2020).19 To oversimplify the calculation, if training an epoch on a machine takes 1M steps, training on...
View in text
Excerpt 8
by over 90%, decreasing storage requirements and improving computational performance of inference without compromising overall accuracy.26 In Chapter 11, we’...
View in text
Tags
AI categories
Artificial IntelligenceDataBackend
ISBN: 1098107950
Publish Year: 2022
Language: English
Pages: 463
File Format: PDF
File Size: 10.0 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…