Cost Effective MLaaS Federation: A Combinatorial Reinforcement Learning Approach

Shuzhao Xie, Yuan Xue, Yifei Zhu, Zhi Wang

Abstract

Machine Learning as a Service (MLaaS) platforms like AWS, Azure, and Google Cloud offer powerful object detection capabilities, yet their performance varies significantly across different object categories and environmental conditions. While federating multiple providers can improve accuracy, it often leads to prohibitive costs and "ensemble noise." This paper introduces Armol, a framework that utilizes combinatorial reinforcement learning to intelligently select the optimal subset of MLaaS providers for a given image. By balancing accuracy and cost, Armol achieves the performance of a full ensemble while reducing inference costs by 67%.

Introduction

Machine Learning as a Service (MLaaS) has democratized access to sophisticated AI tools via simple APIs. However, these services are essentially "black boxes" with proprietary training data and varying strengths. Research indicates that no single provider dominates across all object categories; for instance, AWS might excel at detecting people, while Azure might significantly outperform it when identifying smaller objects like bottles.

To achieve the highest possible accuracy, users can "federate" these services by sending the same image to multiple providers and merging the results. However, this approach faces three major challenges:

  1. Vocabulary Mismatch: Different providers use different labels for the same object (e.g., "motorbike" vs. "motorcycle").
  2. Combinatorial Explosion: With $N$ providers, there are $2^N - 1$ possible combinations. As $N$ grows, finding the optimal subset for every image becomes computationally difficult.
  3. Diminishing Returns: Naively aggregating every provider is not only expensive but can actually lower accuracy by introducing false positives.

The Armol Framework

The authors propose Armol, a three-part framework designed to navigate these challenges through intelligent selection and aggregation.

Word Grouping

To resolve vocabulary discrepancies, Armol employs a word-grouping algorithm. By utilizing WordNet synonyms and manual mapping, the system unifies disparate provider labels into a standardized format, such as the COCO dataset categories, ensuring that the ensemble logic operates on a consistent taxonomy.

Combinatorial RL for Provider Selection

The core of Armol is a Soft Actor-Critic (SAC) reinforcement learning agent. This agent acts as the "brain" of the system, deciding which providers to query for a specific image. To handle the massive number of possible provider combinations, the authors map a continuous "proto-action" space to a discrete binary vector (representing which providers to activate) using a nearest-neighbor approach. The reward function is specifically designed to balance mean Average Precision (mAP) against the monetary cost of API calls.

Ensemble Strategy

Once predictions are received from the selected subset, Armol uses an "Affirmative" voting strategy—retaining a detection if any selected provider finds it—and Weighted Box Fusion (WBF). Unlike standard Non-Maximum Suppression (NMS), which simply selects the single "best" bounding box, WBF averages the coordinates of overlapping boxes to produce a more precise final localization.

Experimental Evaluation

The researchers evaluated Armol using the COCO Val 2017 benchmark and real-world outputs from AWS Rekognition, Microsoft Azure Computer Vision, and Google Cloud Vision AI. To test scalability, they also utilized a synthetic benchmark simulating 10 different MLaaS providers (creating 1,023 possible action choices).

Key Results

  • Cost Efficiency: Armol achieved the same accuracy as an ensemble of all available providers while realizing a 67% reduction in cost.
  • Accuracy Gains: Compared to using only the single best-performing provider (AWS), the federated approach significantly improved mAP.
  • Superiority over Baselines: Armol outperformed other RL methods, such as PPO (Proximal Policy Optimization) and TD3 (Twin Delayed DDPG), in both convergence speed and the final accuracy-to-cost ratio.
  • Scalability: In the 10-provider simulation, the RL agent successfully navigated the 1,023 possible combinations to find high-performing subsets, proving the system can scale as the MLaaS market expands.

Discussion and Insights

The most striking insight from this research is the "Sweet Spot" phenomenon: providers have specialized expertise because they are trained on different proprietary datasets. Federation is not merely about redundancy; it is about expertise-sharing. However, the authors also found that adding too many providers can introduce noise, justifying the need for an intelligent selector rather than a "use everything" approach.

Limitations and Future Work

While Armol is highly effective for object detection, the Word Grouping and Ensemble components would require redesigning for NLP or speech-to-text tasks. Additionally, training the RL agent ideally requires ground truth labels. While the authors suggest using the full ensemble's output as a "proxy" ground truth for unlabeled data, this could potentially propagate existing errors. Finally, the overhead of querying multiple providers may introduce latency concerns for ultra-real-time applications.

Conclusion

Armol demonstrates that intelligent federation is a viable path toward cost-effective, high-accuracy machine learning. By treating provider selection as a combinatorial problem solved through reinforcement learning, it leverages the specialized expertise of various MLaaS platforms while avoiding the pitfalls of naive aggregation.

Summary updated

BibTeX
@inproceedings{xie2022cost,
  author = {Shuzhao Xie and Yuan Xue and Yifei Zhu and Zhi Wang},
  title = {{Cost Effective MLaaS Federation: A Combinatorial Reinforcement Learning Approach}},
  booktitle = {INFOCOM},
  year = {2022},
  url = {https://openreview.net/forum?id=tGBHExh1Ko},
}
Figure