MDINFERENCE: Balancing Inference Accuracy and Latency for Mobile Applications

Samuel S. Ogden, Tian Guo

Abstract

Deep Neural Networks (DNNs) enable sophisticated features on mobile devices, yet their computational demands create a conflict between inference accuracy and latency. MDInference is a holistic framework designed to resolve this "tug-of-war" by combining network-aware probabilistic cloud model selection with simultaneous on-device execution. This approach ensures that applications meet strict response-time guarantees while maximizing accuracy, achieving over 40% higher aggregate accuracy compared to traditional static methods.

Introduction

Mobile developers currently navigate a difficult landscape when deploying DNNs. On-device inference offers predictable latency but is restricted to low-accuracy models due to hardware constraints. Conversely, cloud-based inference provides access to state-of-the-art models but suffers from unpredictable network jitter, often leading to missed Service Level Agreements (SLAs). Hybrid approaches, which split models between the device and the cloud, frequently inherit the drawbacks of both. MDInference addresses these challenges by treating model selection as a dynamic, network-responsive problem rather than a static one.

Methodology: The MDInference Framework

MDInference optimizes the inference process through two primary mechanisms: probabilistic model selection and request duplication.

Comparison of inference paradigms: (a) On-device, (b) In-cloud, (c) Hybrid, and (d) MDInference.

Probabilistic Model Selection

Rather than relying on a single cloud model, MDInference dynamically selects the optimal model based on real-time network conditions. The selection process involves three stages:

  1. Baseline Selection: Identifying the most accurate model likely to complete within the remaining time budget ($T_{budget} = T_{sla} - T_{network}$).
  2. Exploration: Defining an "eligible set" of models with similar performance profiles to account for network variance.
  3. Opportunistic Selection: Utilizing a utility function to choose a model that maximizes accuracy while managing the risk of SLA violations.

Request Duplication

To guarantee SLA compliance despite sudden network degradation, MDInference employs request duplication. It sends the inference request to the cloud while simultaneously running a high-speed, lower-accuracy model locally. If the cloud result is delayed beyond the SLA threshold, the system falls back to the local result, ensuring a timely response for the user.

Experimental Evaluation

The framework was evaluated using 21 pretrained CNNs (e.g., MobileNet, Inception, ResNet) on the ILSVRC 2012 (ImageNet) dataset. Testing involved an AWS p2.xlarge GPU instance for cloud tasks and three mobile devices: the Nexus 5, Moto X4, and Pixel 2.

Model accuracy vs. total inference latency across different mobile devices.

Key Results

  • Accuracy Improvements: MDInference increased aggregate accuracy by over 40% compared to static "greedy" selection methods.
  • SLA Reliability: The system met a 250ms latency target in 99.74% of cases on university WiFi and 96.84% on residential networks.
  • Latency Reduction: Average end-to-end latency was reduced by up to 43% compared to static approaches, without sacrificing accuracy.

Discussion and Future Work

MDInference demonstrates that network variability can be leveraged as an opportunity for "upgrading" requests to higher-accuracy models when conditions allow. The "safety net" provided by local execution ensures 100% responsiveness with minimal overhead, as local models often complete in under 50ms.

Future research will focus on optimizing energy consumption by determining when request duplication is strictly necessary. Additionally, the authors aim to explore dynamic selection of the on-device fallback model to better suit specific mobile hardware and to automate the identification of optimal model subsets for diverse tasks.

Summary updated

Abstract

Deep Neural Networks are allowing mobile devices to incorporate a wide range of features into user applications. However, the computational complexity of these models makes it difficult to run them effectively on resource-constrained mobile devices. Prior work approached the problem of supporting deep learning in mobile applications by either decreasing model complexity or utilizing powerful cloud servers. These approaches each only focus on a single aspect of mobile inference and thus they often sacrifice overall performance.In this work we introduce a holistic approach to designing mobile deep inference frameworks. We first identify the key goals of accuracy and latency for mobile deep inference and the conditions that must be met to achieve them. We demonstrate our holistic approach through the design of a hypothetical framework called MDINFERENCE. This framework leverages two complementary techniques; a model selection algorithm that chooses from a set of cloud-based deep learning models to improve inference accuracy and an on-device request duplication mechanism to bound latency. Through empirically-driven simulations we show that MDINFERENCE improves aggregate accuracy over static approaches by over 40% without incurring SLA violations. Additionally, we show that with a target latency of 250ms, MDINFERENCE increased the aggregate accuracy in 99.74% cases on faster university networks and 96.84% cases on residential networks.
BibTeX
@inproceedings{ogden2020mdinference,
  author = {Samuel S. Ogden and Tian Guo},
  title = {{MDINFERENCE: Balancing Inference Accuracy and Latency for Mobile Applications}},
  booktitle = {IC2E},
  year = {2020},
  url = {https://openreview.net/forum?id=Vmc_L2rr-CY},
}
Figure