Operating Models Reliably with MLOps
This lesson explains how MLOps applies DevOps practices, such as automation, versioning, testing and monitoring, to machine learning, so models can be built, deployed and maintained reliably.
Learning outcomes
After completing this lesson, you will be able to:
- Explain why machine learning systems need MLOps.
- Identify the AWS services that provide the building blocks of MLOps, such as SageMaker Pipelines and the Model Registry.
- Describe the requirements a model must meet before production.
- Distinguish data drift, model quality drift, bias drift and feature attribution drift.
Why ML needs MLOps
ML systems depend on code, data and models, all of which change. A model accurate at launch can degrade as behaviour or data sources change. MLOps turns the lifecycle into a repeatable process instead of manual notebook steps.
MLOps building blocks on AWS
MLOps applies software engineering discipline to machine learning, so that models are built, released and maintained reliably rather than by hand. Experiment tracking records the data version, code, hyperparameters and results of each training run, so the best model can be identified and reproduced; SageMaker AI provides managed MLflow for this. Repeatable pipelines, built with SageMaker Pipelines, run the steps of preparing data, training, evaluating and registering a model automatically, the same way each time.
The SageMaker Model Registry stores each model version with its approval status, so only approved models reach production. SageMaker Model Monitor watches deployed models for problems. The following table summarises the building blocks.
| Practice | AWS service |
|---|---|
| Experiment tracking: record data version, code, hyperparameters and metrics | SageMaker AI with managed MLflow |
| Repeatable pipelines: prepare, train, evaluate, register | SageMaker Pipelines |
| Versioning and approval of models | SageMaker Model Registry |
| Monitoring deployed models | SageMaker Model Monitor |
CI/CD for ML uses Model Registry approvals to promote models from development through staging to production, with automated tests and rollback.
The following diagram shows the building blocks as a loop.

MLOps on AWS
Production readiness
A model that performs well in development must also meet further requirements before it is used in production. The following list describes these requirements.
- Scalability (auto scaling endpoints), security (IAM, encryption, VPCs), cost, testing and documentation (Model Cards) must all be addressed.
- Technical debt, such as undocumented features, hidden data dependencies and manual steps, makes ML systems fragile.
Technical debt
Monitoring for drift
A model that performed well at launch can become less accurate as the world changes, which is called drift. Data drift means the inputs no longer resemble the training data, for example when customers start buying different products. Model quality drift means accuracy, measured against the real outcomes once they are known, has fallen. Bias drift means predictions have become less fair to some groups over time. Feature attribution drift means different input features have started to drive the predictions, which can signal a problem even before accuracy falls. The following table summarises the four types.
| Drift | Meaning |
|---|---|
| Data drift | Input data no longer resembles the training data |
| Model quality drift | Accuracy falls against ground truth |
| Bias drift | Predictions become less fair over time |
| Feature attribution drift | Different features start driving predictions |
Model Monitor runs these checks on a schedule, publishes CloudWatch metrics and alerts, and detected drift can trigger a retraining pipeline automatically.
Which kind of drift?
From notebook to an automated pipeline
A data scientist built a successful pricing model in a notebook. Six months later nobody can reproduce it, and its accuracy has fallen. The team rebuilds the process with MLOps:
| Problem | MLOps practice | AWS service |
|---|---|---|
| Nobody knows which data and settings produced the model | Experiment tracking | SageMaker AI with managed MLflow |
| Training is a series of manual notebook steps | An automated, repeatable pipeline | SageMaker Pipelines |
| Models go to production without review | Versioning and approval | SageMaker Model Registry |
| Falling accuracy was noticed by customers first | Monitoring with alerts | SageMaker Model Monitor and CloudWatch |
| Retraining is forgotten | Automatic retraining when drift is detected | Pipeline triggered by a Model Monitor alert |
The result is a loop: new data arrives, the pipeline retrains and evaluates the model, an approver promotes it in the registry, it is deployed, and monitoring decides when the next retraining is due.
What is model drift, and how is it handled?
Show answer
A fall in model quality because live data, or the relationships in it, change from what the model was trained on. It is found by monitoring, for example with SageMaker Model Monitor, and fixed by retraining.
Exam Tips
Remember for the exam
- To automate and orchestrate ML workflows, use SageMaker Pipelines.
- To version models and manage approvals, use the SageMaker Model Registry.
- To track and compare experiments, use SageMaker AI with MLflow.
- To detect data, quality or bias drift in production, use SageMaker Model Monitor.
- When drift is detected, retrain the model with recent data.