Intro
L1
Β·
Quiz
Β·
Lab
L2
Β·
Quiz
Β·
Lab
L3
Β·
Quiz
Β·
Lab
L4
Β·
Quiz
Β·
Lab
Module Test
Deploying and Monitoring AI Β· Introduction

You Cannot Improve What You Cannot See

This course exists because shipping an AI model is not the finish line β€” it is the starting gun.

In the early 1880s, Thomas Edison's Pearl Street Station in lower Manhattan began supplying direct-current electricity to a handful of city blocks. The technical achievement was real, but what made it lasting was something less celebrated: Edison's team built metering equipment and recorded consumption data from the very first day of operation. They knew, in near-real time, when a circuit was drawing too much load, when a generator was drifting out of spec, when a customer's meter had stopped registering. The competitors who deployed power grids without that instrumentation lost equipment, lost customers, and in several cases lost the business entirely. The observable grid outlasted the blind one by decades.

Machine learning systems in 2024 are in a strikingly similar position. Models ship continuously β€” GPT-4 went into production in March 2023, Meta's Llama 2 followed in July, and enterprise teams at companies from Stripe to Mayo Clinic began embedding these systems into critical workflows almost immediately. What those teams discovered, quickly, was that a model that performed well on a benchmark could degrade silently in production: the input distribution shifted, a downstream API changed, real-world language diverged from training data. Without instrumentation, the failure was invisible until a customer noticed.

This course covers the discipline that has emerged to address exactly that problem: AI observability. You will learn what signals to collect, how to detect drift before it becomes damage, how to trace failures back to their root cause, and how to build the feedback loops that let a deployed system improve over time. The material draws on documented production incidents and real tooling. It will not make deployment simple, but it will make the consequences of deployment legible.

Deploying and Monitoring AI Β· Module 1 Β· Lesson 1

What Observability Means for AI Systems

Logs, metrics, and traces were built for deterministic software. AI systems break every assumption they were built on.
How do you know whether your model is working right now, in production, for real users?

In November 2022, Zillow's AI-powered home-purchasing program, Zillow Offers, concluded a 700-million-dollar write-down and shuttered entirely. The model that priced homes had been accurate enough in testing. In production, however, the input distribution shifted faster than anyone had instrumented for: pandemic-era housing volatility made historical price patterns unreliable. The team was not flying blind in the traditional sense β€” they had dashboards, latency metrics, error rates. What they lacked was a way to see what the model was actually doing with the data it was receiving. By the time the pricing errors became visible in financial reports, the positions were already taken. Observability, for an AI system, means catching that kind of drift before the write-down.

This is not a story about a bad model. It is a story about insufficient visibility into a model's behavior in a live environment. Understanding why β€” and what sufficient visibility looks like β€” is where this module begins.

The Three Pillars: Logs, Metrics, Traces

Classical software observability rests on three signal types that emerged from distributed systems engineering at companies like Google, Netflix, and Twitter between roughly 2010 and 2018. Each captures something the others miss.

Logs are timestamped records of discrete events β€” a request arrived, a function was called, an exception was thrown. They are the most granular signal and the most expensive to store at scale. Metrics are numerical measurements aggregated over time: requests per second, p99 latency, error rate. They are cheap to store and fast to query, but they compress detail. Traces follow a single request through every service it touches, recording timing and context at each hop. They are the primary tool for diagnosing latency in microservice architectures.

All three were designed for software that does exactly what its code says. Call function X with input Y, get output Z every time. AI inference breaks this contract: the same input can produce different outputs across model versions, the "function" is a billion-parameter statistical approximation, and the failure mode is not an exception thrown β€” it is a quietly wrong answer that looks perfectly normal from the outside.

Why Classical Monitoring Falls Short

A model endpoint can return HTTP 200, sub-100ms latency, and zero Python exceptions while simultaneously producing outputs that are factually wrong, biased, or completely out of distribution. Traditional monitoring would report that system as healthy. AI observability requires additional signal layers specifically designed to evaluate output quality and behavioral consistency.

What AI Observability Adds

AI observability extends the classical three pillars with signal types that are specific to statistical models in production. The field is young β€” the term was not widely used before 2021 β€” but a consensus set of additional dimensions has emerged from the work of teams at organizations including Uber, Lyft, Google Brain, and a wave of dedicated tooling companies.

Data and feature monitoring tracks the statistical properties of inputs flowing into the model at inference time and compares them against the distribution seen during training. If a model was trained on loan applications from applicants aged 25–60 and begins receiving applications predominantly from applicants aged 18–22, a statistical test β€” typically Population Stability Index or Jensen-Shannon divergence β€” will flag the shift before accuracy degrades visibly.

Prediction monitoring tracks the distribution of the model's outputs. If a classification model begins emitting one class far more frequently than during validation, that shift is often a leading indicator of a data or model problem even before ground-truth labels arrive.

Model performance monitoring tracks accuracy, precision, recall, or task-specific metrics against ground truth as labels become available. The challenge is label latency: ground truth for a credit decision may not arrive for 30–90 days. Much of the practice of AI observability is about what to monitor in the absence of immediate ground truth.

Key Distinction

Infrastructure observability asks: "Is the system running?" AI observability asks: "Is the system behaving correctly?" These are separate questions with separate toolchains. A production AI system needs both.

Core Vocabulary

Data DriftA statistically significant change in the distribution of input features between training time and inference time. Sometimes called covariate shift. Does not necessarily mean model performance has degraded β€” but is a leading indicator that it might.
Concept DriftA change in the underlying relationship between inputs and the correct output. The world changed, not just the data. More dangerous than data drift because it invalidates the model's learned patterns directly.
Model DecayThe gradual degradation of model performance over time as the real world diverges from the training distribution. The rate of decay varies widely β€” a fraud detection model may degrade in weeks; a structural engineering model may remain valid for years.
Observability vs. MonitoringMonitoring alerts you when a known threshold is crossed. Observability allows you to explore unknown failure modes by querying your telemetry. The distinction matters: in AI systems, you often don't know in advance what the failure mode looks like.
Ground Truth LatencyThe delay between when a prediction is made and when the correct answer becomes available. High ground truth latency β€” common in lending, healthcare, and insurance β€” is the primary constraint on real-time performance monitoring.

The Observability Stack in Practice

In a mature ML platform β€” Google's internal systems, Meta's PyTorch-based production infrastructure, or the open-source MLflow and Weights & Biases ecosystems β€” observability is implemented in layers. The lowest layer is infrastructure telemetry: GPU utilization, memory, network I/O, pod health in Kubernetes. The second layer is serving telemetry: request rate, latency percentiles, error codes from the model server (TorchServe, Triton Inference Server, or a custom FastAPI wrapper are common). The third layer is model telemetry: logged inputs and outputs, feature statistics, prediction distributions. The fourth layer, increasingly common since 2022, is quality telemetry: automated evaluation of outputs using secondary models, human-in-the-loop review pipelines, and feedback signals from downstream systems or users.

Each layer feeds different stakeholders. Infrastructure telemetry goes to SRE teams. Serving telemetry goes to platform engineers. Model telemetry goes to ML engineers and data scientists. Quality telemetry goes to everyone, including product managers and compliance teams. Building a coherent observability stack means deciding what to collect at each layer, where to store it, and who needs to see it in what time frame.

Real Deployment: Uber's Michelangelo Platform

Uber's Michelangelo ML platform, described publicly in a 2017 engineering blog post and updated in subsequent documentation, built prediction logging into the serving layer from the start. Every inference is logged with the input features, the output score, and a unique prediction ID that can be joined against outcomes later. This design β€” log everything at prediction time, join against outcomes asynchronously β€” became a template for production ML observability at scale and influenced the architecture of tools including Tecton, Feast, and Vertex AI Feature Store.

Why This Matters Now

Through 2023 and into 2024, large language models moved from research artifacts to production dependencies at a pace that outran the observability tooling designed for classical ML. A regression model producing a continuous score is relatively straightforward to monitor statistically. A language model producing free-form text raises harder questions: how do you detect drift in a 512-token output? How do you define a distribution over natural language? How do you monitor for hallucination at scale without reading every response?

The emerging answers involve LLM-as-evaluator architectures β€” using a second language model to score the outputs of the first β€” combined with deterministic checks for factual anchoring, citation accuracy, and format compliance. Companies including Arize AI, Weights & Biases, LangSmith, and Honeycomb have built tooling specifically for this layer. The field is moving fast, and the vocabulary and practices covered in this module are the stable foundation beneath that fast-moving surface.

Lesson 1 Quiz

What Observability Means for AI Systems Β· 5 questions
1. What is the primary reason classical monitoring tools (logs, metrics, traces) are insufficient for AI systems in production?
Correct. A model can return HTTP 200 with normal latency while producing factually wrong or out-of-distribution outputs. Infrastructure metrics would report the system healthy. This is the core gap AI observability addresses.
Not quite. The issue is not volume, cost, or hardware compatibility β€” it is that infrastructure signals do not capture whether model outputs are correct or appropriate. Review the "Why Classical Monitoring Falls Short" callout.
2. Zillow's Offers program write-down in 2022 is used in this lesson as an example of what failure?
Correct. The Zillow model performed adequately in testing. The failure was observability: the team lacked instrumentation to see that input distributions were shifting in real time, and by the time the errors were visible in financial results, the positions were already taken.
Not right. The lesson emphasizes that the model worked in testing and the infrastructure remained operational. The failure was that no system detected the behavioral drift in the model's production outputs. Re-read the Opening Scene.
3. What is the difference between data drift and concept drift?
Correct. Data drift means the world of inputs has changed β€” but the correct mapping from input to output might still hold. Concept drift means the mapping itself has changed. Concept drift is generally more severe because the model's learned patterns are now directly wrong.
Incorrect. Both types of drift can affect any data modality, and both can eventually be detected. The distinction is about what has changed: the distribution of inputs versus the underlying relationship that the model was trained to approximate. Review the Core Vocabulary section.
4. What is "ground truth latency" and why does it complicate AI observability?
Correct. In credit decisioning, healthcare diagnoses, insurance claims, and many other domains, you cannot know if the prediction was right for weeks or months. This forces practitioners to monitor proxy signals β€” input distributions, output distributions β€” rather than accuracy directly.
Not quite. Ground truth latency is not about inference speed or human annotation time. It is about how long you have to wait for the real outcome your model was trying to predict. This is what makes AI observability much harder than traditional software monitoring.
5. Uber's Michelangelo platform established which design pattern that became influential for production ML observability?
Correct. Michelangelo's approach β€” log everything at prediction time, join against outcomes later β€” solved the ground truth latency problem by decoupling the prediction record from the evaluation. This architecture influenced Tecton, Feast, Vertex AI Feature Store, and most modern ML observability platforms.
Incorrect. The Michelangelo design pattern described in the lesson is about prediction logging: capturing inputs, outputs, and a joinable ID at the moment of inference. This lets you asynchronously evaluate accuracy once ground truth arrives. Review the callout on Uber's platform.

Lab 1 β€” Observability Signal Audit

Practice identifying which observability layers are present or missing in a described AI deployment

Your Task

You'll work through a real-world deployment scenario with the AI tutor. Describe what observability signals are present, identify the gaps, and reason through what additional instrumentation would have changed the outcome. Focus on distinguishing infrastructure monitoring from AI-specific observability.

Starter prompt: "A team has deployed a loan approval model to production. They are monitoring server uptime, API latency, and HTTP error rates. They do not log the model's input features or output scores. Three months later, approval rates have dropped 40% and they don't know why. Walk me through which observability layers are missing and what each one would have revealed."
AI Tutor
Observability Fundamentals
Welcome to Lab 1. I'm here to help you work through AI observability signal gaps in real deployment scenarios. Use the starter prompt above or describe your own scenario β€” I'll help you systematically identify which monitoring layers are present, which are missing, and what each would reveal. What would you like to explore?
Deploying and Monitoring AI Β· Module 1 Β· Lesson 2

Detecting Data and Model Drift

A model trained last quarter may already be wrong today. The question is not whether drift happens β€” it is whether you see it in time.
How do you know when the world your model was trained on no longer matches the world it is operating in?

In early 2020, a fraud detection model deployed by a major European bank abruptly began misclassifying legitimate transactions at a rate three times higher than its validation benchmark. No one had changed the model. No code had been deployed. What had changed was the world: COVID-19 lockdowns had fundamentally altered consumer spending patterns within a matter of weeks. Online grocery purchases spiked. Gym memberships dropped to zero. The transaction patterns that had defined "normal" in the training data were no longer representative of the real distribution. The bank's monitoring system, which tracked accuracy against a rolling 90-day window of labeled outcomes, was 90 days behind the shift. By the time the alert fired, the false positive rate had been elevated for six weeks.

This scenario β€” documented in a 2021 case study by the European Banking Authority on operational resilience of AI systems β€” became a canonical illustration of why drift detection cannot depend solely on lagged accuracy metrics.

Statistical Methods for Drift Detection

Drift detection begins with a reference distribution β€” typically the feature statistics from the training or validation dataset β€” and compares incoming production data against it. Several statistical tests have become standard tools for this comparison.

The Kolmogorov-Smirnov (KS) test compares two continuous distributions by measuring the maximum absolute difference between their empirical cumulative distribution functions. It requires no assumptions about the underlying distribution shape and is sensitive to changes in both location and spread. It is the most commonly used test for continuous features in production ML monitoring systems.

The Population Stability Index (PSI) originated in credit risk modeling in the 1990s and remains widely used in financial services AI. It measures the shift in a feature distribution by bucketing values and comparing bucket proportions between reference and production populations. A PSI below 0.1 is generally considered stable; between 0.1 and 0.2 warrants investigation; above 0.2 indicates significant shift. PSI's interpretability β€” and the fact that it maps directly to regulatory reporting conventions β€” explains its persistence despite more statistically principled alternatives.

The Jensen-Shannon (JS) divergence is a symmetric, bounded version of KL divergence that measures how much two probability distributions differ. Unlike PSI, it handles continuous distributions natively without bucketing. It is increasingly used in ML monitoring libraries including Evidently AI and WhyLabs, which both launched production-ready open-source tooling in 2021.

Choosing the Right Test

KS tests work well for continuous unimodal features. PSI is preferred in regulated industries due to its interpretability and established threshold conventions. JS divergence handles multimodal distributions and categorical variables more gracefully. In practice, most production monitoring systems run multiple tests and alert when any threshold is crossed, accepting the cost of some false alarms in exchange for earlier detection.

Multivariate Drift: The Hard Problem

Monitoring each feature independently misses an important failure mode: the joint distribution of features can shift even when each individual feature looks stable. A fraud model trained on transaction data where high-value purchases and late-night activity are correlated may behave poorly in a world where that correlation has broken down β€” even if the marginal distributions of transaction value and time-of-day look unchanged.

Detecting multivariate drift requires different tools. The Maximum Mean Discrepancy (MMD) test operates in a kernel-induced feature space and can detect shifts in the joint distribution without specifying which features are involved. It is computationally expensive but powerful for high-dimensional data. Domain classifier drift detection trains a binary classifier to distinguish reference from production data β€” if the classifier achieves significantly above-chance accuracy, the distributions have diverged in some detectable way. Google's TFX platform and Arize AI both implement variants of this approach.

A more recent approach, gaining adoption since 2022, uses learned data representations: pass inputs through an encoder (often the early layers of the production model itself) and monitor drift in the embedding space rather than the raw feature space. This detects semantically meaningful shifts even in high-dimensional inputs like text and images where raw feature statistics are uninformative.

Embedding-Space Monitoring in Practice

Arize AI's 2023 documentation describes production deployments where embedding drift detection caught model degradation 3–4 weeks before accuracy metrics declined, by monitoring the centroid and spread of embedding clusters for incoming production data. For LLMs processing free-form text, this is currently the most practical approach to input drift detection at scale.

Output (Prediction) Drift

Monitoring the distribution of model outputs is distinct from monitoring inputs, and in many ways more directly actionable. If a binary classifier begins predicting the positive class at 35% instead of its historical 18%, that shift is a strong signal that something has changed β€” whether in the inputs, the model, or the deployment environment. Output drift monitoring does not require access to ground truth labels and can be implemented immediately upon deployment.

For regression models, tracking the mean, variance, and percentile distribution of predicted values against a reference window is straightforward. For classification models, tracking class probability distributions and predicted class proportions provides equivalent signal. For ranking models, tracking the distribution of scores at the top-k positions detects the most operationally important shifts.

The limitation of output drift monitoring is that it is a lagging indicator relative to input drift: by the time prediction distributions shift meaningfully, the model has already been producing degraded outputs. It is most useful as a confirmation signal paired with upstream input monitoring, and as a canary metric for operational teams who do not have direct access to feature-level telemetry.

Drift Response Protocols

Detection without response is just surveillance. A production ML system needs a defined protocol for what happens when drift is detected, calibrated to the severity of the shift and the business impact of the model's decisions.

At the first tier β€” minor drift within warning thresholds β€” the appropriate response is typically increased logging fidelity and human review of a sample of recent predictions. At the second tier β€” drift exceeding action thresholds β€” common responses include model rollback to an earlier version, switching to a more conservative fallback model (often a simpler, more robust baseline), or temporarily routing traffic to human reviewers. At the third tier β€” severe or rapid drift β€” the model may need to be taken offline entirely until retraining on current data is complete.

Netflix's 2022 engineering blog described a tiered response system for their recommendation models that automated the first two tiers while requiring human sign-off for the third. The key insight from that system: automating the response to minor drift actually made teams more willing to set sensitive detection thresholds, because they did not face the prospect of an alert triggering a manual escalation at 2am for every minor fluctuation.

Lesson 2 Quiz

Detecting Data and Model Drift Β· 5 questions
1. What is the Population Stability Index (PSI) and what threshold values are conventionally used to flag concern?
Correct. PSI originated in credit risk modeling and measures how much a feature distribution has shifted between two populations by bucketing values and comparing bucket proportions. Its interpretable thresholds and alignment with regulatory conventions explain its continued widespread use in financial services.
Incorrect. PSI is a drift detection metric, not an accuracy metric. It measures distributional shift using bucket comparisons, with conventional thresholds at 0.1 and 0.2. Review the Statistical Methods section.
2. Why was the European bank's fraud model alert delayed by six weeks despite the drift occurring at the start of COVID-19 lockdowns?
Correct. The bank's system tracked accuracy against a rolling 90-day window of labeled outcomes. Because it took 90 days to collect enough ground truth from the drift period, the alert was structurally delayed. This is the core argument for monitoring input distributions in real time, rather than waiting for lagged accuracy signals.
Incorrect. The delay was structural, not operational. The monitoring system was designed to track accuracy against labeled outcomes, and those labels took 90 days to accumulate. This is why real-time input drift monitoring is necessary alongside lagged accuracy monitoring.
3. What is the key advantage of "domain classifier" drift detection over univariate statistical tests?
Correct. A domain classifier is trained to distinguish reference from production data. If it achieves above-chance accuracy, it means the two populations are distinguishable β€” even if no single feature showed significant drift on its own. This catches correlated multivariate shifts that univariate tests structurally miss.
Incorrect. Domain classifier methods are computationally more expensive than simple univariate tests. Their advantage is sensitivity to multivariate drift β€” changes in the joint distribution that individual feature tests are blind to. Review the Multivariate Drift section.
4. What is the primary limitation of monitoring prediction (output) drift as your main drift signal?
Correct. Output drift is useful and easy to implement β€” it requires no labels and no feature access. But it detects drift after the model's behavior has already changed, making it a confirmation signal rather than an early warning. It should be paired with upstream input monitoring that can catch drift before it propagates to outputs.
Incorrect. Output drift monitoring does not require ground truth labels β€” that is actually one of its advantages. Its limitation is that it is a lagging indicator: the prediction distribution shifts only after the model has already been receiving drifted inputs and producing affected outputs.
5. What did Netflix's 2022 tiered drift response system demonstrate about the relationship between automated response and detection sensitivity?
Correct. This is an important systems insight: if every alert requires a human to act at 2am, teams will set conservative thresholds to minimize alarms. Automating the low-severity response removes that incentive, allowing more sensitive detection without overwhelming on-call engineers.
Incorrect. The Netflix case demonstrates a positive feedback loop between automation and sensitivity β€” not a failure. When minor drift triggers automated responses rather than manual escalation, teams can afford to monitor more sensitively. Review the Drift Response Protocols section.

Lab 2 β€” Drift Detection Design

Practice selecting and justifying drift detection methods for specific deployment scenarios

Your Task

Work through drift detection method selection with the AI tutor. You'll be given a deployment scenario and asked to choose appropriate statistical tests, justify your choices, and design a response protocol. Focus on matching the method to the data type, ground truth latency, and business stakes.

Starter prompt: "I'm deploying a model that predicts 30-day hospital readmission risk. Features include age, diagnosis codes, lab values, and length of stay. Ground truth (actual readmission) arrives 30 days later. Walk me through which drift detection methods are most appropriate here and why β€” and what I should do when drift is detected."
AI Tutor
Drift Detection
Welcome to Lab 2. I'll help you work through the selection and justification of drift detection methods for production ML deployments. Use the starter prompt above or bring your own scenario. I'll ask about your feature types, ground truth latency, and business context to help you reason through the right approach.
Deploying and Monitoring AI Β· Module 1 Β· Lesson 3

Logging Strategies and Telemetry Design

What you log at deployment time determines what you can diagnose forever after. The decisions are harder than they look.
If something goes wrong with your model six months from now, will you have the data to understand why?

In 2021, researchers at MIT published a study examining AI diagnostic tools deployed in hospitals across the United States and found that many systems lacked any structured logging of their inputs and outputs. When clinicians reported that a sepsis prediction tool seemed to be performing differently on night-shift patients, there was no data with which to investigate the claim. The tool had been deployed with infrastructure monitoring β€” uptime, response time β€” but without any record of what features went in or what scores came out. The investigation required reconstructing a partial picture from EHR audit logs that had not been designed for this purpose, and the finding β€” that the model's performance differed significantly between day and night shifts due to systematic differences in which nursing notes were entered by the time of prediction β€” took over a year to confirm. Logging, designed properly at deployment, would have made that finding available in weeks.

What to Log and When

ML logging decisions involve four fundamental trade-offs: completeness versus storage cost, granularity versus privacy, immediacy versus throughput impact, and structure versus flexibility. Getting these right requires thinking forward β€” imagining the investigations you might need to conduct β€” rather than backward from what is easy to implement today.

At minimum, a production ML system should log: the timestamp of every inference, a unique prediction ID, the model version serving the request, and the model's output. This minimal record enables volume monitoring, version attribution, and output distribution tracking. It is not sufficient for diagnosing most production problems.

The next tier adds input feature values β€” or a hash or summary of them, if full feature logging is cost-prohibitive or privacy-constrained. This enables input drift detection, feature importance debugging, and the ability to replay historical inferences against a new model version. Uber's Michelangelo, as noted in Lesson 1, built this into the serving layer from day one; teams that did not find themselves unable to diagnose model behavior during the pandemic distribution shifts of 2020.

The highest tier adds contextual metadata: user cohort, geographic region, product surface, A/B experiment assignment, and any contextual signals that might stratify model behavior. This data is often more valuable than the features themselves for diagnosing population-level performance differences β€” the night-shift versus day-shift discrepancy in the MIT hospital study would have been detectable from a single "shift" metadata field.

The Replay Principle

Design your logging so that you can, at any future point, take a historical window of production traffic and re-run it through any model version. This requires logged inputs (not just hashes), model version tags, and immutable storage. Teams that have this capability can validate a new model against real production traffic before deploying it β€” effectively running a simulation of the deployment on real data.

Sampling Strategies

High-volume serving systems β€” a recommendation model processing tens of millions of requests per day β€” cannot log every inference in full fidelity without incurring prohibitive storage costs. Sampling is necessary, but the sampling strategy matters enormously for what the logs can tell you.

Random sampling at a fixed rate (e.g., 1% of all requests) is the simplest approach and produces a statistically representative sample for distribution monitoring. Its weakness is that rare but important events β€” edge cases, high-confidence wrong predictions, adversarial inputs β€” are underrepresented proportionally to their rarity.

Stratified sampling ensures that important subpopulations β€” demographic groups, product segments, geographic regions β€” are sampled at rates sufficient to support disaggregated monitoring. This is increasingly important for AI fairness monitoring, where an overall sample might look healthy while a minority subgroup experiences severe degradation.

Anomaly-based sampling preferentially logs predictions that are unusual in some way: high model uncertainty, inputs far from the training distribution, outputs near decision boundaries. This disproportionately captures the cases that are most likely to be problematic and most informative for model improvement. Google's production ML systems described in their 2018 "Rules of Machine Learning" paper use variants of this approach.

Systematic high-value sampling logs 100% of predictions for high-stakes or high-value cases β€” large transactions, high-acuity medical cases, predictions that will be acted on immediately β€” while sampling more lightly from routine cases. This prioritizes logging fidelity where the cost of a wrong prediction is highest.

Privacy, Compliance, and Logging Constraints

Full-fidelity feature logging is often impossible or inadvisable. Medical features are protected under HIPAA; financial features are regulated under GDPR's right to explanation provisions in the EU; biometric features may be restricted by state laws like Illinois's BIPA. These constraints are not obstacles to observability β€” they are design parameters.

Common privacy-preserving logging approaches include: logging feature statistics (mean, variance, percentiles) rather than individual values; logging hashed or tokenized versions of sensitive identifiers; logging in an encrypted form that requires key access to read; and separating the feature log from the prediction log with different access controls so that the union of the two tables is only joinable by authorized analysts.

The GDPR's Article 22 provisions on automated decision-making have an important interaction with ML logging: if your system makes decisions with significant legal or similarly significant effects on individuals using solely automated processing, you may be required to log the basis of those decisions in a form that supports human review. This is a regulatory requirement for observability, not a technical choice.

Schema Stability

The most common practical failure in ML logging is schema drift: the feature schema at inference time diverges from the schema at training time, and no one catches it because the serving system accepts the request and the log records whatever came in. Enforcing a schema contract at the serving layer β€” rejecting or flagging requests with unexpected feature structures β€” is a critical observability primitive that is frequently omitted in early-stage ML systems.

Structured Logging for Traceability

Unstructured logs are nearly useless for ML diagnostics at scale. A production ML logging schema should be structured (JSON or Parquet, not free text), versioned (include a schema version field), and designed with join keys in mind. The prediction ID must be stable and globally unique. If you use a feature store, log the feature retrieval query alongside the feature values so you can diagnose feature serving errors independently of model errors. If you serve multiple model versions simultaneously via A/B or canary routing, the model version and routing decision must be logged with every prediction.

MLflow, introduced by Databricks in 2018, was among the first open-source tools to enforce structured experiment and run logging for ML workflows. Its influence on production logging practices β€” particularly the emphasis on logging hyperparameters, metrics, and artifacts as first-class objects β€” is visible in Vertex AI Experiments, Azure ML, and SageMaker Experiments, all of which adopted similar schemas.

Lesson 3 Quiz

Logging Strategies and Telemetry Design Β· 5 questions
1. What is the minimum viable logging record for a production ML inference, and what does it enable?
Correct. These four fields are the minimum that enables basic observability: you know when predictions happened, can attribute them to a model version, can track output distributions, and have a stable ID for joining against future outcomes. Everything beyond this is valuable but these four fields are foundational.
Incorrect. Ground truth labels are not available at inference time, and accuracy is therefore not computable in real time. The minimum viable log captures timestamp, prediction ID, model version, and output β€” sufficient for basic monitoring and joinable against outcomes later. Review the What to Log section.
2. What did the MIT 2021 study of hospital AI tools reveal about the consequences of inadequate logging?
Correct. The study found that without structured inference logs, a legitimate clinical concern about model behavior required a year-long investigation using audit trails not designed for ML diagnostics. With proper logging β€” including a simple "shift" metadata field β€” the same finding would have been detectable in weeks.
Incorrect. The study's finding was specifically about diagnostic capacity: without ML inference logs, a real and significant performance difference between patient populations took over a year to confirm. This illustrates the cost of deferred logging decisions. Review the Opening Scene.
3. What is the primary advantage of anomaly-based sampling over random sampling for ML logging?
Correct. Random sampling represents the overall population well but underrepresents rare events. Anomaly-based sampling inverts this: it specifically captures the predictions near decision boundaries, far from the training distribution, or with high model uncertainty β€” exactly the cases that are most likely to be wrong and most valuable for improving the model.
Incorrect. Equal demographic representation is the goal of stratified sampling, not anomaly-based sampling. Anomaly sampling targets unusual predictions specifically because they are the most diagnostic. Review the Sampling Strategies section.
4. What is "schema drift" in ML logging and why is it considered a critical observability failure?
Correct. Schema drift is insidious because it is invisible without an enforced contract at the serving layer. The model continues to serve requests, the logs continue to be written, but the features being logged may not correspond to what the model was trained on. Enforcing schema validation at inference time catches this before it compounds.
Incorrect. Schema drift specifically refers to the divergence between the feature schema used at training and the schema encountered at inference time. Because most serving systems accept any well-formed request, this divergence can persist silently. The fix is schema enforcement at the serving layer. Review the Schema Stability callout.
5. Under GDPR Article 22, what logging requirement applies to AI systems making automated decisions with significant legal effects?
Correct. GDPR Article 22 creates a legal basis for explainability and auditability requirements in high-stakes automated decision-making. The logging infrastructure that supports human review is not merely technically advisable β€” it is potentially legally required. This is why observability investment is often easier to justify in regulated industries.
Incorrect. The GDPR provision discussed creates a requirement for the decision basis to be logged and reviewable by humans β€” not for anonymization or weight retention. This makes observability tooling a compliance investment as well as a technical one. Review the Privacy and Compliance section.

Lab 3 β€” Logging Schema Design

Practice designing production-ready ML logging schemas for specific deployment contexts

Your Task

Work with the AI tutor to design a logging schema for a specific AI deployment. You'll need to decide what fields to include, what sampling strategy to apply, and how to handle privacy constraints. The tutor will challenge your design and help you think through failure modes.

Starter prompt: "Help me design a logging schema for a content moderation model deployed on a social platform. The model classifies user-generated posts into categories: safe, borderline, or violating. We process about 5 million posts per day. Some posts contain PII. What should we log, at what granularity, and with what sampling strategy?"
AI Tutor
Logging Design
Welcome to Lab 3. I'll help you work through ML logging schema design β€” what to capture, at what granularity, under what constraints. Use the starter prompt above or bring your own deployment context. I'll push back on your design choices and help you anticipate the investigations you'll need to run six months from now.
Deploying and Monitoring AI Β· Module 1 Β· Lesson 4

Alerting, Escalation, and Feedback Loops

Observability without action is just expensive data collection. The signal chain from detection to remediation determines whether monitoring protects you or merely documents failure.
When your monitoring fires at 3am, does anyone know what to do β€” and does doing it actually fix the problem?

In March 2023, GitHub Copilot's suggestion quality degraded noticeably for a subset of users programming in Python. GitHub's internal telemetry detected an uptick in user rejection rates β€” the fraction of Copilot suggestions that users dismissed without accepting β€” within hours. The signal chain worked as intended: the metric fired, an on-call engineer reviewed the degradation, identified that a recent infrastructure change had subtly altered the tokenization path for a specific Python version, and the rollback was complete within a working day. The incident was documented publicly in GitHub's transparency report and cited as an example of feedback loop design working under real conditions. The critical element was not just that the monitoring fired β€” it was that the alert was connected to a runbook, routed to someone with authority to act, and that the action was clear.

Most production ML incidents are not resolved this cleanly. The difference is usually not in the detection quality β€” it is in the response infrastructure that the detection feeds into.

Designing Alerts That Get Acted On

Alert fatigue is a documented failure mode in both traditional SRE and ML operations. When monitoring systems generate too many alerts β€” or alerts with insufficient context β€” on-call engineers begin ignoring them. A 2023 survey by PagerDuty found that 62% of on-call engineers reported receiving alerts they considered uninformative at least weekly; 31% reported actively suppressing alert channels during periods of high volume. In ML systems, where many alerts are statistical in nature and do not correspond to discrete errors, this problem is more acute.

Effective ML alerts share several properties. They are actionable: each alert has a defined set of actions that can be taken in response, documented in a runbook. They are routed: they reach the person or team with the authority and context to act, not just the person who happens to be on call for infrastructure. They are contextualized: they include not just the raw metric value but the baseline, the trend, the affected model version, and the affected population segment. They are tiered: severity levels distinguish between "investigate during business hours" and "wake someone up now."

The Prometheus and Alertmanager stack, widely used for infrastructure monitoring, supports all of these properties and has been extended for ML monitoring by tools like Evidently AI (which generates drift reports that can be exported as Prometheus metrics) and Grafana ML, which added ML-specific alert condition types in 2022.

Runbooks Are Not Optional

A runbook is a documented procedure for responding to a specific alert: what the metric means, what values are concerning, what to investigate first, what actions are available, and who to escalate to if those actions are insufficient. ML runbooks differ from infrastructure runbooks in that they must address statistical ambiguity β€” an alert does not mean the system is broken, it means something has changed that warrants human judgment. Documenting that nuance is essential for teams where not everyone is a data scientist.

Human-in-the-Loop Review Pipelines

For high-stakes AI systems β€” medical devices, credit decisions, legal document analysis β€” monitoring is not sufficient without human review capacity. The question is how to design review pipelines that scale with prediction volume and provide actionable signal back into the model development loop.

The standard architecture involves a queue-based review system: predictions flagged by monitoring rules (high uncertainty, anomalous inputs, specific content categories) are routed to a review queue where human reviewers label the output as correct, incorrect, or ambiguous. These labels serve two purposes simultaneously: they generate immediate quality signal for the monitoring dashboard, and they accumulate as training data for the next model version.

Scale Control, acquired by Scale AI in 2021, and Labelbox both offer production review pipeline tooling that integrates this dual-purpose design. Google's data labeling service, launched as part of Vertex AI in 2021, builds the training data feedback loop directly into the annotation interface: reviewed production predictions can be added to the training dataset in one step.

Closing the Feedback Loop

The most sophisticated observability infrastructure is wasted if its outputs do not feed back into model improvement. Closing the feedback loop means building a pathway from production observations β€” drift detections, error analyses, human review labels β€” to model retraining and redeployment.

The simplest feedback loop is manual: data scientists review monitoring dashboards on a cadence, decide when retraining is warranted, trigger a retraining job, evaluate the new model offline, and deploy if it passes. This loop typically operates on weeks-to-months timescales and is appropriate for models where the deployment cost is high and the production distribution changes slowly.

Continuous training pipelines automate portions of this loop. Google's TFX (TensorFlow Extended) framework, described in a 2017 KDD paper, pioneered the automated retraining pipeline in production: new data meeting quality criteria is automatically added to the training set, a retraining job is triggered on a schedule or by a drift detection event, the new model is evaluated against held-out production data, and if it passes a comparison threshold against the deployed model, it enters a staged rollout. Meta described a similar architecture for their ad ranking models in a 2021 engineering blog post, noting that continuous training reduced model staleness from weeks to hours for their highest-velocity use cases.

The Retraining Trap

Continuous retraining on production data can silently encode feedback loops that amplify model errors over time. If a model makes biased decisions that affect which users generate training data β€” as documented in a 2019 analysis of YouTube recommendation systems β€” retraining on that data reinforces the bias. Observability for continuous training systems must include monitoring of the training data distribution, not just the serving distribution.

Canary Deployments and Shadow Mode

Two deployment patterns work in direct support of observability by structuring how new model versions are introduced to production traffic.

In a canary deployment, a new model version receives a small percentage of live traffic β€” typically 1–5% β€” while the current version serves the rest. Monitoring compares the canary's behavior against the baseline in real time. If the canary's metrics degrade or diverge, traffic is routed back to the baseline before the impact is visible to most users. Canary deployments require that your monitoring infrastructure can disaggregate metrics by model version β€” which is why model version logging, discussed in Lesson 3, is a prerequisite for this pattern.

In shadow mode (also called dark launch or mirror testing), the new model receives a copy of live traffic and produces predictions, but those predictions are not served to users. Instead, they are logged and compared against the production model's predictions offline. Shadow mode enables testing a new model against real production traffic without any user-facing risk. It is particularly valuable for LLM applications where offline evaluation benchmarks are known to be poor predictors of production behavior β€” a finding documented by researchers at Stanford and DeepMind in separate 2023 papers on the gap between benchmark and production performance of language models.

Building a Monitoring Culture

Technical infrastructure for observability is necessary but not sufficient. The organizational practices around it β€” who reviews dashboards, how incidents are documented, whether post-mortems generate systemic improvements β€” determine whether monitoring creates learning or just records failure.

The blameless post-mortem practice, imported into ML teams from SRE culture, is particularly valuable. When a production ML incident occurs, the post-mortem focuses on what system properties made the incident possible and what changes would prevent recurrence β€” not on who made a mistake. The output is a set of action items that improve the system: new monitoring signals, tightened thresholds, improved runbooks, additional human review checkpoints. Google's Site Reliability Engineering book (Beyer et al., 2016) codified this practice, and it has been adopted by ML platform teams at Airbnb, Spotify, and Twitter (now X) as they built out production ML operations functions.

Lesson 4 Quiz

Alerting, Escalation, and Feedback Loops Β· 5 questions
1. What made the GitHub Copilot March 2023 incident a positive example of observability working correctly?
Correct. The GitHub case illustrates the full signal chain working: detection (rejection rate metric), routing (to someone with authority and context), runbook (clear action to take), and resolution (rollback within hours). Each element was necessary β€” a monitoring system that fired without a runbook or routing would have produced the same alert with no resolution.
Incorrect. The degradation did reach users β€” that is how the rejection rate signal was generated. The observability worked not by preventing the incident, but by detecting it quickly and supporting a rapid, well-informed response. Review the Opening Scene and the section on actionable alerts.
2. What four properties do effective ML alerts share, according to this lesson?
Correct. Actionable means there is a defined response. Routed means it reaches someone with authority to act. Contextualized means it includes baseline, trend, model version, and affected population β€” not just the raw metric value. Tiered means severity distinguishes urgency. Missing any one of these properties significantly reduces the alert's utility.
Incorrect. The four properties described in the lesson are actionable, routed, contextualized, and tiered. Each addresses a specific failure mode in alert design: lack of defined response, wrong recipient, insufficient context, and undifferentiated urgency. Review the Designing Alerts section.
3. What is the key risk of continuous retraining pipelines that observability must specifically address?
Correct. This is the "retraining trap": if a model's biased or erroneous decisions affect what data gets generated β€” what content is recommended, what applications are approved, what results are clicked β€” then retraining on that data reinforces the bias. Monitoring the training data distribution, not just the serving distribution, is the necessary safeguard.
Incorrect. The risk of continuous retraining is not primarily cost or version tracking β€” it is the feedback loop problem. If the model's decisions shape the data it is retrained on, errors can compound silently across model generations. The gold callout in this lesson describes the YouTube documentation of this pattern. Review it.
4. What is the difference between a canary deployment and shadow mode?
Correct. The key distinction is user impact. Canary deployments expose a small real user population to the new model and rely on live metric comparison to detect regressions. Shadow mode produces predictions that are never seen by users, enabling pure comparison without any risk β€” at the cost of not capturing real user behavioral responses to the new model's outputs.
Incorrect. Both patterns use real production traffic β€” that is the point. They differ in whether the new model's outputs are served to users (canary, to a small fraction) or only logged for offline comparison (shadow mode). Review the Canary Deployments and Shadow Mode section.
5. The blameless post-mortem practice, imported from SRE culture, focuses on what when a production ML incident occurs?
Correct. The blameless post-mortem shifts focus from individual accountability to systemic improvement. The output is not a finding of fault but a set of action items: new monitoring signals, tightened thresholds, better runbooks, additional review checkpoints. This practice produces learning from incidents rather than just documentation of them.
Incorrect. The blameless post-mortem specifically avoids assigning individual blame. Its purpose is systemic: what made this incident possible, and what changes to the system would prevent it? The output is action items for improving observability infrastructure, not a personnel finding. Review the Monitoring Culture section.

Lab 4 β€” Alert Design and Incident Response

Practice designing alert configurations and escalation runbooks for production AI systems

Your Task

Work with the AI tutor to design an alerting and escalation framework for a specific AI deployment. You'll define alert conditions, severity tiers, runbook content, and feedback loop design. The tutor will test your design against realistic incident scenarios.

Starter prompt: "I'm responsible for a credit scoring model used by a regional bank to make real-time loan decisions. The model affects about 2,000 applications per day. Help me design a tiered alerting system β€” what drift or performance metrics should trigger each tier, what the response protocol should be for each, and how to structure the feedback loop back to the model team."
AI Tutor
Alert Design
Welcome to Lab 4. I'll help you design alerting frameworks, escalation runbooks, and feedback loops for production AI systems. Use the starter prompt above or describe your own deployment. I'll walk you through defining alert conditions for each severity tier, drafting runbook content, and designing the feedback path back to the model team.

Module 1 Test

AI Observability Fundamentals Β· 15 questions Β· Pass mark: 80%
1. Which of the following best describes what AI observability adds beyond traditional infrastructure monitoring?
Correct.
Review Lesson 1: What AI Observability Adds.
2. The Zillow Offers write-down is used in this module to illustrate which principle?
Correct.
Review Lesson 1, Opening Scene: the Zillow case is about observability gaps, not model design or infrastructure.
3. What is the key difference between data drift and concept drift?
Correct.
Review Lesson 1, Core Vocabulary: data drift vs. concept drift.
4. What does "ground truth latency" mean and which domains experience it most acutely?
Correct.
Review Lesson 1, Core Vocabulary: ground truth latency.
5. The KS (Kolmogorov-Smirnov) test is most appropriate for detecting drift in which type of feature?
Correct.
Review Lesson 2, Statistical Methods: the KS test is designed for continuous distributions.
6. What was the European bank fraud detection model's structural monitoring failure during COVID-19 lockdowns?
Correct.
Review Lesson 2, Opening Scene: the delay was structural, built into the 90-day outcome window design.
7. Why is monitoring each feature independently insufficient for detecting all types of production drift?
Correct.
Review Lesson 2, Multivariate Drift: the joint distribution problem.
8. According to the module, what design principle from Uber's Michelangelo platform became influential for production ML observability?
Correct.
Review Lesson 1, the Uber Michelangelo callout: log-at-prediction-time with joinable IDs.
9. What is "schema drift" in ML logging and what is the recommended mitigation?
Correct.
Review Lesson 3, the Schema Stability callout.
10. What is the "replay principle" in ML logging design?
Correct.
Review Lesson 3, the Replay Principle gold callout.
11. Which sampling strategy is specifically recommended for AI fairness monitoring to ensure adequate representation of minority subgroups?
Correct.
Review Lesson 3, Sampling Strategies: stratified sampling for subgroup representation.
12. What is the primary advantage of shadow mode deployment over canary deployment when testing a new model version?
Correct.
Review Lesson 4, Canary Deployments and Shadow Mode: the key distinction is user impact.
13. GDPR Article 22 provisions on automated decision-making create what specific observability implication?
Correct.
Review Lesson 3, Privacy, Compliance, and Logging Constraints: Article 22 and decision basis logging.
14. What organizational practice, imported from SRE culture, produces systemic improvements to ML observability infrastructure after production incidents?
Correct.
Review Lesson 4, Building a Monitoring Culture: blameless post-mortems.
15. The "retraining trap" in continuous training pipelines refers to what risk?
Correct.
Review Lesson 4, the Retraining Trap gold callout: feedback loops that amplify model errors through training data.