Introduction
Ensemble learning is a powerful technique for improving the accuracy of machine learning models by combining predictions from multiple sources. However, deploying ensembles in production environments, particularly in the public cloud, often incurs a significant "resource tax" in terms of cost and latency. Cocktail is a novel model-serving framework designed to bridge this gap, delivering the accuracy benefits of ensembling while maintaining the cost-efficiency and speed of single-model serving.
The Challenge of Cloud-Based Model Serving
In cloud-based machine learning (ML) deployments, developers face a persistent trade-off between accuracy, latency, and operational costs. While a single model might be fast, it may fail to meet strict Service Level Objectives (SLOs) for accuracy. Conversely, traditional ensemble methods—which run every available model for every request—are prohibitively expensive and introduce substantial latency due to over-provisioning and the "straggler" effect.
Existing frameworks often rely on static ensembles, leading to massive resource waste. Cocktail addresses these inefficiencies by dynamically optimizing the serving process across the entire cloud stack, from application-level SLOs down to hardware resource allocation.
The Cocktail Framework
Cocktail introduces a three-pronged optimization strategy to make ensemble serving viable:
- Dynamic Model Selection: Rather than employing a static ensemble, Cocktail utilizes a window-based policy to prune the ensemble at runtime. It identifies the minimal subset of models required to meet accuracy targets within latency constraints, dropping less accurate models when the system is over-performing.
- Class-based Weighted Majority Voting: Recognizing that models have varying expertise across different data classes, Cocktail tracks individual model performance. It employs a weight matrix to grant more "voting power" to expert models for specific input classes, improving tie-breaking and overall accuracy.
- Adaptive Resource Management:
- Proactive Autoscaling: Using a deep learning-based estimator called DeepARest, Cocktail forecasts traffic patterns to scale resources ahead of demand spikes.
- Importance Sampling: Resource pools for individual models are scaled based on their selection frequency by the dynamic policy.
- Spot Instance Exploitation: Cocktail leverages transient (Spot) VMs, which are significantly cheaper but subject to reclamation. The inherent fault tolerance of ensembles—where the loss of one model only slightly impacts the collective prediction—makes them ideal for such unreliable infrastructure.
Evaluation and Key Results
The framework was evaluated using standard benchmarks (ImageNet, CIFAR-100, SST-2) and real-world request traces from Wikipedia and Twitter.
The results demonstrate that Cocktail significantly outperforms existing solutions:
- Cost-Efficiency: Cocktail is up to 1.45× more cost-effective than InFaaS (a single-model selection framework) and 1.35× better than Clipper (a static ensemble framework).
- Latency Reduction: By avoiding the overhead of running unnecessary models, Cocktail achieves a 2× reduction in latency compared to traditional ensemble methods.
- SLO Compliance: The system successfully met accuracy targets for 96% of requests across diverse workloads.
- Robustness: Under simulated VM failures, Cocktail maintained accuracy within 0.6% of targets, validating its effectiveness on Spot instances.
Conclusion
Cocktail proves that ensemble learning can be deployed efficiently in the public cloud. By combining dynamic model selection with intelligent resource management and spot instance exploitation, it eliminates the traditional trade-offs between accuracy and cost. Future work will focus on decentralizing the selection process and automating offline profiling to support frequently updated models.
Summary updated