Table of Contents
Fetching ...

A Pipelined Collaborative Speculative Decoding Framework for Efficient Edge-Cloud LLM Inference

Yida Zhang, Zhiyong Gao, Shuaibing Yue, Jie Li, Rui Wang

Abstract

Recent advancements and widespread adoption of Large Language Models (LLMs) in both industry and academia have catalyzed significant demand for LLM serving. However, traditional cloud services incur high costs, while on-device inference alone faces challenges due to limited resources. Edge-cloud collaboration emerges as a key research direction to combine the strengths of both paradigms, yet efficiently utilizing limited network bandwidth while fully leveraging and balancing the computational capabilities of edge devices and the cloud remains an open problem. To address these challenges, we propose Pipelined Collaborative Speculative Decoding Framework (PicoSpec), a novel, general-purpose, and training-free speculative decoding framework for LLM edge-cloud collaborative inference. We design an asynchronous pipeline that resolves the mutual waiting problem inherent in vanilla speculative decoding within edge collaboration scenarios, which concurrently executes a Small Language Model (SLM) on the edge device and a LLM in the cloud. Meanwhile, to mitigate the significant communication latency caused by transmitting vocabulary distributions, we introduce separate rejection sampling with sparse compression, which completes the rejection sampling with only a one-time cost of transmitting the compressed vocabulary. Experimental results demonstrate that our solution outperforms baseline and existing methods, achieving up to 2.9 speedup.

A Pipelined Collaborative Speculative Decoding Framework for Efficient Edge-Cloud LLM Inference

Abstract

Recent advancements and widespread adoption of Large Language Models (LLMs) in both industry and academia have catalyzed significant demand for LLM serving. However, traditional cloud services incur high costs, while on-device inference alone faces challenges due to limited resources. Edge-cloud collaboration emerges as a key research direction to combine the strengths of both paradigms, yet efficiently utilizing limited network bandwidth while fully leveraging and balancing the computational capabilities of edge devices and the cloud remains an open problem. To address these challenges, we propose Pipelined Collaborative Speculative Decoding Framework (PicoSpec), a novel, general-purpose, and training-free speculative decoding framework for LLM edge-cloud collaborative inference. We design an asynchronous pipeline that resolves the mutual waiting problem inherent in vanilla speculative decoding within edge collaboration scenarios, which concurrently executes a Small Language Model (SLM) on the edge device and a LLM in the cloud. Meanwhile, to mitigate the significant communication latency caused by transmitting vocabulary distributions, we introduce separate rejection sampling with sparse compression, which completes the rejection sampling with only a one-time cost of transmitting the compressed vocabulary. Experimental results demonstrate that our solution outperforms baseline and existing methods, achieving up to 2.9 speedup.
Paper Structure (16 sections, 10 equations, 6 figures, 4 tables)

This paper contains 16 sections, 10 equations, 6 figures, 4 tables.

Figures (6)

  • Figure 1: Comparison between (a) Cloud autoregressive decoding, (b) Cloud speculative decoding, (c) Vanilla collaborative speculative decoding, and (d) PicoSpec.
  • Figure 2: System Overview of PicoSpec Framework.
  • Figure 3: Asynchronous Pipeline of PicoSpec. ❶ Parallel Drafting: After the first draft, we perform multiple Pre-Draft steps consecutively. The i-th Pre-Draft on the edge is executed simultaneously with the (i-1)-th Verification in the cloud. ❷ Fast Verification: When a verification failure occurs, we immediately trigger a Pre-Verifiy step, and the subsequent Verify step quickly returns the verification result of the first token. ❸ Overlapped Communication: The sending/receiving of data stream on the edge overlaps with Draft step.
  • Figure 4: Parallel Drafting in asynchronous pipeline.
  • Figure 5: Fast Verification in asynchronous pipeline.
  • ...and 1 more figures