Speculative Decoding in Practice: Speeding Up Local Inference with DeepSeek DSpark / DFlash / Eagle3
Speculative Decoding in Practice: Speeding Up Local Inference
The most visible bottleneck of local inference is "generation is slow." Quantization fits a model into VRAM; speculative decoding tries to speed up generation without changing the model. DeepSeek open-sourced three companion series on HuggingFace — DSpark, DFlash, and Eagle3 — covering its own V4 models as well as third-party bases like Qwen3 and Gemma4. This guide covers the mechanism, the ready-made companions, how to configure them, and when the technique is worth using.
The short version
Speculative decoding = a small model quickly drafts several tokens → the large model verifies them in one parallel pass → accepted prefix is kept. Since every accepted token is confirmed by the large model, the output distribution is unchanged. DeepSeek's DSpark/DFlash/Eagle3 are officially open-sourced draft models — start with them for local speedups instead of training your own draft model.
The mechanism: why it is faster without changing results
Autoregressive generation is serial: producing token N requires token N-1 to be finished, so the GPU computes one token at a time and much of its compute sits idle. Speculative decoding's idea:
- A much smaller "draft model" cheaply guesses several following tokens in a row
- Those candidates are handed to the large model for parallel verification (one forward pass checks multiple positions, raising compute utilization)
- The prefix the large model agrees with is accepted; at the first disagreement, drafting restarts from there
The key is verification: every accepted token is one the large model confirmed itself, so the final output is identical to unaccelerated generation. It is not "letting the model be sloppier" but "less waiting for the same computation." That is why papers and tool docs repeatedly stress an unchanged output distribution — the fundamental difference between speculative decoding and "switching to a smaller model."
Distinction from quantization
Quantization reduces model size and VRAM (Q4 is about one third of FP16). Speculative decoding reduces generation waiting time. They act on different dimensions and can be combined: a quantized model can still use speculative decoding.
What DeepSeek open-sourced
Based on the deepseek-ai HuggingFace organization releases of 2026-06-27/28. Download counts below are reference values at collection time — follow each model card for live data.
| Series | Representative repo | Target base | Downloads (reference) |
|---|---|---|---|
| DSpark (V4) | DeepSeek-V4-Flash-DSpark | DeepSeek V4-Flash | ~128K |
| DSpark (V4) | DeepSeek-V4-Pro-DSpark | DeepSeek V4-Pro | ~2.1K |
| DSpark (general) | dspark_qwen3_8b_block7 | Qwen3-8B | ~22K |
| DSpark (general) | dspark_qwen3_14b/4b_block7, dspark_gemma4_12b_block7 | Qwen3-14B/4B, Gemma4-12B | Thousands |
| DFlash | dflash_qwen3_4b/8b/14b_block7, dflash_gemma4_12b_block7 | Qwen3, Gemma4 | Hundreds to thousands |
| Eagle3 | eagle3_qwen3_4b/8b/14b_ttt7, eagle3_gemma4_12b_ttt7 | Qwen3, Gemma4 | Hundreds |
The three series correspond to different draft-generation strategies (the block7 and ttt7 suffixes are architecture/training configuration markers — see each model card for exact meaning). The naming is practical: dspark_qwen3_8b_block7 is "the DSpark draft model for Qwen3-8B." When choosing a companion, match the base name and scale first — do not pair a 14B draft with a 4B target.
Base matching is the first principle
Speculative decoding gains depend heavily on how well the draft model matches the target. A wrong base or wrong scale drops the verification acceptance rate and wastes compute on the draft model. Prefer companions whose model card explicitly names your target base.
Configuration approach
Field names differ across inference frameworks, but the approach is the same three steps:
1. Load the target model and point at a draft model. llama.cpp-family tools use a draft-model path flag (such as -md / --model-draft — check your version's --help); vLLM uses a speculative config specifying the draft model and method.
# llama.cpp shape illustration: field names follow your version --help
./build/bin/llama-server \
-m ./models/Qwen3.8-27B-Q4_K_M.gguf \
-md ./models/draft-model.gguf \
-ngl 40 -c 8192 \
--host 127.0.0.1 --port 8080
2. Get it running, then tune. Draft length (how many tokens guessed at once) and parallel verification batch size both affect gains — run defaults first, then compare tokens/s with the same prompt set with acceleration on and off.
3. Benchmark with one fixed prompt set. Record baseline tokens/s and VRAM, then the accelerated values. Gains vary by model, hardware, and task distribution — this article states no universal multiplier; your own measurement is authoritative.
The draft model needs its own VRAM
A draft model also occupies VRAM. It is far smaller than the target, but on a machine already tight on memory you need to reserve space for it. Before enabling, check the VRAM budget: target weights + KV cache + draft model + runtime overhead.
When it is worth using
| Scenario | Worth it? | Why |
|---|---|---|
| Batch document processing (long outputs) | Yes | Many repeatable patterns, high acceptance |
| Long agent loops, code generation | Yes | Large generation volume, cumulative savings |
| Single-turn short Q&A | Marginal | Few serial steps, little room |
| VRAM already tight | Caution | Draft model needs extra VRAM |
| Highly unpredictable output (creative writing) | Caution | Draft acceptance may be low |
| Structured output (JSON/tables) | Yes | Many templated tokens, high hit rate |
A practical heuristic: the longer and more predictable the output, the more speculative decoding pays off. Short Q&A has only a few serial steps, so the speedup ceiling is low to begin with.
Practical tuning checklist
Before enabling speculative decoding in a real deployment, walk this checklist:
- Confirm engine support: not every llama.cpp or vLLM release supports every draft-method variant (Eagle3, DFlash, DSpark). Check your engine version release notes and the companion model card first.
- Verify the base match: the draft model card should name the exact target model family and scale. A mismatch is the most common cause of low acceptance.
- Measure baseline: record tokens/s and peak VRAM with acceleration off, on your real prompts.
- Enable with defaults: do not tune draft length on the first run. Get a clean apples-to-apples measurement.
- Compare on the same prompt set: change nothing else — same temperature, same context length, same quantization.
- Inspect acceptance indirectly: if tokens/s barely moves, the draft is being rejected early. Try a companion closer to your target base.
- Watch VRAM: the draft model plus its own small KV cache must fit alongside the target.
- Decide per workload class: keep acceleration on for batch and long-output paths, off for latency-insensitive short requests if overhead shows up.
This is deliberately empirical. Speculative decoding is a workload-dependent optimization, not a universal switch.
Relation to other acceleration methods
Local speedup methods act on different layers and can be combined:
| Method | Layer | With speculative decoding |
|---|---|---|
| Quantization (Q4/Q5/Q8) | Weight size / VRAM | Stacks |
| GPU layer count (-ngl) | Compute placement | Stacks |
| Speculative decoding | Generation seriality | This topic |
| Switch to a smaller model | Model capability | Different tradeoff (quality drops) |
| Batch inference | Throughput | Stacks |
Note the essential difference between "switching to a smaller model" and speculative decoding: the former trades quality for speed, the latter does not. If your task is quality-sensitive, speculative decoding is the cleaner choice.
Measuring whether it actually helped
Speculative decoding is easy to enable and easy to misjudge. Before declaring a win, measure the right quantity on your own workload rather than trusting a published multiplier:
- Tokens per second end to end, including draft generation, verification, and any rejected-token recomputation — not just the verifier's forward pass
- Acceptance rate, the share of drafted tokens the large model keeps; a low rate means the draft model is a poor match for your prompts and the extra work is wasted
- Memory headroom, since the draft model and its KV cache occupy extra space that may force a lower context length or a smaller quantization tier
- Output equivalence, verified by replaying a fixed prompt set with and without speculation; the method should not change the distribution
Run the comparison at three prompt shapes — short chat, long-context reading, and structured generation — because acceptance rate varies sharply between them. Keep a small table of results per model pair and per configuration; when you change the draft model or the draft length, rerun that table rather than assuming the earlier result still holds. If the measured gain disappears under your real traffic, turning the feature off is a legitimate outcome: the mechanism is an optimization, not a requirement.
FAQ
Does speculative decoding reduce answer quality?
Can DeepSeek companions pair with Qwen models?
How much extra VRAM does enabling it cost?
What speedup multiplier should I expect?
Does it conflict with quantization?
Can I use it on EXAIV cloud?
Related reading
- VRAM Calculation in Practice — budgeting VRAM
- The Complete Local Deployment Playbook — seven-step flow
- DeepSeek V4 Family Overview — V4 family and DSpark background
- Qwen Cost Optimization — saving on the cloud side
- Qwen GGUF Local Deployment Primer — quantization and loading basics