MLOps

MLOps: Foundations

Sammer Puran
3 min readDec 21, 2023

What is MLOps

The word MLOps is a compound derived from Machine Learning and DevOps. As a practice DevOps aims to integrate and automate the work of Software Development and Operations to shorten the development lifecycle. With that said, there is a bit of difference between MLOps and DevOps

What differentiates MLOps from DevOps

The source of the difference between MLOps and DevOps is in the way that traditional programs work versus how machine learning works, which is summarized in the following picture

Difference ML and traditonal software: source (https://ml4devs.substack.com/p/011-machine-learning-vs-traditional-software-development)

Traditional programs only have to deal with a program that takes an input some logic and generates and output, whereas for ML you have a training that generates a model which is used by some software to run predictions on some data. In traditional software development you have to deal with the lifecycle and improvement of the software whereas in Machine Learning there is the added lifecycle of the model. This can be summarised in this picture

MLOPs Lifecycle

But wait a minute you might say: why is there a model lifecycle? In uni we trained the model once and used the model to run predictions and it worked.

Train once and then use the model forever: why that does not work?

Let’s think of a concrete example that you might encounter in real life when deploying machine learning models. Say that we are working for a company that has a customer service who receive a lot of mails. Since there are different agents who have specialised knowledge about certain products, not all agents can answer all mails. So currently some people in the customer center just manually route the mail to the right agents, so they can answer the questions.

You are now tasked to write a ML solution that can classify these mails automatically in products and automate the routing. Great, you take a dump of all the mails and their classes (we assume we get them from the customer service), develop a simple classification model, test them and since you are happy with the results you show it to the client. Since they are also happy you agree to deploy this model and let it work. Suddenly after several months the client discovers, that the mails are getting wrongly classified much more than before and has to manually reroute them.

So what went wrong? There could be many reasons, there could be a change on how people write mails, to a rebranding and renaming of products or some other things. In my case what happened is, that the product team decided to merge certain products or rename them so the labels from the beginning were not valid anymore. That means, there was a change in input data that was not present at the start and that the model was not trained on. So it means that we need a mechanism to retrain the model, have a new model version that then can be used for inference. Thats why we need a model lifecycle

With the motivation out of the way, we can explore the technical components of MLOps: https://medium.com/@samipuran/mlops-technical-overview-and-components-0a63bea5e4ba

--

--

Sammer Puran

I am a MLOps specialist/Data scientist working for the swiss national television. My experience in the data science realm is 5 years.