TL;DR
Edge–cloud speculative decoding offloads fast draft token generation to an edge device and verification to a cloud LLM, but transmitting draft token probability distributions over constrained wireless uplinks quickly creates a communication bottleneck. This paper introduces Sparse Quantize-and-Sample (SQS), uniting sparse lattice quantization with sparsification. While fixed top-$K$ pruning ($K$-SQS) works well in predictable contexts, the authors introduce Conformal SQS (C-SQS), which uses online conformal prediction to dynamically adapt the retained vocabulary size per token, bounding distribution distortion and maintaining low latency across high-uncertainty regimes.
What Problem Does This Paper Address?
Speculative decoding (SD) accelerates large language model (LLM) inference by having a lightweight small language model (SLM) propose draft tokens that a larger target LLM verifies in parallel. In an edge–cloud architecture—where the SLM runs locally on a mobile or edge device and the target LLM runs in the cloud—the target model must receive both the proposed tokens and their draft probability distributions to guarantee mathematically exact sampling.
Transmitting these dense probability distributions over high-dimensional vocabularies (often tens of thousands of tokens) chokes limited uplink bandwidth. Prior work established a Quantize-and-Sample (QS) framework to compress these distributions via lattice quantization, but full-vocabulary distributions remain large. The challenge is: How can we aggressively sparsify probability distributions prior to quantization without breaking speculative decoding guarantees or triggering excessive token rejections?
Methods
The authors introduce the Sparse Quantize-and-Sample (SQS) framework, which prunes distributions before applying Sparse Lattice Quantization (SLQ):
- Theoretical Decomposition: They derive an upper bound on the expected number of rejected/resampled tokens ($N_{\text{rej}}$), splitting the rejection error into two distinct terms:
- The intrinsic statistical mismatch (total variation distance) between the SLM and cloud LLM.
- The distortion introduced by sparsification and lattice quantization.
- $K$-SQS: A fixed top-$K$ baseline that retains only the $K$ highest-probability tokens, encoding the selected subset indices and using SLQ for non-zero probabilities.
-
Conformal SQS (C-SQS): Because token predictability varies across contexts (e.g., deterministic grammatical continuations vs. open-ended story generation), a static $K$ is sub-optimal. C-SQS applies an adaptive threshold $\beta_n^t$ based on online conformal prediction: $$\beta_{n+1}^t = \beta_n^t - \eta \left( \sum_{x \notin \mathcal{X}_n^t} q_n^t(x) - \alpha \right)$$ If the discarded probability mass exceeds tolerance $\alpha$, the threshold lowers (retaining more tokens); if it is smaller, the threshold rises (sparsifying more aggressively).
-
Checkpointing & Backtracking: The edge model speculatively updates $\beta$ across a batch, then backtracks based on cloud verification feedback to ensure the threshold adapts strictly along accepted LLM tokens.
Datasets
- One Billion Word Benchmark (LM1B): Used to evaluate text completion performance.
- Models: GPT-Neo-125M was used as the edge SLM draft model, and GPT-Neo-1.3B served as the cloud LLM verifier.
- No new datasets were introduced.
Key Insights and Ideas
- Sparsification and Quantization Decoupling: The information-theoretic bound reveals that sparsification acts as a controlled distortion source that can be balanced directly against quantization resolution to fit strict bit budgets.
- Context-Dependent Entropy: Language prediction uncertainty fluctuates dramatically. A static top-$K$ either wastes bandwidth on obvious tokens or causes rejections on high-entropy tokens.
- Distribution-Free Online Control: By formulating threshold selection as an online conformal control loop, C-SQS guarantees that the average cumulative distribution truncation error converges asymptotically to $\le \alpha + \mathcal{O}(1/T)$ without needing prior distribution assumptions.
- Complementary Operational Regimes:
- Low temperature (low uncertainty): $K$-SQS with small $K$ ($K=2$ or $3$) achieves minimal latency because the top few tokens reliably cover almost all probability mass.
- High temperature (high uncertainty): $K$-SQS degrades rapidly, whereas C-SQS dynamically expands its support set, mitigating resampling penalties and stabilizing end-to-end latency.
Key Results
Under an uplink budget of $B = 5000$ bits per batch and lattice resolution $\ell = 100$:
- Latency vs. Temperature: As sampling temperature scales from $0.1$ to $1.0$, $K$-SQS latency climbs steeply (from ~1.2s to ~1.8s+), showing high variance in resampling rate (surpassing 0.6 at high temperatures). In contrast, C-SQS maintains steady latency (~1.3s to ~1.6s) and caps resampling rates around 0.3–0.4.
- Ablation on Adaptivity: Disabling adaptivity ($\eta = 0$) in C-SQS caused sharp increases in both latency and resampling rates across temperatures, proving that active tracking of the discarded probability mass is crucial.
Limitations and Future Work
- Evaluation Scope: Experiments are limited to a single architecture pair (GPT-Neo-125M / GPT-Neo-1.3B) on the LM1B benchmark. Validation across larger contemporary LLMs (e.g., Llama variants) remains open.
- Communication Overhead of Variable Support: Communicating dynamic subset sizes in C-SQS incurs an extra $\lceil \log_2 |V| \rceil$ bits per token compared to fixed $K$-SQS.
- Rejection Metric Scope: The theoretical bound explicitly bounds resampled tokens ($N_{\text{rej}}$, at most one per batch) rather than total discarded draft tokens ($N_{\text{tot-rej}}$), as rejected tokens do not follow the true LLM distribution.
Summary updated