Simplified overview
Written by Abrar Akhunji
If you have ever watched a large language model output code in your terminal, you know it feels like watching someone type out a letter one key at a time.
Even on an NVIDIA H100 GPU cluster worth hundreds of thousands of dollars, the model cannot guess word four until word three has finished passing through all eighty transformer layers. The tensor cores spend almost all their time sitting idle, waiting for heavy memory chips to move numbers across the bus.
Engineers fixed this partially with Speculative Decoding. A tiny, cheap assistant model guesses four or five words ahead. Then the master model checks all of them in a single step.
In August 2026, DFlash took this further by using Block Diffusion. Instead of guessing words one after another, DFlash used a parallel neural network to propose five tokens at the same time in one forward pass.
It was fast, but it had a hidden trap:
THE FACTORIZATION TRAP IN BLOCK DRAFTING
DFlash (Independent Factorized Prediction):
┌────────────────────────────────────────────────────────┐
│ Target context: "def calculate_" │
│ Slot 1 guesses: "total" ──► Matches target! [OK] │
│ Slot 2 guesses: "(x):" ──► Ignored Slot 1! [FAIL│ (Expected "_price")
│ Slot 3 guesses: "return x" ──► Cascading rejection! │
│ Outcome: Tokens 2 and 3 get thrown away. │
└────────────────────────────────────────────────────────┘
FlashMap (Continuous Flow Map Coupling):
┌────────────────────────────────────────────────────────┐
│ Shared continuous noise field transports the block │
│ Slot 1: "total" │
│ Slot 2: "_price" ──► Strongly coupled! [OK│
│ Slot 3: "(items):" ──► Structurally valid! │
│ Outcome: All tokens accepted in one verification pass. │
└────────────────────────────────────────────────────────┘
When DFlash guessed five words at once, it guessed them independently. Imagine trying to finish a five-word sentence where five different people each write one word on a card without looking at what the other four are writing.
The first word usually made sense. The second word was hit or miss. By the third and fourth words, the sentence broke down grammatically. The master model had to throw away more than half of the guesses. Inference engineers called this Suffix Decay.
On October 17, 2026, a team of systems researchers from USC and Flatiron Institute published FlashMap (arXiv:2610.24365).
FlashMap replaces independent guessing with a Continuous Flow Map. Instead of treating words as isolated slots, it samples a single shared continuous cloud of numbers and runs an Ordinary Differential Equation (ODE) velocity field through it.
Because all the candidate words flow together through bidirectional attention, word three knows exactly what word two is doing while the drawing takes place. Suffix decay vanishes.
The master model accepts almost five tokens per verification step, pushing real-world inference speedups up to 6.1x without altering a single word of the target model's original distribution.
FlashMap Speculative Execution Pipeline
- Target Hidden State Conditioning: The target model runs a standard decoding step and emits its final layer hidden state, capturing the full semantic history without re-allocating an auxiliary drafter KV cache.
- Shared Gaussian Latent Vector: A shared continuous noise vector z_0 is sampled from a standard Gaussian distribution across all K draft block positions simultaneously.
- 1-Step Euler ODE Trajectory: The flow velocity network v_theta integrates the latent state along the probability path in a single forward pass, coupling all token positions through bidirectional attention.
- Batched Target Rejection Sampling: The target model evaluates the entire K-token speculative block in one compute-dense forward pass, guaranteeing mathematically identical output distribution.
Token Acceptance Rate by Block Position (K=1 to 8)
Empirical acceptance rate comparison across draft block positions on Qwen3-8B evaluating code and mathematical reasoning tasks.
| position | DFlash (Factorized Diffusion) | EAGLE-3 (Autoregressive Drafter) | FlashMap (Continuous Flow Map) |
|---|---|---|---|
| Token 1 | 88 | 86 | 93 |
| Token 2 | 67 | 78 | 89 |
| Token 3 | 48 | 71 | 85 |
| Token 4 | 35 | 64 | 81 |
| Token 5 | 26 | 58 | 76 |
| Token 6 | 18 | 51 | 72 |
| Token 7 | 12 | 44 | 66 |
| Token 8 | 7 | 38 | 59 |
Technical breakdown
Written by Abrar Akhunji
Autoregressive decoding is bound by memory bandwidth. For sequence batch size , each newly decoded token requires loading tens of gigabytes of model weights from High Bandwidth Memory (HBM) to on-chip SRAM to execute simple matrix-vector products. The operational intensity sits near 1 FLOP per byte, leaving GPU Tensor Cores starved for work.
Speculative decoding alters this dynamic by shifting the workload into the compute-bound regime of the Roofline model. Instead of evaluating one token per memory fetch, a lightweight draft model proposes a candidate sequence of tokens. The target LLM evaluates the entire proposal simultaneously in a single forward pass, transforming sequential memory-bound operations into one matrix-matrix multiplication with arithmetic intensity scaling proportionally to .
While autoregressive drafters (such as EAGLE-3 or Medusa) generate draft candidates sequentially, their draft latency scales as . Non-causal block drafters (such as DFlash) addressed this by generating all tokens in a single forward pass.
However, non-causal discrete drafters introduced an architectural limitation: the conditional independence assumption.
+---------------------------------------------------------------------------------------------------------------+
| COMPARATIVE SPECULATIVE DRAFTING PARADIGMS |
+------------------------------+---------------------------+------------------------+---------------------------+
| Architectural Attribute | Autoregressive (EAGLE-3) | Block Diffusion (DFlash)| Flow Map (FlashMap) |
+------------------------------+---------------------------+------------------------+---------------------------+
| Drafting Complexity | O(K) sequential passes | O(1) single pass | O(1) single pass |
| Inter-Token Conditioning | Strict causal conditioning| Factorized independent | Continuous joint coupling |
| Mathematical Formulation | Chain rule of probability | Factorized categorical | Continuous ODE flow field |
| Suffix Decay Penalty | Low (sequential feedback) | Catastrophic (>60% drop| Minimal (<15% drop at K=6)|
| Mean Accepted Tokens (MATL) | 3.1 - 3.8 tokens | 2.2 - 2.9 tokens | 4.6 - 5.2 tokens |
| Drafter KV Cache Overhead | High (dedicated KV cache) | Medium (Paged state) | Zero (in-place reuse) |
| Realized Wall-Clock Speedup | 2.1x - 3.2x | 3.0x - 4.2x | 4.5x - 6.1x |
| Perplexity Impact | 0.00% (strictly lossless) | 0.00% (lossless) | 0.00% (lossless) |
+------------------------------+---------------------------+------------------------+---------------------------+
1. The Factorization Trap and Suffix Decay
The fundamental flaw in previous non-causal parallel drafting models lies in the conditional independence assumption across target draft positions.
Given the target model hidden state representing context history , a factorized block drafter models the joint probability of future tokens as:
This assumption fails in structured domains like code syntax, JSON serialization, and chain-of-thought mathematical derivation.
Consider a draft block where position produces the identifier total_price and position produces the operator =. The probability distribution of token is conditionally dependent on token :
When a factorized drafter evaluates position , it conditions solely on (which ends at token ). It has no mechanism to observe that position selected total_price.
As a consequence, the mutual covariance between tokens is ignored:
During target verification via modified rejection sampling, the acceptance probability of candidate token depends on the prefix of accepted tokens:
Because fails to condition on the earlier proposed tokens, the divergence between and expands rapidly with sequence index . The cumulative acceptance probability decays exponentially:
In production deployments of DFlash, this manifests as high acceptance on position 1 (85% to 92%), followed by a sharp drop to under 20% on position 6. The GPU executes speculative verification for eight tokens but accepts barely two.
2. Continuous Flow Matching for Language Drafting
FlashMap resolves the factorization trap by formulating block generation not as discrete independent categorical classification, but as a continuous probability transport along a vector field governed by an Ordinary Differential Equation (ODE).
FLASHMAP ODE CONTINUOUS FLOW
Prior Base Latent Flow Velocity Field Data Target Latent
z₀ ~ 𝒩(0, I) ∈ ℝ^(K×d) v_θ(z_t, t | h_target) z₁ ∈ ℝ^(K×d)
┌─────────────────────────┐ ┌───────────────────────┐ ┌─────────────────────────┐
│ [Pos 1]: Gaussian Noise │ │ Vector Field Network │ │ [Pos 1]: "total" │
│ [Pos 2]: Gaussian Noise │ ──► │ Bidirectional Cross │ ───► │ [Pos 2]: "_price" │
│ [Pos 3]: Gaussian Noise │ │ and Self-Attention │ │ [Pos 3]: " =" │
│ [Pos 4]: Gaussian Noise │ │ across all K │ │ [Pos 4]: " items" │
└─────────────────────────┘ └───────────────────────┘ └─────────────────────────┘
t = 0 Euler Integration t = 1
dz_t / dt = v_θ(z_t, t | h)
Instead of predicting discrete tokens directly, FlashMap operates on continuous latent embeddings.
Let denote the continuous representations of the ground-truth target tokens across positions, and let represent a base Gaussian noise prior.
We define a time-dependent probability path for using affine interpolation:
The time derivative of this trajectory defines the target vector field:
A neural network parameterized by , denoted as , is trained to approximate this vector field by minimizing the Continuous Flow Matching (CFM) objective:
Joint Positional Coupling in the Vector Field
The critical architectural property of FlashMap is that operates on the entire block concurrently using bidirectional self-attention:
Because the attention mask across the candidate positions is unmasked (non-causal bidirectional), the vector field computed for position directly incorporates the latent states of all other positions at time .
The continuous representation captures inter-token correlations throughout the forward trajectory, eliminating the factorization error.
3. Numerical ODE Integration and Inference Latency
During online inference, the drafter starts from sampled noise and integrates the learned velocity field from to :
Solving an ODE generally requires multiple numerical integration steps (such as Runge-Kutta 4th order). In speculative decoding, every additional forward pass added to the drafter increases draft latency, eroding the wall-clock speedup.
FlashMap trains the vector field using optimal transport straight paths. Because the trajectory is linear, the vector field is nearly constant along the path:
This allows FlashMap to integrate the ODE in a single Euler step:
A single forward pass through the lightweight velocity network (typically 4 to 6 transformer layers) yields the final continuous representation .
The continuous vectors are mapped to discrete token logits via the shared language model embedding matrix :
Single-Step Euler vs. Two-Step Midpoint Latency Breakdown:
1-Step Euler ODE (Default Production Mode):
[Sample z0] ──► [v_θ Forward Pass (3.2 ms)] ──► [Unembed Logits (0.6 ms)]
Total Drafting Latency: 3.8 ms (100% of maximum speedup)
2-Step Midpoint ODE (High-Entropy / Reasoning Mode):
[Sample z0] ──► [v_θ(z0, 0)] ──► [z_mid] ──► [v_θ(z_mid, 0.5)] ──► [Logits]
Total Drafting Latency: 7.1 ms (Trade-off: +8% acceptance length)
4. Lossless Speculative Verification and Tree Attention
A non-negotiable requirement for production inference is distribution preservation. If speculative decoding alters the output text or degrades benchmark scores, it cannot be deployed in mission-critical applications.
FlashMap guarantees exact distribution preservation using modified rejection sampling.
The Rejection Sampling Invariant
Let be the draft distribution emitted by FlashMap for position , and let be the true distribution computed by the target LLM.
For each proposed token in the block , the verification engine evaluates:
- Sample uniform variable .
- If , accept .
- If , reject , discard all subsequent candidates , and sample a replacement token from the normalized residual distribution:
Mathematically, the probability of the accepted token matches the target model distribution:
The target model's output distribution remains unmodified. FlashMap functions purely as a hardware-level accelerator.
5. Production Implementation in PyTorch
The following complete PyTorch implementation demonstrates the FlashMap continuous flow drafter module, including the vector field network, Euler integration step, and speculative candidate generation.
import torch
import torch.nn as nn
import torch.nn.functional as F
class FlashMapFlowVelocityNetwork(nn.Module):
"""
Continuous Flow Map Drafter (FlashMap).
Parameterizes the vector field v_theta(z_t, t | h_target)
for multi-token block speculative decoding.
"""
def __init__(
self,
hidden_dim: int = 4096,
drafter_layers: int = 5,
num_heads: int = 32,
block_size: int = 8,
vocab_size: int = 151936
):
super().__init__()
self.hidden_dim = hidden_dim
self.block_size = block_size
self.vocab_size = vocab_size
# Positional embedding for the draft block tokens (1 to K)
self.block_pos_embed = nn.Embedding(block_size, hidden_dim)
# Continuous time step embedding (t in [0, 1])
self.time_mlp = nn.Sequential(
nn.Linear(hidden_dim, hidden_dim),
nn.SiLU(),
nn.Linear(hidden_dim, hidden_dim)
)
# Non-causal bidirectional transformer layers
encoder_layer = nn.TransformerEncoderLayer(
d_model=hidden_dim,
nhead=num_heads,
dim_feedforward=hidden_dim * 4,
dropout=0.0,
activation="gelu",
batch_first=True,
norm_first=True
)
self.transformer = nn.TransformerEncoder(encoder_layer, num_layers=drafter_layers)
# Output projection for velocity field
self.velocity_out = nn.Linear(hidden_dim, hidden_dim)
self.norm = nn.LayerNorm(hidden_dim)
def _sinusoidal_time_embedding(self, t: torch.Tensor) -> torch.Tensor:
"""Embeds continuous time t in [0, 1] using sinusoidal frequencies."""
half_dim = self.hidden_dim // 2
freqs = torch.exp(-torch.arange(half_dim, device=t.device) * (9.210340371976184 / (half_dim - 1)))
args = t[:, None] * freqs[None, :]
embedding = torch.cat([torch.sin(args), torch.cos(args)], dim=-1)
return self.time_mlp(embedding)
def forward(
self,
z_t: torch.Tensor,
t: torch.Tensor,
h_target: torch.Tensor
) -> torch.Tensor:
"""
Calculates the velocity vector field v_theta.
Args:
z_t: Current latent state of shape [B, K, D]
t: Scalar time tensor of shape [B]
h_target: Final hidden state from target model [B, 1, D]
Returns:
v_t: Velocity vector of shape [B, K, D]
"""
B, K, D = z_t.shape
pos_ids = torch.arange(K, device=z_t.device).unsqueeze(0).expand(B, K)
pos_emb = self.block_pos_embed(pos_ids)
# Condition on continuous time step
t_emb = self._sinusoidal_time_embedding(t).unsqueeze(1) # [B, 1, D]
# Inject target context into every position in the draft block
x = z_t + pos_emb + t_emb + h_target
# Evaluate non-causal bidirectional self-attention
hidden = self.transformer(x)
v_t = self.velocity_out(self.norm(hidden))
return v_t
class FlashMapDrafter(nn.Module):
"""
FlashMap Speculative Engine Runner.
Executes single-step Euler integration to propose candidate blocks.
"""
def __init__(self, velocity_net: FlashMapFlowVelocityNetwork, unembed_weight: torch.Tensor):
super().__init__()
self.velocity_net = velocity_net
self.unembed_weight = unembed_weight # Shared LM head [Vocab, Hidden]
@torch.inference_mode()
def draft_block(
self,
h_target: torch.Tensor,
temperature: float = 0.0
) -> torch.Tensor:
"""
Proposes K speculative tokens in one O(1) Euler ODE forward pass.
Args:
h_target: Target model context vector [B, 1, D]
temperature: Sampling temperature (0.0 for greedy argmax)
Returns:
draft_token_ids: Proposed candidate token IDs of shape [B, K]
"""
B = h_target.shape[0]
K = self.velocity_net.block_size
D = self.velocity_net.hidden_dim
# 1. Sample base Gaussian noise prior z_0 ~ N(0, I)
z_0 = torch.randn(B, K, D, device=h_target.device, dtype=h_target.dtype)
t_0 = torch.zeros(B, device=h_target.device, dtype=h_target.dtype)
# 2. Evaluate velocity vector field at t = 0
v_0 = self.velocity_net(z_0, t_0, h_target)
# 3. 1-Step Euler ODE integration: z_1 = z_0 + delta_t * v_0 (delta_t = 1.0)
z_1 = z_0 + v_0
# 4. Project continuous representation to vocabulary logits
logits = F.linear(z_1, self.unembed_weight) # [B, K, Vocab]
# 5. Token selection
if temperature > 0.0:
probs = F.softmax(logits / temperature, dim=-1)
draft_token_ids = torch.multinomial(probs.view(-1, self.velocity_net.vocab_size), num_samples=1).view(B, K)
else:
draft_token_ids = torch.argmax(logits, dim=-1)
return draft_token_ids
6. Serving Integration and Kernel Execution in vLLM / SGLang
Integrating FlashMap into industrial runtimes like vLLM and SGLang requires coordinating three sub-systems: memory allocation, draft execution, and verification kernels.
VLLM ENGINE INTEGRATION
Target Model Forward (Step t)
│
▼ Emits target hidden state h_target (FP16/BF16)
┌────────────────────────────────────────────────────────┐
│ FlashMap Drafter (CUDA Stream A) │
│ - Reads h_target directly in SRAM │
│ - Evaluates 1-step Euler ODE │
│ - Zero auxiliary drafter KV cache allocation │
│ - Emits candidate token block (K=8 tokens) │
└──────────┬─────────────────────────────────────────────┘
│
▼ Candidate block passed to target worker
┌────────────────────────────────────────────────────────┐
│ Target Verification Kernel (CUDA Stream B) │
│ - FlashInfer / FlashAttention-3 Tree Attention │
│ - Evaluates all K tokens in single forward pass │
│ - Modified rejection sampling kernel │
│ - Updates PagedAttention KV cache with accepted tokens│
└────────────────────────────────────────────────────────┘
Zero-Drafter-Side KV Cache Footprint
Standard speculative decoding engines allocate a parallel KV cache for the draft model. In long-context serving (32k to 128k tokens), the drafter KV cache consumes 15% to 25% of total High Bandwidth Memory, limiting the engine's maximum concurrency.
Because FlashMap parameterizes draft generation as an ODE conditioned strictly on the target model's final hidden state , the drafter requires zero historical KV cache. The memory overhead per request is limited to the current latent tensor (less than 128 KB of temporary memory), freeing GPU capacity for user requests.
7. Empirical Hardware Benchmarks and Performance Analysis
FlashMap was evaluated across frontier open-weight models including Qwen3-8B, LLaMA-3.3-70B, and DeepSeek-V3 on NVIDIA H100 SXM5 (80GB HBM3) and consumer workstation hardware (NVIDIA RTX 4090 / 5090).
+---------------------------------------------------------------------------------------------------------------+
| FLASHMAP PRODUCTION INFERENCE BENCHMARK (Qwen3-8B on NVIDIA H100 SXM5) |
+------------------------------+--------------------+---------------------+--------------------+----------------+
| Metric Evaluation | Baseline vLLM | vLLM + EAGLE-3 | vLLM + DFlash | vLLM + FlashMap|
+------------------------------+--------------------+---------------------+--------------------+----------------+
| Decoding Mode | Autoregressive | Autoregressive Draft| Discrete Diffusion | Continuous Flow|
| Draft Block Size (K) | N/A | 6 tokens | 8 tokens | 8 tokens |
| Draft Forward Passes | 0 | 6 passes (O(K)) | 1 pass (O(1)) | 1 pass (O(1)) |
| Drafting Latency | 0.0 ms | 14.8 ms | 3.6 ms | 3.8 ms |
| Target Verification Latency | 8.4 ms (1 token) | 11.2 ms (6 tokens) | 12.1 ms (8 tokens) | 12.1 ms (8 tok)|
| Mean Accepted Tokens (MATL) | 1.00 token/step | 3.24 tokens/step | 2.45 tokens/step | 4.92 tok/step |
| Acceptance at Position 1 | 100.0% | 86.4% | 88.1% | 93.4% |
| Acceptance at Position 4 | N/A | 64.2% | 35.2% | 81.2% |
| Acceptance at Position 6 | N/A | 51.0% | 18.4% | 72.5% |
| Inter-Token Latency (ITL P50)| 8.40 ms/tok | 3.45 ms/tok | 2.88 ms/tok | 1.62 ms/tok |
| Peak Wall-Clock Speedup | 1.00x | 2.43x | 3.12x | 5.18x |
| Code Generation Peak Speedup | 1.00x | 2.81x | 3.40x | 6.12x |
| Output Distribution Drift | 0.00 (Exact Match) | 0.00 (Exact Match) | 0.00 (Exact Match) | 0.00 (Exact) |
+------------------------------+--------------------+---------------------+--------------------+----------------+
Observations from Production Telemetry
- Elimination of Suffix Collapse: At draft position 6, DFlash experiences an acceptance crash down to 18.4%. FlashMap preserves a 72.5% acceptance rate at position 6, proving that continuous flow ODEs effectively propagate inter-token grammatical constraints.
- Wall-Clock Gains on High Arithmetic Intensity: In code generation benchmarks (HumanEval and SWE-bench), FlashMap hits a 6.12x wall-clock speedup. Because coding syntax exhibits high predictability when joint position coupling is preserved, the target model accepts complete multi-line blocks in single verification steps.
- Consumer Hardware Viability: On a single NVIDIA RTX 4090 (24GB VRAM), running Qwen3-8B in FP8 with FlashMap generates 142 tokens per second, compared to 28 tokens per second on vanilla autoregressive decoding.
8. Architectural Dilemmas and Practitioner Rules
When integrating continuous flow speculative drafters into production clusters, senior engineers should manage three concrete operational parameters:
- Block Length Selection ( vs. ): Setting maximizes speedups on structured code generation and structured JSON generation. However, on creative writing and open-ended dialogue, high semantic entropy reduces token acceptance beyond position 5. In conversational agent pools, configuring minimizes verification compute overhead.
- Velocity Network Capacity: Training a drafter with more than 6 layers yields diminishing returns. A 4-layer or 5-layer velocity model matches the representation capacity required for ODE transport while keeping kernel execution under 4 milliseconds on Hopper Tensor Cores.
- Shared LM Head vs. Independent Projection: Reusing the target model's language model unembedding weights () saves hundreds of megabytes of GPU memory. However, initializing an independent, low-rank projection layer () during flow matching training yields a 4% increase in draft acceptance on technical corpora.
