Papers
Topics
Authors
Recent
Search
2000 character limit reached

Mirror Speculative Decoding

Updated 2 July 2026
  • Mirror Speculative Decoding is an inference algorithm for LLMs that breaks the serial latency-acceptance tradeoff using early-exit proxies and branch-complete rollouts.
  • It employs GPU and NPU parallelism with heterogeneous accelerator mapping to overlap draft generation and target verification, significantly reducing overall latency.
  • Empirical evaluations show up to 5.8× speedups and about 30% improvement over previous methods, validating its effectiveness for server-scale LLM inference.

Mirror Speculative Decoding (Mirror-SD) is an inference algorithm for LLMs that breaks the serial latency-acceptance tradeoff of prior speculative decoding (SD) approaches. By orchestrating cross-accelerator parallelism between GPUs and NPUs, leveraging early-exit token proxies, and utilizing multi-token speculative streaming, Mirror-SD delivers substantially higher throughput and wall-time speedups for server-scale LLMs without compromising generation correctness or acceptance rate semantics (Bhendawade et al., 15 Oct 2025).

1. High-Level Architecture

Mirror-SD generalizes the classic speculative decoding framework, which accelerates slow, autoregressive LLM inference using a smaller draft model. Traditional SD proceeds serially: the draft proposes a “speculative window” of future tokens, which the target verifies, creating a coupling between draft generation latency and accepted token rate. Mirror-SD departs from this serial regime through two principal innovations:

Early-Exit Proxies & Branch-Complete Rollouts: At a selected early-exit layer e\ell_e in the target model, the algorithm extracts a top-κ\kappa proxy distribution over possible next tokens. Only these κ\kappa tokens and their log-probabilities are transmitted to the draft model via a lightweight token channel. The draft then initiates full γ\gamma-token branch-complete rollouts from each proxy root in parallel, speculating continuations for the target to verify.

Heterogeneous Accelerator Mapping: The target model runs on GPUs with Megatron tensor-parallel (TP) sharding, optimized for high-fidelity, latency-sensitive verification. The draft model runs on co-located NPUs under SPD sharding, requiring only two global collectives per forward pass. This design ensures that draft generation is entirely overlapped with the target’s suffix computation, effectively hiding draft latency as long as the draft computation time $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$ remains below the overlap budget Δ\Delta.

This combination enables higher speculative window sizes (and thus higher acceptance rates) without incurring proportional increases in generation latency.

2. Stepwise Algorithmic Procedure

One Mirror-SD decoding step at position tt to generate a window of length γ\gamma proceeds as follows:

  1. Target Prefix & Early Exit: Compute activation up to e\ell_e, extract the top-κ\kappa token proxy, and transmit to the draft.
  2. Target Suffix & Verification (in parallel): Run forward from κ\kappa0 to κ\kappa1 using cached key/value memory, then compare the default drafted branch against target outputs to determine the accepted prefix length κ\kappa2 and any required correction.
  3. Draft Branch-Complete Speculation (in parallel): For each of the κ\kappa3 proxy roots, roll out κ\kappa4 tokens (branch-complete speculation), fully parallelized under SPD sharding.
  4. Reuse or Fallback Decision: If the required correction exists in the draft hypothesis tree, it is reused; otherwise, the draft generates fresh continuations from the accepted prefix plus correction.
  5. Commit Accepted Prefix: Accept κ\kappa5 tokens from the draft default branch.

This schedule is further detailed in the pseudocode provided in (Bhendawade et al., 15 Oct 2025), ensuring maximum overlap and low token-channel overhead.

3. Acceptance, Latency, and Stepwise Speedup Formulas

Define the accepted prefix length at step κ\kappa6 as κ\kappa7 and the window-normalized acceptance rate as

κ\kappa8

For vanilla SD, per-step latency is strictly serial:

κ\kappa9

where κ\kappa0 is the draft cost and κ\kappa1 the verification.

Mirror-SD introduces a parallel-overlap regime:

κ\kappa2

where κ\kappa3 is the rendezvous (token exchange) cost, and κ\kappa4 is the suffix compute time after early exit. If κ\kappa5, draft computation becomes “free,” decoupling accepted token rate from draft latency.

The stepwise speedup is given by

κ\kappa6

typically reducing to κ\kappa7 when κ\kappa8.

4. Orchestration of GPU/NPU Parallelism

The deployment architecture consists of clusters of Apple M2 Ultra nodes, each with a GPU and NPU linked via UltraFusion. Distributed computation uses:

  • Target on GPU with Megatron TP (κ\kappa9): Each Transformer block performs two AllReduce collectives; total target communication

γ\gamma0

where γ\gamma1.

  • Draft on NPU with SPD TP (γ\gamma2): Draft depth γ\gamma3 is split into segments requiring only two global synchronizations per forward pass; per-step communication is

γ\gamma4

with γ\gamma5.

  • Cross-accelerator Token Channel: The rendezvous cost for token transmission is γ\gamma6s, negligible compared to compute latency.

By mapping the draft to NPUs and target to GPUs, and exploiting the low synchronization overhead of SPD, the system enables deep draft speculation to be overlapped under the target’s critical path.

5. Multi-Token Speculative Streaming

To further minimize γ\gamma7, Mirror-SD employs Speculative Streaming (SS) for the draft model. In SS, the draft maintains γ\gamma8 parallel lookahead streams, each forward pass potentially emitting multiple tokens. Let γ\gamma9 be tokens emitted at draft step $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$0; define

$T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$1

with total draft cost

$T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$2

where $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$3 and $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$4 are local computation and synchronization respectively. Empirically, $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$5–$T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$6, yielding a $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$7–$T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$8 reduction in draft compute steps and overall draft latency. SS is applied only to the draft, so acceptance semantics and target correctness remain lossless.

6. Empirical Evaluation on SpecBench

Mirror-SD is evaluated on models (Qwen3-14B, Qwen3-32B, Mistral-24B, OPT-66B) using the SpecBench suite, encompassing translation, summarization, question answering, mathematical reasoning, retrieval-augmented generation, and multi-turn conversation. Experiments are run with batch size $T_{\mathrm{draft}^{\mathrm{gen}}(\gamma)$9, Δ\Delta0, Δ\Delta1, and early exit at half-depth, comparing against Vanilla-SD, Medusa, Hydra, EAGLE, EAGLE-2, EAGLE-3, Recycling, PLD, SpS, REST, and Lookahead under both greedy (Δ\Delta2) and stochastic (Δ\Delta3) decoding.

Speedup results are summarized as follows:

Model/Task EAGLE3 Medusa Vanilla-SD Mirror-SD
Qwen3-14B (Translation, Δ\Delta4) 2.53× 1.65× 2.34× 4.13×
Qwen3-14B (Math Reasoning, Δ\Delta5) 3.36× 2.12× 2.80× 5.32×
Qwen3-32B (Translation, Δ\Delta6) 2.52× 1.56× 2.74× 3.72×

Mirror-SD consistently outperforms all baselines, delivering Δ\Delta7–Δ\Delta8 wall-time speedups and ~30% average improvement over the previous best (EAGLE-3).

7. Limitations and Prospective Research

Mirror-SD’s effectiveness is subject to several critical dependencies and operational nuances:

  • Overlap Budget Sensitivity: Gains are realized only if Δ\Delta9; overly large tt0, tt1, or shallow tt2 choices reduce overlap, re-exposing draft latency.
  • Hardware Heterogeneity: High-speed GPU/NPU interconnects are assumed; on platforms with lower inter-device bandwidth, rendezvous and collective communication may become bottlenecks.
  • Draft Parity Requirement: Correctness requires that the draft branch used for verification matches vanilla SD’s AR draft distribution; deviation could bias acceptance.
  • Batch Size Scaling: As batch size tt3 increases, draft overhead grows (tt4), reducing the overlap fraction; ablations show moderate batch sizes remain effective, but extreme batching diminishes benefit.

Potential avenues for further work include:

  • Adaptive early-exit layer selection (tt5) to maximize hardware overlap without accuracy loss.
  • Dynamic scheduling of tt6 according to uncertainty or fallback statistics.
  • Porting to on-device SoCs and exploring real-time/energy tradeoffs.
  • Integration with dynamic inference methods such as token merging or adaptive span selection.
  • Architectural co-design of speculation engines within future accelerator hardware.

Mirror-SD demonstrates that systems–algorithm co-design enables breaking the serial speculative barrier in LLM inference, with multi-token streaming and branch-parallel rollouts on heterogeneous clusters enabling substantial decoding speedup while preserving correctness guarantees (Bhendawade et al., 15 Oct 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Mirror Speculative Decoding (Mirror-SD).