FlashMap Drafts 16 Dependent Tokens at Once, Hitting 6.1x Faster Decoding
A flow-map drafter conditions on hidden states to generate entire token blocks in one shot, hitting 6.1x lossless speedups on Qwen3-8B.
Takeaways
- FlashMap is a new speculative decoding drafter based on continuous flow maps.
- Generates an entire token block in one pass while modeling inter-token dependencies.
- Delivers up to 6.1x lossless speedup on Qwen3-8B, beating DFlash on every benchmark.
- Conditions the flow map on target model hidden states for better acceptance rates.
- Open-source code with SGLang and vLLM integration available.
- Pretrained drafters for Qwen3-8B and Qwen3-4B released on Hugging Face.
The FlashMap paper introduces a speculative-decoding drafter that generates an entire token block with a continuous flow map. The method retains parallel block generation while modeling dependencies among tokens within the block.
On Qwen3-8B, the authors report up to 6.1x lossless acceleration over ordinary target-model decoding and a 7% higher average speedup than a matched DFlash baseline.
Why drafting still costs time
Speculative decoding pairs an accurate target model with a smaller drafter to reduce the number of sequential target-model calls. Each decoding cycle follows four steps:
- The drafter proposes a block of candidate tokens.
- The target model scores the full block in parallel.
- The verifier accepts the longest valid prefix.
- After a rejection, decoding resumes from a target-model token.
In this context, “lossless” means the verifier preserves the target model’s output distribution under the same sampling settings. Greedy decoding produces the same result as ordinary target-model decoding when the verifier is implemented correctly.
| Drafter | Block generation | Token dependencies | Primary cost |
|---|---|---|---|
| Autoregressive, including EAGLE-style models | Sequential | Each token sees earlier draft tokens | Proposal latency grows with block length |
| DFlash-style diffusion | Parallel | Positions are predicted independently under the paper’s formulation | Acceptance declines at later block positions |
| FlashMap | Parallel flow map | The block is modeled jointly | Requires a target-specific trained drafter |
One map, 16 dependent tokens
FlashMap learns a continuous transformation from Gaussian noise to a representation of a complete token block. A single forward pass applies that transformation and produces all K draft tokens, with the reported experiments using K=16.
The flow map receives hidden states from the target model as conditioning context. Those states summarize the prompt and accepted sequence at the current position, allowing the drafter to generate a context-specific block and capture relationships among its tokens.
The default one-step path minimizes proposal latency, while num_steps=2 spends another flow-map step on draft quality. The second step can raise acceptance rates when its additional compute costs less than the target-model work it avoids.
Where the gain appears
The evaluation compares FlashMap with a DFlash baseline retrained on the same data and settings. Tests cover GSM8K for mathematics, HumanEval for code, and MT-Bench for conversational responses.
| Measure | Reported result | Scope |
|---|---|---|
| Peak acceleration | Up to 6.1x | Lossless decoding with Qwen3-8B |
| Average lead over DFlash | 7% higher speedup | Matched training data and settings |
| Draft length | 16 tokens | Training and reported evaluations |
| Evaluation workloads | Math, code, and chat | GSM8K, HumanEval, and MT-Bench |
FlashMap’s conditional acceptance rate falls more gradually across later block positions than DFlash’s rate. That pattern matters because one rejected token ends acceptance for the remaining suffix, so improvements near the end of a block can increase the number of useful tokens returned by each verification call.
End-to-end speed varies with hardware, batch size, sequence length, sampling configuration, serving framework, and target-model utilization. Reproductions should compare full request latency or throughput under the intended production workload, including drafter execution and verification overhead.
Serving with vLLM and SGLang
The MIT-licensed reference code includes integrations for vLLM and SGLang. The core implementation depends on PyTorch and a recent Transformers release.
| Target model | Released drafter | Parameters |
|---|---|---|
| Qwen3-8B | 8B drafter | 500M |
| Qwen3-4B | 4B drafter | 475M |
A vLLM server can pair the released 8B drafter with its matching Qwen3 target model:
vllm serve Qwen/Qwen3-8B \
--speculative-config '{"model": "j-shen/FlashMap-Qwen3-8B", "num_speculative_tokens": 16}'
The target and drafter must use the intended model pairing, tokenizer, and block configuration. Deployment planning should also include memory for the 475M or 500M parameter drafter in addition to the target model and KV cache.
Training requires two stages
The published training pipeline adapts SpecForge and the vLLM project’s speculators library. It proceeds through two stages:
- Fit a continuous flow over one-hot token blocks, where each one-hot vector identifies a vocabulary token.
- Distill the learned flow into a map that can generate a block in one inference step.
Only Qwen3-8B and Qwen3-4B checkpoints are currently released. Supporting another target model requires collecting the corresponding training signals and fitting a compatible drafter.
Deployment fit and limits
- Strong fit: latency-sensitive Qwen3 serving where speculative decoding must preserve the target model’s output distribution.
- Promising workloads: code, mathematics, and structured generation, where dependencies among later draft tokens can affect acceptance.
- Smaller gains: short completions or heavily batched workloads where proposal overhead consumes much of the saved target-model time.
- Operational tradeoff:
num_steps=2may improve acceptance, but each request pays for the additional drafter step. - Current constraint: released checkpoints cover two Qwen3 targets, leaving other model families dependent on custom training.
FlashMap addresses a specific speculative-decoding bottleneck: producing coherent multi-token proposals without sequential draft generation. Its reported gains make the approach relevant for teams serving supported Qwen3 models, provided that measurements on their own hardware confirm that higher acceptance offsets drafter compute and memory.