Fast and Cost-effective Speculative Edge-Cloud Decoding with Early Exits

Yeshwanth Venkatesha, Souvik Kundu, Priyadarshini Panda

Abstract

Large Language Models (LLMs) enable various applications on edge devices such as smartphones, wearables, and embodied robots. However, their deployment often depends on expensive cloud-based APIs, creating high operational costs, which limit access for smaller organizations and raise sustainability concerns. Certain LLMs can be deployed on-device, offering a cost-effective solution with reduced latency and improved privacy. Yet, limited computing resources constrain the size and accuracy of models that can be deployed, necessitating a collaborative design between edge and cloud. We propose a fast and cost-effective speculative edge-cloud decoding framework with a large target model on the server and a small draft model on the device. By introducing early exits in the target model, tokens are generated mid-verification, allowing the client to preemptively draft subsequent tokens before final verification, thus utilizing idle time and enhancing parallelism between edge and cloud. Using an NVIDIA Jetson Nano (client) and an A100 GPU (server) with Vicuna-68M (draft) and Llama2-7B (target) models, our method achieves up to a 35% reduction in latency compared to cloud-based autoregressive decoding, with an additional 11% improvement from preemptive drafting. To demonstrate real-world applicability, we deploy our method on the Unitree Go2 quadruped robot using Vision-Language Model (VLM) based control, achieving a 21% speedup over traditional cloud-based autoregressive decoding. These results demonstrate the potential of our framework for real-time LLM and VLM applications on resource-constrained edge devices.

Introduction

Deploying Large Language Models (LLMs) on edge devices like smartphones or robots presents a significant challenge. On-device models are often too small to maintain high accuracy, while relying solely on cloud-based APIs incurs high operational costs and introduces privacy concerns.

Speculative decoding has emerged as a promising technique to accelerate inference. It involves a small "draft" model generating a sequence of candidate tokens, which a larger "target" model then verifies in parallel. While effective, standard implementations often suffer from inefficiencies when split across edge and cloud environments. Specifically, "idle time" becomes a bottleneck: the edge device waits for server verification, and the server waits for the next batch of draft tokens.

Comparison of decoding strategies: (a) Cloud Autoregressive, (b) Cloud Speculative, (c) Vanilla Edge-Cloud Speculative, and (d) the proposed Fast Speculative Edge-Cloud Decoding.

Proposed Framework: Fast Speculative Decoding (FSD)

The proposed framework addresses these inefficiencies through a collaborative edge-cloud architecture and a novel preemptive drafting mechanism.

Edge-Cloud Collaborative Architecture

The system splits the workload by running a small draft model (e.g., Vicuna-68M) locally on the edge device (client) and a large target model (e.g., Llama2-7B) on the cloud server. This configuration significantly reduces API costs as the server is primarily utilized for verification rather than full autoregressive generation.

Early Exits and Preemptive Drafting

The core innovation lies in the integration of "early exit" adapters within the target model. These adapters allow the model to produce verified tokens at intermediate layers if confidence thresholds are met.

As the server performs verification, it transmits these "early" tokens back to the client. Instead of waiting for the final layer's output, the client immediately initiates Preemptive Drafting for the next sequence based on these intermediate results. This approach effectively overlaps the server's final verification steps with the client's next drafting round, eliminating the traditional "dead zones" in the processing cycle.

Detailed workflow of the Fast Speculative Decoding (FSD) framework, highlighting early exits and preemptive drafting.

To manage potential discrepancies between early exits and final outputs, the client utilizes a priority queue and a "pre-draft cache." If the final server output matches a preemptively drafted sequence, a "cache hit" occurs, further reducing overall latency.

Experimental Results

The framework was evaluated across six benchmarks: MT-bench (conversation), HumanEval (code), GSM8K (math), Alpaca (instructions), CNN/DM (summarization), and NQ (QA).

Performance and Cost Efficiency

  • Latency Reduction: FSD achieved up to a 35% reduction in latency compared to standard cloud-based autoregressive decoding. The preemptive drafting mechanism specifically contributed an 11% speedup over vanilla edge-cloud speculative decoding.
  • Cost Savings: By offloading drafting to the edge, target model API costs were reduced by up to 52%.
  • Robotics Application: Deployment on a Unitree Go2 quadruped robot using a Vision-Language Model (VLM) resulted in a 21% speedup, demonstrating the framework's viability for real-time embodied AI.

Discussion and Future Work

While FSD offers significant gains, it remains sensitive to network conditions; round-trip times exceeding 300–400ms can diminish performance benefits. Additionally, training the early exit adapters requires a non-trivial one-time computational investment. Future research will focus on adaptive communication strategies to handle varying network latencies and scaling the architecture to support multi-client environments.

Summary updated

BibTeX
@article{venkatesha2025fast,
  author = {Yeshwanth Venkatesha and Souvik Kundu and Priyadarshini Panda},
  title = {{Fast and Cost-effective Speculative Edge-Cloud Decoding with Early Exits}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=PTIUjARnbc},
}
Figure