AI Model Drift in Machine Learning

Usman Ali

0 Comment

Blog

We discuss a regrettable but inevitable aspect of machine learning (ML) models: their relatively limited lifespans. For ML engineers, this is old news. Business executives, however, who are spending millions on their companies’ AI capabilities, are taken aback by the issue. In the laboratory, where conditions are strictly regulated, models often function effectively.

But as soon as they begin processing real-world data, their performance deteriorates. Some models might produce fantastic inferences early on, but in the weeks that follow deployment, the quality might start to decline. Some AI models might not work completely. In every scenario, model drift is prevalent.

91% of machine learning models deteriorate with time, according to Scientific Reports.

What is happening?

How can a piece of technology that is key to the financial, defense, medical, and other industries just stop working?

Above everything, what actionable steps may be taken?

Let’s delve deeper into the realm of data science and examine AI model drift, the significant: yet least discussed is the issue in the field of artificial intelligence. When incoming data in production diverges from the distribution of data used to train an AI model, this phenomenon is known as model drift.

To avoid AI detection, use Undetectable AI. It can do it in a single click.

AI Model Drift

AI Model Drift

Model drift is the term used to characterize an ML model’s propensity to lose predictive power over time. Model degradation or decay are other names for it. It involves a typical machine learning operations (MLOps) procedure:

  • You construct a model.
  • You start producing that model.
  • You are left to handle the fallout when the model breaks.

Any company with over a few AI models in production would frequently encounter the AI model drift. But it is frequently disregarded. Temporal Quality Degradation in AI Models, a Scientific Reports article by Daniel Vela and colleagues, states that temporal model degradation is an almost unknown, yet critical property of machine learning models, key to our understanding of AI and its applications.

Even when AI models are initially implemented with accuracy to obtain data from processes that appear steady, they are not static.

What Causes ML Models to Break During Production?

What Causes ML Models to Break During Production?

Surprising as it might seem, AI models that perform effectively during evaluation or even in production today may cease to function at some time in the next few days or weeks.

Why?

It is simple to respond to: Things change. The world is dynamic, which is why models fail. Non-stationary refers to the statistical property that the data used to train a model differs from the data used in production. An algorithm is trained on historical data to produce machine learning models.

To determine patterns, they gather thousands, even millions, of data points, such as text, numbers, and image strings. These models perform effectively at matching fresh data to instances that are comparable to those in their training set.

However, models are often tested with scenarios in real life that do not resemble a collection of chosen data points, and even little deviations might have unfavorable effects. Consider a predictive maintenance program that has been tuned for a certain engine.

Perhaps we trained this model using production data from the same time frame when we initial deployed it in the summer. Now that winter has arrived, the engine’s data that feeds the model appears different from what it was trained on due to heat contraction in the parts or viscous lubricant.

One example would be engines. However, model drift is not exclusive to any one AI model or even class of models. It is a basic feature of machine learning. Not only does it affect predictive maintenance models that rely on structured data, but it also affects computer vision algorithms that search airfields for aircraft as summer turns into fall.

It occurs when Scottish investors have a meeting that is transcribed by a voice-to-text model that was trained on American accents. It occurs when one asks a sizable language model that was trained on data collected prior to 2020 to define rizz. AI models that are often used and popular are not immune to model drift.

A 2023 study by Stanford researchers revealed that OpenAI’s flagship GPT-4 saw a 95.2% decrease in accuracy over a few months for specific issues. Each time, the outcome is a machine learning model that uses real-world data to generate erroneous predictions, leaving it dangerous or even useless.

What Causes AI Model Drift?

What Causes AI Model Drift?

A model’s production data and training data may not align for a variety of reasons, including the unpredictability of world changes. The frequent reasons for model drift are: 

Natural Adaptations

Data varies in reaction to an AI model’s outputs. When a stock is being sold by other models, which lowers the stock’s price, a financial trading model sells the shares.

Adversarial Adaptations

An agent modifies its behavior to trick an AI model. To fool models that are attempting to detect them, an enemy air force affixes tires to their aircraft.

Use Case Differences

An AI model that performs effectively in one situation may not perform effectively in another. A model that monitors US-China interactions is unable to accurately understand US-Japan relations.

Time Sensitivities

When educated on data from previous eras, an AI model fails to recognize recent contextual changes. When applied to US-Japan ties today, a model designed to comprehend those connections in the 1940s is unable to yield meaningful conclusions.

Chaotic Interference

A downstream model gains inaccurate information when the settings of an upstream AI model are altered. When an embedding model is modified, the outputs of the model are used by a text classification model to erroneously label everything.

AI Aging

The mechanism through which stochastic differences in training can hasten degradation. Over time, an object detection model that is effective tends to become less accurate.

To What Extent Is AI Model Drift An Issue?

To What Extent Is AI Model Drift An Issue?

An ML model’s performance is directly destroyed by model drift. However, depending on how you use your ML model, the significance and urgency of this poor performance can differ considerably. A drifting model might nevertheless be sufficient in some circumstances. Consider the suggestion engine of a streaming service, for instance.

Should it recommend an unexpected television program due to a model misinterpreting your preferences, management might not have to worry about an Issue?

The output of the model is not necessary.

What if you are not interested in watching Suits?

Netflix queued up your subscription, so you are not planning to cancel it. In other situations, the results of a model are just applicable within a specific time frame. Whether the model’s prediction was accurate or not, it becomes irrelevant after that timeframe has passed.

In the case of autonomous vehicles, this is true. It does not matter the duration it takes the car to pass a tree if your model perceives it as a person. In this instance, a single incorrect conclusion is irrelevant. However, the issue is worse if the drift is significant enough that the AI model consistently recognizes trees as persons.

Of course, there are a ton of other possibilities in between those two situations, where model drift can have disastrous effects. If the model of a financial system that executes high-speed trades drifts, millions of dollars could be lost quickly. Drift in a model used for cancer screenings may lead to an incorrect tumor identification, which could be fatal.

When AI models used for intelligence and military applications are unable to differentiate between friendly and enemy aircraft, they become instantly useless in combat. Any of these situations should immediately trigger a red alert if a model fails.

Model drift occurs too often for extended periods of time before someone detects an issue. Organizations may have already taken significant operational or business decisions based on faulty insights by the time someone can step in.

How Do You Know If an AI Model Is Not Working Correctly Anymore?

How Do You Know If an AI Model Is Not Working Correctly Anymore?

Data scientists often have useful heuristics that indicate whether a model has wandered. They can tell when a model is not functioning as it should because of their experience working with models in production.

When a data team has hundreds or thousands of AI models in production, this sense becomes impractical and unquantifiable. Data scientists require precise methods in these cases to identify model drift. We assess if drift is happening using two statistical techniques.

They are the Cramer-von Mises test and the Kolmogorov-Smirnov test. When determining whether a dataset is out of distribution with respect to the training data for a model, these two tests are often used statistical methods.

Kolmogorov-Smirnov Test

The Kolmogorov-Smirnov test compares a dataset’s distribution to a theoretical distribution in order to determine its outcome. It finds the largest discrepancy between the empirical CDF and the data’s cumulative distribution function.

This test is less sensitive to extremes at the tails and concentrated on the center of distribution. It is a straightforward and adaptable test that works with a range of data distributions because it is non-parametric, meaning it lacks any assumptions about the underlying data.

Cramer-Von Mises Test

The Cramer-von Mises test evaluates the goodness of fit between two data distributions, similar to how the Kolmogorov-Smirnov test does. The Cramer-von Mises test, however, examines the sum of the squares of the differences in the CDFs rather than comparing the projected CDF with an empirical CDF.

It is successful in capturing variation throughout the entire distribution because it includes the entire distribution both the center and the tails. 

While they differ, the Kolmogorov-Smirnov and Cramer-von Mises tests are both useful methods for determining whether production data in a model is not distributed according to the model’s training set. Using both of them seems to provide sense for a comprehensive understanding of drift detection and data dispersion.

How Can AI Model Drift Be Addressed?

How Can AI Model Drift Be Addressed?

There is limited that data scientists and machine learning engineers can do to stop AI model drift. The cycle of build, deploy, fail, resulting in rise to a AI model drift Problem, does not end despite the recent tremendous expansion of AI capabilities. But not every aspect of the news is miserable.

Data teams can take action to lessen the consequences of model drift and increase the productive uptime of models, even though they cannot completely prevent it from occurring. We call this procedure model remediation.

Models become candidates for repair if drift is identified through automated monitoring that examines incoming data using the previously described Kolmogorov-Smirnov and/or Cramer-Von Mises techniques.

In order to update an AI model and bring it back into production, model remediation entails initial confirming that the model has strayed and then quickly retraining it. Remedialization occurs far faster than taking a failing model out of production and training a whole new one in its place.

On average, it restores performance in a matter of hours by using a baseline model and refining it with relevant data, as opposed to the days, weeks, or months that are sometimes required to create a new model from scratch.

Conclusion: AI Model Drift

AI Model drift is an unavoidable reality for businesses that use machine learning. Machine learning models in the actual world immediately start to consume material that looks different from their training data since the world is continually changing.

The performance of the model might be severely impacted when this data goes out of distribution, in particular vital applications such as defense and medical. There are ways to address the issues caused by model drift.

AI models that are having trouble performing can be easily retrained through model remediation, allowing them to resume production. Data teams can mitigate the consequences of model drift and maintain the long-term performance of their models in production by recognizing drift and initiating model rehabilitation procedure afterwards.

FAQs: AI Model Drift

What is AI Model Drift?

AI Model Drift refers to the phenomenon where the performance of a machine learning model degrades over time due to changes in the underlying data distributions. As new data becomes available, it may not resemble the training data used to develop the model, leading to a decrease in accuracy and reliability.

This drift can be categorized into two main types: data drift, which involves changes in the data used for predictions, and concept drift, which refers to changes in the relationship between the input data and the target variable.

What causes model drift?

Model drift can be caused by several factors, including changes in the external environment, shifts in user behavior, seasonal variations, or the introduction of new features in the data pipeline.

For instance, if a machine learning model is trained to predict sales based on historical data, any sudden changes in consumer behavior or economic conditions can lead to drift. When the input data distribution changes over time, it can lead to model performance decline.

How can drift detection be performed?

Detecting model drift involves monitoring the performance of the model in production and comparing it with the expected performance based on historical data.

Various statistical techniques can be employed for drift detection, such as the Kolmogorov-Smirnov test, Chi-Squared test, or monitoring metrics such as the accuracy and precision. Machine learning techniques can be used to analyze the distribution of the input data over time, helping to identify if drift occurs.

What are the types of model drift?

There are mainly two types of model drift: data drift and concept drift. Data drift refers to changes in the statistical properties of the input data, while concept drift signifies shifts in the relationship between the input data and the target variable.

Understanding these types is necessary for data scientists to implement appropriate strategies for managing model drift.

Post Comments:

Leave a comment

Your email address will not be published. Required fields are marked *