Speculative decoding enables collaborative Large Language Model (LLM) inference across cloud and edge by separating lightweight token drafting from heavyweight verification. While prior systems show performance and cost benefits, practical deployment requires navigating a large configuration space spanning draft model variants, quantisation levels, speculative lengths, and heterogeneous edge devices. This paper presents ConfigSpec, a configurationselection framework for distributed speculative LLM serving. ConfigSpec profiles edge devices and draft-target alignment, and models drafting throughput, acceptance rate, and power to evaluate goodput, verification cost efficiency, and energy efficiency across the joint configuration space. Our analysis across three edge platforms and two LLM families reveals structurally conflicting optima. Firstly, goodput is maximised by the smallest, fastest draft model at device-dependent speculative lengths (K*=2-10). Secondly, both cost and energy efficiency converge to K=2 due to a dominant bonus-token effect-with cost favouring the largest drafter for its high acceptance rate and energy favouring the smallest for its low power draw. These conflicts confirm that no single fixed configuration can simultaneously optimise all objectives, underscoring the need for profiling-based configuration selection in disaggregated edge-cloud LLM inference.
Figures & tables
Figure 1. System abstraction used by ConfigSpec. Heterogeneous edge devices generate speculative tokens using local draft models and interact with a centralized cloud verifier.
Target: Llama-3.1-70B
Target: Qwen3-32B
Draft Model
α
Draft Model
α
Llama-3.2-1B
0.462
Qwen3-0.6B
0.378
Llama-3.2-1B-Instruct
0.546
Qwen3-1.7B
0.466
Llama-3.2-3B-Instruct
0.572
Qwen3-4B
0.487
Llama-3.1-8B
0.622
Qwen3-8B
0.522
Table 1. Acceptance rate ( α ) of draft models against each target model with speculative length of 5. Higher values indicate stronger alignment between draft and target distributions.
Figure 2. Goodput vs. speculative length across devices and models.
Figure 3. Verified token generation speed.
Figure 4. Cost efficiency of draft models.
Figure 5. Energy efficiency of draft models.
Figure 6. Energy efficiency and speed (goodput) comparison.
Target
Device
Objective
Configuration
K
G
ηcost
E
Llama-3.1-70B
RPi 4B
Max Goodput
Llama-3.2-1B-Inst Q4
2
2.44
1334K
—
Min Cost/tok
Llama-3.1-8B-Inst Q4
2
0.77
1401K
—
Min Energy
no power data
RPi 5
Max Goodput
Llama-3.2-1B-Inst Q4
6
4.50
763K
0.84
Min Cost/tok
Llama-3.1-8B-Inst Q4
2
1.55
1401K
3.75
Min Energy
Llama-3.2-1B-Inst Q4
2
3.76
1334K
0.48
Table 2. Recommended configurations under different optimisation objectives. G : goodput (tok/s), ηcost : cost efficiency (K tokens/),E$ : energy per accepted token (J/tok). Best values per (target, device) group are bolded .
Speculative decoding accelerates large language model (LLM) inference by using a lightweight draft model to propose tokens and a larger target model to verify them in parallel. In distributed edge-cloud inference, however, draft length must be controlled online: longer drafts amortize communication delay but reduce token acceptance, whereas shorter drafts preserve acceptance but trigger more communication rounds. We formulate this tradeoff as a ratio-type optimal stopping problem and prove that the optimal draft length is a finite delay-monotone threshold. The analysis identifies a critical delay below which single-token speculation is optimal and shows that the optimal length grows only logarithmically with communication delay. For time-varying networks, we extend the model to Markov-modulated channels and establish, under a bounded horizon and monotone stopping-region conditions, a state-dependent threshold policy. For unknown environments, we propose UCB-SpecStop, an online control algorithm with gap-free and gap-dependent expected regret bounds of O(LmaxKmaxTlog(KmaxT)) and O(∑k:Δk>0Lmax2log(KmaxT)/Δk). We implement the method on a real edge-cloud testbed with a Jetson Orin Nano Super edge node and an RTX3090 Ti cloud node, using Qwen and Llama draft--target pairs. Experiments validate the predicted phase transition, with transition points near 83ms and 111~ms. Qwen matches the geometric prediction, while Llama requires empirical-prefix calibration due to heavy-head acceptance. Across the tested delay grid, UCB-SpecStop reduces per-token latency over SpecDec++ by up to 22.4%, approaches an offline oracle within 0.2--2.4% in communication-dominated regimes, improves over naive UCB by up to 7.5%, removes the 14.0--18.7% gap caused by static tuning under delay drift, and gains 3.0--6.8% with contextual channel-state information.
Kangkang Sun, Jianhua Li, Xiuzhen Chen +2
Shanghai Key Laboratory of Integrated Administration Technologies for Information Security, School of Computer Science, Shanghai Jiao Tong University, Shanghai 200240, China · School of Science and Engineering, The Chinese University of Hong Kong, Shenzhen, Guangdong, China
Large Language Models (LLMs) have achieved remarkable success in natural language understanding and generation, but their deployment is constrained by high computational demands. Deploying smaller LLMs directly on the edge can circumvent this, but with degraded accuracy. Deploying smaller cloud-based big LLMs preserves performance, but at the cost of expensive per-token computation. We present a distributed inference framework, \our{}, that integrates speculative decoding (SD) across edge and cloud. A compact draft model deployed on the edge generates candidate tokens rapidly, and a large verifier model on the cloud validates these tokens in parallel. Accepted tokens are retained, while only rejections trigger verifier correction, substantially reducing the number of cloud queries. Our plug-and-play design shifts the bulk of computation to the edge, significantly lowers inference time and cloud cost, and preserves the accuracy of the big model without any retraining requirement. Our approach demonstrates a practical path toward scalable, cost-efficient, and accurate deployment of LLMs in real-world environments. Experimental results across multiple Natural Language Processing tasks using SpecBench and CNN/Dailymail datasets demonstrate that \our{} reduces the cloud model calls by 76% with zero loss in accuracy as compared to the full model.
Speculative decoding accelerates autoregressive large language model (LLM) inference by using a lightweight draft model to speculate multiple tokens, reducing expensive target model decoding steps. Its effectiveness depends heavily on draft selection, motivating adaptive methods that exploit variation across inputs and generation stages. On memory-constrained edge devices, however, these methods often fail to improve end-to-end throughput due to the overhead of switching between draft models. We identify a key limitation in this setting: the mismatch between draft selection and draft availability under tight memory budgets. To address this challenge, we present MemSpec, a prediction-guided, memory-aware runtime for adaptive speculative decoding on edge devices. MemSpec decouples draft selection from execution through proactive resident working-set management. A lightweight predictor estimates draft effectiveness from prompt and generation context, while a memory-aware scheduler reduces reactive model loading overhead. Experiments on a Jetson Orin Nano show that MemSpec improves steady-state generation throughput by 40.7% on average over state-of-the-art bandit-based adaptive methods while closely approaching the oracle upper bound.
Eunjeong Kim, Yeong Jun Jeon, Myeonggyun Han
Kyungpook National University Daegu, Republic of Korea