Journal Article
Large Language Models

EdgeShard: Efficient LLM Inference via Collaborative Edge Computing

Mingjin Zhang(Hong Kong Polytechnic University), Xiaoming Shen(Hong Kong Polytechnic University), Jiannong Cao(Hong Kong Polytechnic University), Zeyang Cui(Hong Kong Polytechnic University), Shan Jiang(Hong Kong Polytechnic University)
December 31, 2024IEEE Internet of Things Journal226 citations

226

Citations

0

Influential Citations

IEEE Internet of Things Journal

Venue

2024

Year

Abstract

Large language models (LLMs) have shown great success in content generation and intelligent intelligent decision making for IoT systems. Traditionally, LLMs are deployed on the cloud, incurring prolonged latency, high bandwidth costs, and privacy concerns. More recently, edge computing has been considered promising in addressing such concerns because the edge devices are closer to data sources. However, edge devices are cursed by their limited resources and can hardly afford LLMs. Existing studies address such a limitation by offloading heavy workloads from edge to cloud or compressing LLMs via model quantization. These methods either still rely heavily on the remote cloud or suffer substantial accuracy loss. This work is the first to deploy LLMs on a collaborative edge computing environment, in which edge devices and cloud servers share resources and collaborate to infer LLMs with high efficiency and no accuracy loss. We design EdgeShard, a novel approach to partition a computation-intensive LLM into affordable shards and deploy them on distributed devices. The partition and distribution are nontrivial, considering device heterogeneity, bandwidth limitations, and model complexity. To this end, we formulate an adaptive joint device selection and model partition problem and design an efficient dynamic programming algorithm to optimize the inference latency and throughput. Extensive experiments of the popular Llama2 serial models on a real-world testbed reveal that EdgeShard achieves up to 50% latency reduction and$2 \times $throughput improvement over the state-of-the-art.

Analysis

Why This Paper Matters

Large language models (LLMs) have become central to content generation and intelligent decision-making in IoT systems, but their deployment typically relies on cloud infrastructure, which introduces prolonged latency, high bandwidth costs, and privacy risks. Edge computing promises to mitigate these issues by moving computation closer to data sources, yet edge devices often lack the resources to host LLMs. Existing solutions either offload workloads back to the cloud or compress models via quantization, but these approaches either retain cloud dependence or sacrifice accuracy. EdgeShard addresses this gap by being the first to deploy LLMs in a collaborative edge computing environment where edge devices and cloud servers share resources to infer LLMs efficiently and without accuracy loss.

This work is significant because it challenges the binary choice between cloud-only and edge-only inference. By enabling collaborative inference across heterogeneous devices, EdgeShard opens a path for deploying LLMs in latency-sensitive and privacy-conscious applications, such as smart homes, industrial IoT, and autonomous systems, where cloud round-trips are impractical. The paper's focus on joint device selection and model partitioning also highlights the importance of system-level optimization for LLM inference, an area often overshadowed by model-centric advances.

Technical Contributions

  • Collaborative edge inference framework: EdgeShard partitions a computation-intensive LLM into affordable shards and deploys them across distributed edge devices and cloud servers, enabling resource sharing and collaboration.
  • Joint optimization formulation: The paper formulates an adaptive joint device selection and model partition problem that accounts for device heterogeneity, bandwidth limitations, and model complexity.
  • Dynamic programming algorithm: An efficient dynamic programming algorithm solves the joint optimization problem to minimize inference latency and maximize throughput.
  • No accuracy loss: Unlike quantization-based approaches, EdgeShard preserves model accuracy by distributing the full model rather than compressing it.

Results

Experiments on Llama2 serial models using a real-world testbed demonstrate that EdgeShard achieves up to 50% latency reduction and 2× throughput improvement over state-of-the-art methods. These gains are realized without any accuracy loss, underscoring the effectiveness of the collaborative partitioning approach. The results validate the dynamic programming algorithm's ability to adapt to device heterogeneity and bandwidth constraints in practical edge environments.

Significance

EdgeShard's significance lies in its potential to democratize LLM deployment at the edge, reducing reliance on cloud infrastructure and enabling real-time, privacy-preserving AI applications. By showing that collaborative edge computing can match cloud-level efficiency without accuracy degradation, the paper paves the way for broader adoption of LLMs in IoT and edge scenarios. Its joint optimization framework and dynamic programming solution also provide a template for future research on distributed LLM inference across heterogeneous resources.