Skip to content

Cookies

We use cookies to enhance your experience. Learn more

ResearchPublication

Model monitoring

Earlier work, a post written in 2021 by Theofilos Papapanagiotou of Prosus. It sets out what to measure in machine learning models that serve, and the tools to do it with, from latency and model loading to payload logs, data drift and explainers.

A long cream strip across green paper with a row of ten small squares along it. The first seven sit just above the strip, in cream; the last three, in yellow, rise away from it one after another.

Where this comes from

This is a post on the Prosus AI Tech Blog, written by Theofilos Papapanagiotou and published on 31 December 2021. It follows an earlier post of the blog on the technical capabilities of a machine learning platform, and it is about MLOps, the practice of running models in production. It is listed here as earlier published work from Prosus’s AI team. What follows is from the post.

What the post asks

Models degrade over time, and Prosus uses MLOps practices across its businesses to deal with it. From DevOps, MLOps took the habit of improving monitoring all the time. The post sets out the metrics that keep a model’s performance, and so its impact, constant over time, and lists tools to put them to work.

Monitoring closes the circle of the workflow: it connects a model in service with the next runs of the pipeline that trains it again. Experienced practitioners keep at it to hold the quality of results, above all where the data does not stay the same. The post puts it in a Dutch saying, “Meten is weten”, measuring things brings knowledge.

Service metrics

These are the metrics any operator of an application tracks, here for the service that answers a model’s requests, broken down by model and model version over time.

  • Latency, or response time, is how fast a request is served, in milliseconds, and a measure of the user’s experience. It grows with a model’s number of parameters. Running the multiplication on a GPU and quantizing the model help, and a component that transforms or enriches the input can be scaled apart from the predictor.
  • Success rate, or availability, is the share of requests that succeed, weighed against the cost of running the service. Timeouts anywhere along the way, from the load balancer to the model server, make requests fail, and input changes over time, so that new requests can be outliers for an older model: checking each request against the expected types and ranges of the data helps.
  • Invocations, the requests per second, reflect how much the business uses the model. They are tracked to inform decisions about scaling.

Tracing one prediction across the data transformer, the online feature store and the model server is a strong way to find the cause of a problem. The tools the post names are Prometheus, Grafana, Jaeger and Kiali.

Model server metrics

A model file can be a few bytes or tens of gigabytes, and a model server copies its graph and weights into memory, and onto a GPU if there is one. The post names four metrics: the model load time for that copy, which can take many seconds; the warmup latency of a model loaded lazily and warmed up with a few requests, which decides how fast the system can scale out; the graph runtime of the forward pass; and the GPU memory allocation of each server, since several servers can share a GPU’s memory. Since model servers usually run as microservices, the post advises exposing these as histograms, preferably in Prometheus buckets.

Payload logging

Every request and response a model handles is new knowledge, and the post asks for it to be logged and kept. The logs make new training sets, show what the model predicts and help explain its behavior, and they feed the monitoring that follows. Each payload travels as an event, through brokers, to processors that compute statistics of the incoming data and compare its distribution with older ones. The distance between them measures drift and can start a retraining job: the post names Shannon divergence for numerical features and L-infinity distance for categorical ones. The tools it names are Cloudevents, OpenSearch and Knative-eventing.

Data validation and drift detection

A data validation component has a part in each phase of the pipeline.

  1. Training

    It writes the schema of the data a model version was trained on, the features’ statistics, distributions, types and ranges, and stores it with that version in the metadata store.

  2. Serving

    The inference service’s transformer uses the schema to check whether a request falls within the ranges of the training data, and answers accordingly.

  3. After serving

    It collects windows of the data the model has seen and checks whether their distribution is still like the training data’s, which is how skew between training and serving is detected.

The tools the post names are TFDV, great expectations, deequ and alibi-detect.

Trustworthy AI

The last part is about explainers: components that run as microservices beside the model and watch for explainability, fairness and robustness against attacks. The post calls the three the holy trinity for handling the coming EU rules on AI ethics, and sees them as a chance for a business to build its users’ trust.

  • Explainability has algorithms for different kinds of data and questions, with faithfulness and monotonicity as proxy metrics. An anchor model can report which features mattered for tabular data, or highlight the region of an image a decision used.
  • Fairness has algorithms to reduce bias in data and models, and metrics such as disparate impact, group fairness from selection and error rates, the generalized entropy index, differential fairness and bias amplification.
  • Robustness covers attacks of evasion, poisoning, extraction and inference, with metrics such as empirical robustness, loss sensitivity, CLEVER and Wasserstein distance.

The tools the post names are AIX360, AIF360, the Adversarial Robustness Toolbox and Alibi.

What it concludes

The post calls these metrics the elegant approach to running models in production, and a continuous effort of improvement for practitioners who want to operate well. How widely they are used, it says, mirrors how mature MLOps is in the group, and its readiness to use AI to create value for the business.

The post

Model monitoringTheofilos Papapanagiotou. Prosus AI Tech Blog, 2021

Author

  • Theofilos Papapanagiotou

References

  1. Model monitoringTheofilos Papapanagiotou. Prosus AI Tech Blog, Medium, 31 December 2021
  2. Model monitoringProsus, 31 December 2021

Keep reading

  • Publication

    One model for the whole home page

    A shopping app’s home page is filled by many recommenders, each tuned for its own slot. This model writes one page per person, per meal moment: the title, the subtitle and what to show. In a live test on one slot it brought 137% more orders from that list.

  • Publication

    New robots, old tricks: teaching robots to speak AI

    A post of November 2026 on a year of wiring Darwin, the Prosus humanoid robot. Five parts spoke five protocols, and the post asks what a robot should tell an AI agent about its actions before the agent can use it.

  • Method

    Meet the large commerce model

    Language models learn from text. Magnet Decision learns from what people search for, look at, buy and come back for. Here’s how it’s built.