[Paper Review] SpecExec: Massively Parallel Speculative Decoding for Interactive LLM Inference on Consumer Devices
SpecExec proposes a massively parallel speculative decoding method that enables interactive inference of 50B+ parameter LLMs on consumer GPUs with RAM offloading by constructing a high-coverage draft tree from a powerful draft model and validating it in a single forward pass on the target model. It achieves 4–6 tokens per second with 4-bit quantization and 2–3 tokens per second with 16-bit weights, delivering 10–18x speedups over sequential inference.
As large language models gain widespread adoption, running them efficiently becomes crucial. Recent works on LLM inference use speculative decoding to achieve extreme speedups. However, most of these works implicitly design their algorithms for high-end datacenter hardware. In this work, we ask the opposite question: how fast can we run LLMs on consumer machines? Consumer GPUs can no longer fit the largest available models (50B+ parameters) and must offload them to RAM or SSD. When running with offloaded parameters, the inference engine can process batches of hundreds or thousands of tokens at the same time as just one token, making it a natural fit for speculative decoding. We propose SpecExec (Speculative Execution), a simple parallel decoding method that can generate up to 20 tokens per target model iteration for popular LLM families. It utilizes the high spikiness of the token probabilities distribution in modern LLMs and a high degree of alignment between model output probabilities. SpecExec takes the most probable tokens continuation from the draft model to build a "cache" tree for the target model, which then gets validated in a single pass. Using SpecExec, we demonstrate inference of 50B+ parameter LLMs on consumer GPUs with RAM offloading at 4-6 tokens per second with 4-bit quantization or 2-3 tokens per second with 16-bit weights.
Motivation & Objective
- To enable interactive inference of large 50B+ parameter LLMs on consumer-grade GPUs with limited VRAM and high memory bandwidth constraints.
- To address the poor scalability and low acceptance rates of existing speculative decoding methods when offloading large models to CPU RAM.
- To design a speculative decoding framework that maximizes token acceptance rates under high draft token budgets (up to 2048) while remaining flexible across model families and hardware configurations.
- To demonstrate that speculative decoding can be effectively leveraged on bandwidth-bound consumer hardware to achieve interactive inference speeds.
- To provide a practical, open-source system that enables local, private, and efficient LLM inference on consumer devices.
Proposed method
- SpecExec constructs a large, deterministic draft tree using a powerful draft model and a parallel search algorithm to explore the most probable token continuations.
- It leverages the high sparsity and alignment of probability distributions in modern LLMs to build a cache-like tree of likely continuations for speculative validation.
- The target model validates the entire draft tree in a single forward pass, accepting all valid token sequences in parallel.
- The method uses a simple verification algorithm that treats the draft tree as a precomputed cache of candidate continuations, minimizing redundant computation.
- It dynamically adjusts the draft tree depth and breadth based on the model’s probability distribution and hardware constraints, ensuring high acceptance rates.
- The system integrates with offloading frameworks to manage model weight transfers between GPU and CPU RAM efficiently, minimizing bandwidth bottlenecks.
Experimental results
Research questions
- RQ1Can speculative decoding achieve high acceptance rates when scaling to thousands of draft tokens on bandwidth-constrained consumer hardware?
- RQ2How can draft tree construction be optimized to maximize token acceptance while remaining compatible with offloaded LLM inference on consumer GPUs?
- RQ3What is the achievable inference speed for 50B+ parameter LLMs on consumer-grade GPUs with RAM offloading using speculative decoding?
- RQ4How does SpecExec’s performance compare to existing speculative decoding methods, especially in terms of speedup and scalability under offloading?
- RQ5Can SpecExec enable interactive LLM inference (≥2 tok/s) on consumer hardware with 4-bit quantized or 16-bit weight models?
Key findings
- SpecExec achieves 4–6 tokens per second on consumer GPUs with 4-bit quantized 50B+ parameter LLMs, enabling interactive inference.
- With 16-bit weights, SpecExec delivers 2–3 tokens per second on the same hardware, still achieving 10–18x speedup over sequential inference.
- The method supports up to 20 accepted tokens per target model forward pass, significantly outperforming prior methods that are limited to ~10 accepted tokens.
- On an RTX 4090, SpecExec reaches 5.66 tokens per second with a 4-bit quantized Llama2-70B target model, demonstrating strong performance on high-end consumer hardware.
- Even on older consumer GPUs like the RTX 2080Ti, SpecExec achieves 1.86 tokens per second, showing viability across a broad range of devices.
- SpecExec outperforms fixed-tree speculative decoding methods like Sequoia, which achieves only 2.2 tokens per second in a similar setup.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.