Abstract
In the last couple of years we have witnessed an enormous increase of machine learning (ML) applications. More and more program functions are no longer written in code, but learnt from a huge amount of data samples using an ML algorithm. However, what is often overlooked is the complexity of managing the resulting ML models as well as bringing these into a real production system. In software engineering, we have spent decades on developing tools and methodologies to create, manage and assemble complex software modules. We present an overview of current techniques to manage complex software, and how this applies to ML models.
Introduction: The Industrialization Gap
While the "magic" of machine learning happens during the training phase, the actual "drudgery" occurs during industrialization. Data scientists typically focus on optimizing hyperparameters and model architectures, but software engineers often struggle to integrate the resulting artifacts into robust, scalable production systems.
The core issue is a form of hidden technical debt. Unlike traditional software, ML models possess subtle, implicit dependencies on the data used for training. For instance, a model trained on 28x28 pixel images requires specific pre-processing "plumbing" to handle high-resolution input streams. If these dependencies are not explicitly managed, the system may not crash, but it will produce silent failures—producing "gibberish" results that are difficult to debug. Currently, managing these dependencies is a manual, error-prone process of writing fragile "glue code."
Applying Software Modularity to ML
To address these challenges, we propose applying established principles of software modularity to machine learning. Specifically, we look toward the OSGi (Open Service Gateway initiative) framework. Traditional modularity often relies on direct dependencies (e.g., Module A depends on Module B), which can lead to rigid "pipeline jungles."
In contrast, the OSGi approach decouples modules by treating them as "Resources" that define what they provide (Capabilities) and what they need (Requirements) using a shared namespace.
By reifying the API of a model—making its requirements (such as GPU access or specific math libraries) and capabilities (input/output specifications) explicit and machine-readable—we can automate the integration process.
Prototype and Implementation
We developed a prototype where neural networks are packaged as first-class software artifacts (specifically .jar files). These packages include metadata describing:
- Input Specifications: e.g.,
input.width:Long=28. - Output Specifications: e.g.,
output.type=digit. - Training Context: Metadata regarding the dataset used (e.g., MNIST or SVHN).
Using an automated "Resolver," a production system can declare its high-level requirements. For example, a system might request: "I need a model that classifies digits and accepts images at least 28x28 pixels large." The Resolver then automatically identifies and assembles the compatible model along with its necessary software dependencies, ensuring a verifiable deployment.
Key Insights
Our research highlights several critical shifts in perspective required for modern ML engineering:
- ML Models are Software: Models should not be treated as static data files but as software artifacts with lifecycles and runtime requirements.
- Data is a Functional Dependency: If the training data changes, the effective "API" of the model changes, even if the underlying code remains identical.
- Limitations of Semantic Versioning: Standard SemVer (Major.Minor.Patch) is insufficient for capturing the nuances of model performance or data compatibility.
Conclusion and Future Work
The primary result of this work is a proof-of-concept metadata schema that enables automated assembly of ML systems. By expressing complex requirements as formal filter strings, we can verify compatibility at deployment time, preventing silent failures.
However, implementing this model is an "uphill battle" requiring a cultural shift in data science toward explicit constraint definition. Future work will focus on formalizing metadata for millions of hyperparameters, handling the non-monotonic nature of ML errors, and developing tools to automatically generate metadata to minimize developer burden.
Summary updated