Continuous Integration of Machine Learning Models with ease.ml/ci: Towards a Rigorous Yet Practical Treatment

Cédric Renggli, Bojan Karlas, Bolin Ding, Feng Liu, Kevin Schawinski, Wentao Wu, Ce ZhangarXiv 2019

Introduction

In traditional software engineering, Continuous Integration (CI) is a foundational practice. Automated test suites run on every code commit to ensure that new changes do not break existing functionality. However, applying CI to machine learning (ML) presents a unique challenge. Unlike deterministic software, ML models are probabilistic. A developer cannot simply check if output == expected; instead, they must determine if a new model is statistically superior to a previous version (e.g., "Is this model at least 1% more accurate?").

To provide rigorous guarantees—ensuring a "Pass" signal isn't a statistical fluke—standard statistical bounds like Hoeffding’s inequality require massive amounts of labeled data. For a developer committing daily, providing tens of thousands of new labels for every test is impractical. Consequently, many teams rely on informal validation, sacrificing rigor for speed. ease.ml/ci bridges this gap, providing the first CI system designed specifically for ML that offers rigorous probabilistic guarantees while drastically reducing the required human labeling effort.

System Overview

ease.ml/ci treats ML models as first-class citizens within the CI pipeline. The system integrates directly with existing version control workflows, such as GitHub, to automate the testing of new model commits.

The ease.ml/ci workflow, illustrating how test scripts and datasets are integrated into a GitHub repository to provide rigorous pass/fail signals for ML models.

The workflow consists of four primary steps:

  1. Define Test Script: Users define test conditions using a Domain Specific Language (DSL). Variables include $n$ (new model accuracy), $o$ (old model accuracy), and $d$ (percentage of changed predictions). A typical condition might be n - o > 0.02 +/- 0.01, requiring the new model to be 2% better with a 1% error tolerance.
  2. Provide Test Examples: The user provides a pool of test data. A key technical contribution of ease.ml/ci is providing guidelines on how large this pool ($N$) needs to be to maintain rigor.
  3. Commit ML Code: When a new model or code is committed, the CI system triggers.
  4. Pass/Fail Signal: The system returns a pass/fail signal based on the $(\epsilon, \delta)$-reliability requirement, where $\epsilon$ is the error tolerance and $1-\delta$ is the probability that the test result is valid.

Achieving Practical Rigor

To make rigorous testing practical, ease.ml/ci employs several novel optimization techniques that reduce the labeling budget by up to two orders of magnitude.

Active Labeling and the "Agreement" Insight

The most significant optimization is Active Labeling. When comparing two models, the system only needs to label data points where the models disagree. If both models predict the same label for a given input, their relative accuracy on that point is zero, regardless of the true label. By focusing exclusively on the "disagreement zone," the system can achieve high statistical confidence with a fraction of the data. By utilizing Bennett’s inequality instead of Hoeffding’s when variance (disagreement) is low, the system maintains rigor with significantly fewer labels.

Handling Adaptivity

ML development is inherently adaptive; developers often tweak models based on previous test results. This can lead to "overfitting" to the test set, where a model passes not because it is better, but because it has been tuned to the specific test data. ease.ml/ci incorporates techniques inspired by the "Ladder" algorithm to manage "statistical power" as a finite resource, ensuring that reliability guarantees hold even when test sets are reused across multiple commits.

Hierarchical Testing

The system also employs hierarchical testing, using cheap, unlabeled data to determine if a new model is sufficiently different from the baseline to justify a full, labeled test. If the models are nearly identical in their predictions, the system can fail the commit early without consuming the labeling budget.

Experimental Results

The researchers validated ease.ml/ci using both synthetic (Infinite MNIST) and real-world (SemEval-2019 EmotionContext) datasets.

  • Label Reduction: For common test conditions, the optimized system required 10x to 100x fewer labels than baseline statistical approaches.
  • Practicality in Iteration: In a simulated scenario with 32 model commits, a baseline approach required approximately 156,000 labels to maintain 99.99% reliability. In contrast, the ease.ml/ci active labeling approach required only ~2,000 labels.
  • Real-world Performance: On the SemEval dataset, the system provided intuitive pass/fail signals that accurately reflected model improvements while staying within the constraints of a limited 5.5K sample test set.

Conclusion and Future Work

ease.ml/ci demonstrates that rigorous ML testing does not have to be prohibitively expensive. By combining a declarative DSL with clever statistical optimizations, it makes daily CI for machine learning a practical reality.

Future work aims to expand the system's capabilities beyond accuracy to other metrics like F1-score or AUC, which will require implementing different statistical tools such as McDiarmid’s inequality. Additionally, the authors plan to address "concept drift," developing mechanisms to alert users when the underlying data distribution has shifted enough to require a new test set entirely.

Summary updated

BibTeX
@misc{renggli2019continuous,
  author = {Cédric Renggli and Bojan Karlas and Bolin Ding and Feng Liu and Kevin Schawinski and Wentao Wu and Ce Zhang},
  title = {{Continuous Integration of Machine Learning Models with ease.ml/ci: Towards a Rigorous Yet Practical Treatment}},
  year = {2019},
  eprint = {1903.00278},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1903.00278},
}
Figure