PipeSD: An Efficient Cloud-Edge Collaborative Pipeline Inference Framework with Speculative Decoding

Yunhe Han, Yunqi Gao, Bing Hu, Mahdi Boloursaz Mashhadi, Yitong Duan, Pei Xiao, Yanfeng Zhang

TL;DR

This paper introduces PipeSD, a novel cloud-edge framework that significantly accelerates LLM inference by optimizing speculative decoding. PipeSD achieves this by overlapping token generation and communication using a dynamic programming-based pipeline scheduler and by introducing a flexible dual-threshold mechanism for triggering verification, leading to substantial speedups and reduced energy consumption.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly powerful but suffer from slow inference due to their autoregressive nature (generating one token at a time). Speculative decoding offers a solution by using a smaller "draft" model to predict multiple tokens, which are then verified by a larger "target" model. While cloud-edge collaborative inference is a promising deployment strategy for LLMs, existing approaches with speculative decoding face two main challenges:

  1. Sequential Bottlenecks: Current frameworks execute token generation, communication, and verification sequentially, leading to underutilized resources (bandwidth and compute) on both edge and cloud devices.
  2. Inflexible Verification: Existing methods use fixed draft lengths or simple confidence thresholds for verification, which can either lead to premature verification (missing opportunities for speculation) or excessive speculation (causing costly rollbacks and delays).

Methods

PipeSD tackles these challenges with two core innovations:

  1. Token-Batch Pipeline Scheduling: This mechanism overlaps the draft model's token generation on the edge with the transmission of these tokens to the cloud. Instead of sending tokens one by one or waiting for the entire draft sequence, PipeSD intelligently batches tokens. A dynamic programming (DP) algorithm optimizes this batching strategy to minimize the combined generation and communication time, considering communication startup overhead.
  2. Dual-Threshold NAV Triggering Mechanism: This approach enhances the flexibility of when to trigger the Non-Autoregressive Verification (NAV) by the target model. It considers both:
  3. Cumulative Sequence Confidence: The overall confidence of the predicted draft sequence.
  4. Single-Token Confidence: The confidence of individual draft tokens. A lightweight Bayesian Optimization (BO) autotuner is used to dynamically adjust the thresholds for these two confidence measures, adapting to varying task difficulties and ensuring optimal performance.

Datasets

The paper evaluates PipeSD using two standard benchmarks:

  • HumanEval: Used for programming tasks.
  • GSM8K: Used for mathematical reasoning tasks.

The models used are:

  • Programming: DeepSeek-Coder-1.3B (draft) and DeepSeek-Coder-6.7B (target).
  • Mathematical Reasoning: TinyLlama-1.1B-Chat-v1.0 (draft) and Llama-2-7B (target).

Key Insights and Ideas

  • Pipelining is Key, but Smart Batching is Crucial: Simply overlapping generation and transmission isn't enough. The communication startup overhead necessitates intelligent batching, which PipeSD's DP-optimized scheduler provides, outperforming simpler pipelining strategies.
  • Dual Confidence is Better Than One: Relying on just sequence confidence or just token confidence for verification is suboptimal. Combining both allows for more nuanced decisions, preventing both premature verification and excessive speculation.
  • Adaptability is Paramount: The performance of LLM inference is highly sensitive to network conditions and task complexity. PipeSD's adaptive mechanisms (BO for thresholds, DP for batching) are essential for maintaining high performance in dynamic real-world environments.
  • Negligible Overhead: The proposed control mechanisms (BO, DP, parameter measurement) introduce very little computational overhead, making them practical for edge deployment.

Key Results

PipeSD consistently outperforms state-of-the-art baselines (Vanilla, HSL, EdgeLLM) across various scenarios:

  • Speedup: Achieves 1.16× to 2.16× speedup in inference time.
  • Energy Consumption: Reduces cloud server energy consumption by 14.3% to 25.3%.
  • Robustness: Demonstrates consistent performance improvements even under fluctuating network bandwidth and varying edge compute capabilities.
  • Ablation Studies: Show that both the token-batch pipeline scheduling and the dual-threshold NAV triggering mechanism contribute significantly to PipeSD's performance gains.

Limitations and Future Work

  • Single Client Focus: The current implementation is described for a single edge client, although the authors note it can be extended to multi-client scenarios.
  • Tree-based Speculative Decoding: The paper discusses tree-based speculative decoding as an advanced approach but deems it less suitable for current cloud-edge constraints due to computational demands and bandwidth overhead. However, they suggest PipeSD's techniques could enhance such methods in the future.
  • Future Work: The authors plan to validate PipeSD's robustness in more diverse real-world settings, including varying network conditions, hardware platforms, and task types.

Summary updated

BibTeX
@inproceedings{han2026pipesd,
  author = {Yunhe Han and Yunqi Gao and Bing Hu and Mahdi Boloursaz Mashhadi and Yitong Duan and Pei Xiao and Yanfeng Zhang},
  title = {{PipeSD: An Efficient Cloud-Edge Collaborative Pipeline Inference Framework with Speculative Decoding}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=1ebAvNphi7},
}
Figure