Skip to main content
QUICK REVIEW

[Paper Review] Did the Model Change? Efficiently Assessing Machine Learning API Shifts

Lingjiao Chen, Tracy Cai|arXiv (Cornell University)|Jul 29, 2021
Software Engineering ResearchComputer Science29 references8 citations
TL;DR

This paper proposes MA-SAM, a novel adaptive sampling algorithm to efficiently detect and quantify shifts in machine learning API predictions over time by estimating changes in the confusion matrix. By dynamically sampling data points based on uncertainty in predictions, MA-SAM reduces API call costs by up to 90% while achieving estimation errors an order of magnitude lower than uniform sampling, enabling cost-effective and precise monitoring of model drift in production systems.

ABSTRACT

Machine learning (ML) prediction APIs are increasingly widely used. An ML API can change over time due to model updates or retraining. This presents a key challenge in the usage of the API because it is often not clear to the user if and how the ML model has changed. Model shifts can affect downstream application performance and also create oversight issues (e.g. if consistency is desired). In this paper, we initiate a systematic investigation of ML API shifts. We first quantify the performance shifts from 2020 to 2021 of popular ML APIs from Google, Microsoft, Amazon, and others on a variety of datasets. We identified significant model shifts in 12 out of 36 cases we investigated. Interestingly, we found several datasets where the API's predictions became significantly worse over time. This motivated us to formulate the API shift assessment problem at a more fine-grained level as estimating how the API model's confusion matrix changes over time when the data distribution is constant. Monitoring confusion matrix shifts using standard random sampling can require a large number of samples, which is expensive as each API call costs a fee. We propose a principled adaptive sampling algorithm, MASA, to efficiently estimate confusion matrix shifts. MASA can accurately estimate the confusion matrix shifts in commercial ML APIs using up to 90% fewer samples compared to random sampling. This work establishes ML API shifts as an important problem to study and provides a cost-effective approach to monitor such shifts.

Motivation & Objective

  • To identify and quantify significant performance shifts in third-party ML APIs over time, which often go unnoticed despite impacting downstream applications.
  • To address the high cost of monitoring ML API performance via standard random sampling, which requires large numbers of expensive API calls.
  • To develop a lightweight, adaptive sampling strategy that maintains high estimation accuracy while drastically reducing computational and financial costs.
  • To provide a practical, cost-effective solution for production teams to monitor model drift in real-world ML APIs without sacrificing precision.
  • To formalize API shift detection as a confusion matrix change estimation problem under a fixed sample budget.

Proposed method

  • MA-SAM uses adaptive sampling to prioritize data points that are most informative for estimating confusion matrix shifts, focusing on uncertain or high-impact predictions.
  • It clusters the dataset and adaptively samples from each cluster based on the uncertainty of the model's prediction, reducing variance in shift estimation.
  • The algorithm automatically tunes its sampling rate per cluster using a confidence-bound approach to balance accuracy and cost.
  • It employs a super-sampling strategy on high-uncertainty regions to improve estimation precision where shifts are most likely to occur.
  • MA-SAM leverages a theoretical upper bound on estimation error to ensure reliable performance under sample size constraints.
  • The method is designed to be lightweight and compatible with real-world ML APIs, requiring minimal changes to existing monitoring pipelines.

Experimental results

Research questions

  • RQ1How frequently do ML APIs undergo significant performance shifts over time, and how do these shifts affect downstream applications?
  • RQ2What is the cost of monitoring model shifts using standard uniform sampling, and can this be reduced without sacrificing accuracy?
  • RQ3Can an adaptive sampling strategy outperform uniform sampling in estimating confusion matrix shifts with fewer API calls?
  • RQ4How does the estimation error of adaptive sampling compare to uniform sampling under the same sample budget?
  • RQ5To what extent can adaptive sampling reduce the number of required API calls while maintaining acceptable estimation error for model shift detection?

Key findings

  • The study identified significant model shifts in 12 out of 36 ML API and dataset combinations between 2020 and 2021, with performance drops exceeding 1% in several cases.
  • In one case, IBM's speech recognition API experienced a 7% drop in overall accuracy from March 2020 to March 2021, primarily due to misclassifying 'four' as 'five'.
  • MA-SAM reduced the required number of API calls by up to 90% compared to uniform sampling while achieving estimation errors an order of magnitude smaller.
  • On average, MA-SAM achieved estimation errors one to two orders of magnitude lower than uniform sampling for the same sample size.
  • For a given budget, MA-SAM reduced estimation error by more than 50% in most real-world APIs tested, including those from Google, Microsoft, and Amazon.
  • The method maintained high reliability and low computational cost, making it suitable for continuous monitoring in production environments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.