Introduction
In speculative decoding a cheap drafter proposes a block of future tokens and the target checks them in one forward pass; the longest prefix of drafts that matches the target's greedy choices is accepted, and the target adds one token of its own. What a round buys is the acceptance length , tokens per target forward, and what it costs is the drafter's own time.
The drafters this task compares are small networks that read the target's hidden states. Medusa attaches several decoding heads to the target [1]; EAGLE-3 scales up this acceleration through training-time test [2]; Gumiho mixes architectures to favour the early, most valuable positions of the block [3]. A second family drafts the whole block in parallel: PARD adapts a small draft model to predict several positions at once [4], DFlash denoises a block in one pass [5], DSpark drafts semi-autoregressively with a confidence schedule [6], and Domino separates causal modelling from the drafting itself [7].
Three properties of the problem shape our design.
The deep positions of a block are underdetermined. The target's features describe the verified prefix. The first draft position is nearly fixed by them; the sixth depends on five tokens the drafter has not seen, and a parallel drafter that predicts each position from its own marginal produces blocks that are individually plausible but jointly inconsistent, for example the same token repeated.
A small head trained from scratch learns language slowly. Within a fixed training budget, a randomly initialised drafter spends much of its training learning what any pretrained language model already knows. The task allows a small pretrained model of the target's tokenizer family to be loaded, but its hidden space is not the target's.
Acceptance is a prefix property. A draft at position counts only if positions were accepted, so the training signal at deep positions is worth less, and teacher-forced training data whose intermediate tokens the target would not itself have chosen teaches the drafter about continuations that will never be verified.
Method
Our drafter, SD-TARD (split-depth, target-aligned residual drafter), has four parts: a pretrained small language model as the backbone, target features written into its residual stream through gated adapters, a split-depth layout that runs the context through fewer layers than the block, and a sequential reranker over a per-position shortlist.
The backbone and the target-aligned injection
We load every layer of the small pretrained model, its embedding and its final norm, and keep its tied embedding as the output layer. The block for anchor consists of the anchor itself (slot 0) and mask positions. The mask embedding is not the tokenizer's mask token, whose prediction the pretrained model treats as almost certain; it is a small vector, the RMS-normalised mean of embedding rows 200 to 499 scaled by 0.025, plus a learned, bounded per-slot offset.
The target supplies, at every verified position, its hidden states after several feature layers and its final normalised state. We first put each feature layer into the coordinates of the target's output: the stream is RMS-normalised, multiplied by the target's final norm weight , and normalised again. For each injection point we fuse the streams with per-coordinate weights, a fixed prior per stream plus a learned correction:
The priors put weight on shallow streams at shallow injection points and on deep streams at deep ones. To carry into the small model we fit, once at build time, a ridge map from the target's space to the small model's. With the target's unembedding, the small model's embedding and its final norm weight,
so that for any target vector , the small model's logits of reproduce the target's logits of in least squares over the vocabulary. The vocabulary is shared, which is what makes this map well defined without any training.
def _fuse_group(self, th, tl, group_slice):
orig = tl.shape[:-1]
dt = tl.dtype
h5_raw = th.reshape(*orig, self.n_feat, self.d_target)
h5_aligned = _unit_rms(_unit_rms(h5_raw) * self.w4_norm.to(dt))
tl_aligned = _unit_rms(tl).unsqueeze(-2)
st = torch.cat([h5_aligned, tl_aligned], dim=-2)
sw = (self.stream_prior[group_slice].float() + _decouple_lr(self.stream_delta, 15.0)[group_slice].float()).to(dt)
fused = torch.einsum("...sd,gsd->g...d", st, sw)
lin = F.linear(fused, self.P_4to06.to(dt))
return fused, linEach injection is a dual-gated adapter. A linear path takes the RMS-normalised ; a nonlinear path is a rank-256 SiLU bottleneck on ; each path is RMS-normalised and gated per attention head by of a zero-initialised scalar, and the sum is multiplied by a fixed scale that grows with depth:
Because the gates start at zero, the injections are zero when training starts. Each verified token receives the target's features at , the state that predicted it, before layers 12 and 18 (counting from zero), and a third injection is added to its state where the top layers begin. The positions of the block receive the target's last available features together with the anchor's embedding, through a second bank with a learned bias per slot: the masks before layers 12 and 18, the whole block where the top layers begin, before layer 25 and just before the final norm.
def forward(self, fs_u, lin_proj, valid_mask):
orig = fs_u.shape[1:-1]
dt = fs_u.dtype
N = fs_u[0].numel() // self.d_in
x = fs_u.reshape(self.G, N, self.d_in)
lp = lin_proj.reshape(self.G, N, self.d_out)
wd = _decouple_lr(self.down_w, self.lr_w).to(dt)
wu = _decouple_lr(self.up_w, self.lr_w).to(dt)
act = _unit_rms(F.silu(torch.bmm(x, wd.transpose(1, 2))))
u_mlp = _unit_rms(torch.bmm(act, wu.transpose(1, 2))).view(self.G, N, self.nh, self.hd)
u_lin = _unit_rms(lp).view(self.G, N, self.nh, self.hd)
gl = torch.tanh(_decouple_lr(self.gate_lin, self.lr_gl).float()).to(dt)
gm = torch.tanh(_decouple_lr(self.gate_mlp, self.lr_gm).float()).to(dt)
comb = (gl * u_lin + gm * u_mlp).reshape(self.G, N, self.d_out)
vm = valid_mask.reshape(1, N, 1).to(dt)
out = (comb * self.scales.to(dt)) * vm
return out.reshape(self.G, *orig, self.d_out)The weights of the new modules are reparametrised so that their effective step is a multiple of the learning rate while their gradients enter gradient clipping unscaled: the forward pass uses , which has value and gradient one with respect to . This lets the new parameters move quickly while the pretrained backbone trains at the small base learning rate of 4.5e-5 that we set.
Split depth
The verified context is long and changes by a few tokens per round; the block is short and is what
the target verifies. We therefore run the context through the first 23 layers only
(L_SPLIT = 23) and keep its keys and values, for every layer, in a per-sequence cache. For the remaining top
layers, the context's keys and values are computed from its state after those 23 layers plus the
third context injection, with no
further attention or MLP on the context, while the block's queries run through every layer and
attend to those keys and, causally, to each other.
h_ctx_top = h_r + c_inj[2]
cos_b, sin_b = m.rope(h_blk, b_anc + b_slot)
cos_cb = torch.cat([cos_r, cos_b], dim=2)
sin_cb = torch.cat([sin_r, sin_b], dim=2)
ctx2_ok = torch.arange(S, device=dev)[None, None, :] < b_anc[:, :, None]
blk2_ok = (b_anc[:, :, None] == b_anc[:, None, :]) & (b_slot[:, None, :] <= b_slot[:, :, None])
mask_b2 = _neg_mask(torch.cat([ctx2_ok, blk2_ok], dim=2), dt)[:, None]
for li in range(m.L_SPLIT, len(m.layers)):
if li == m.L_SPLIT:
h_blk = h_blk + b_inj_flat[0]
elif li == 25:
h_blk = h_blk + b_inj_flat[1]
lay = m.layers[li]
qb_t, kf, vf = lay.forward_qkv_split(h_ctx_top, h_blk, cos_cb, sin_cb, cos_b, sin_b)
ob = F.scaled_dot_product_attention(
qb_t, kf.repeat_interleave(lay.rep, 1), vf.repeat_interleave(lay.rep, 1),
attn_mask=mask_b2, scale=lay.scaling,
)
h_blk = h_blk + lay.o_proj(ob.transpose(1, 2).reshape(bsz, Q_b, -1))
h_blk = lay.mlp_step(h_blk)
h_out = m.norm(h_blk + b_inj_flat[2])A sequential reranker over the block
The backbone gives each block position a shortlist of its most likely tokens (24, or the number of candidates requested if larger) with their log-probabilities . Those marginals are computed in parallel and know nothing about which token was chosen at the previous position. A small reranker walks the block from left to right. Position 0 is scored by its marginal alone. At position a candidate is scored as
where is a sharpened soft choice over the previous position's candidates. The transition adds three terms, each bounded by a with a learned gate: a bilinear score between predecessor and successor token encodings, modulated by a context vector built from the backbone state, the anchor features and the previous positions' confidence and entropy; a learned bonus or penalty for repeating the predecessor token; and, for the 12 best predecessors, a SwiGLU prediction of the next target-space vector scored against the target's own unembedding rows of the successor candidates. is an attention over the anchor and the soft choices at all positions before . The highest-scoring candidates per position are returned, best first.
w_list = [w_prev]
for i in range(1, L):
loc_i = torch.einsum("bp,bpc->bc", w_prev, T_loc[:, i - 1])
if i == 1:
num = AB_anc[:, 0]
den = A_anc[:, 0].unsqueeze(1)
else:
ti = i - 2
W_j = torch.stack(w_list[:i - 1], dim=1)
den = A_anc[:, i - 1].unsqueeze(1) + torch.einsum("bjs,bjsh->bh", W_j, A_tbl[:, ti, :i - 1]).unsqueeze(1)
num = AB_anc[:, i - 1] + torch.einsum("bjs,bjsch->bch", W_j, AB_tbl[:, ti, :i - 1])
hist_i = (num / den.clamp_min(1e-6)).sum(-1)
sci = u_sc[i] * unary_logits[:, i].float() + loc_i + hist_i
all_sc.append(sci)
w_prev = torch.softmax(sci / self.TAU_SEL, dim=-1)
w_list.append(w_prev)
Training objective
For each training conversation we sample anchor positions, up to 256 when it has answer tokens and preferring those, and draft a block from each (a subset of them carries the mask positions). Every block position is distilled towards the target's distribution restricted to its 64 most likely tokens and towards its greedy token,
with a weight that combines three factors: positions decay as with slot ; prompt tokens count a quarter of answer tokens; and a branch weight , where
is the target's relative preference for the data tokens inside the block, measured against its own argmax. A block whose intermediate tokens the target would not have produced is a continuation that greedy verification will never reach, and it is down-weighted rather than discarded. The reranker is trained on the same blocks with teacher-forced predecessors, against the target's probabilities on the shortlist and its greedy token, and enters the loss with weight 0.08.
with torch.no_grad():
branch_c = torch.ones_like(b_anc, dtype=torch.float32)
for m_step in range(1, L):
active_m = (b_slot >= m_step) & valid_q
p_rel = ((b_anc + m_step - 1) - f_off).clamp(min=0, max=n_sub - 1)
branch_c = torch.where(active_m, branch_c * pi_sub.gather(1, p_rel), branch_c)
base_slot_w = torch.tensor([1.15 if (j == 0 and m.HORIZON_DISTILL) else max(0.88 ** j, 0.55) for j in range(L)], device=dev, dtype=torch.float32)
dom_w = torch.where(is_ans, torch.ones_like(branch_c), torch.full_like(branch_c, 0.25))
q_weight = valid_q.float() * dom_w * base_slot_w[b_slot] * (0.25 + 0.75 * branch_c)
dl_all = m.lm_logits(h_out)
total_num, total_den = _chunked_distill_loss(dl_all, rel_fpos, b_slot, q_weight, ti64, tp64_base, tp64_sharp, m.HORIZON_DISTILL)
if total_den.item() <= 0:
return h_out.float().sum() * 0.0
base_loss = total_num / total_den.clamp_min(1e-6)The submission also fits, after training, a per-slot logistic model of whether each drafted token will be accepted, and uses the resulting survival curve to choose how many drafts to submit when verification is priced. When it is not, all drafts are submitted and this part has no effect.
Results
| Method | ① | ② | ③ | ④ | ⑤ | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| τ, first benchmark ↑ | τ, second benchmark ↑ | τ, third benchmark ↑ | τ, first benchmark ↑ | τ, second benchmark ↑ | τ, third benchmark ↑ | τ, first benchmark ↑ | τ, second benchmark ↑ | τ, third benchmark ↑ | Effective τ, GSM8K ↑ | Effective τ, MATH-500 ↑ | Effective τ, AIME25 ↑ | Effective τ, HumanEval ↑ | Effective τ, MBPP ↑ | Effective τ, LiveCodeBench ↑ | Effective τ, MT-Bench ↑ | Effective τ, Alpaca ↑ | Effective τ, Arena-Hard v2 ↑ | Speed-up, batch 1 ↑ | Speed-up, batch 16 ↑ | |
| Gemini 4 Carbon | 5.999 | 5.842 | 5.358 | 3.427 | 3.255 | 3.745 | 1.944 | 1.162 | ||||||||||||
| No drafter | 1.014 | 1.007 | 1.006 | 1.004 | 1.002 | 1.001 | 1.002 | 1.003 | 1.007 | 0.751 | 0.746 | 0.745 | 0.743 | 0.743 | 0.742 | 0.742 | 0.743 | 0.746 | 0.812 | 0.741 |
| Medusa-1 | 2.776 | 2.772 | 2.421 | 2.258 | 2.346 | 2.157 | 1.761 | 1.698 | 1.622 | 2.364 | 2.358 | 2.094 | 1.955 | 2.020 | 1.884 | 1.569 | 1.517 | 1.431 | 1.421 | 0.985 |
| EAGLE-3 | 5.192 | 5.008 | 4.422 | 4.280 | 4.005 | 4.598 | 2.677 | 2.512 | 2.834 | 3.922 | 3.815 | 3.404 | 3.305 | 3.116 | 3.541 | 2.222 | 2.095 | 2.346 | 1.940 | 1.076 |
| DFlash | 5.292 | 5.040 | 4.443 | 4.294 | 4.034 | 4.580 | 2.740 | 2.576 | 2.805 | 4.057 | 3.891 | 3.475 | 3.385 | 3.192 | 3.596 | 2.305 | 2.179 | 2.362 | 2.309 | 1.348 |
| DSpark | 5.704 | 5.375 | 4.795 | 4.597 | 4.365 | 4.878 | 2.858 | 2.694 | 2.890 | 4.287 | 4.063 | 3.660 | 3.529 | 3.352 | 3.740 | 2.342 | 2.215 | 2.387 | 2.272 | 1.346 |
| DFlash 2 | 5.804 | 5.534 | 4.987 | 4.776 | 4.491 | 5.106 | 2.991 | 2.814 | 3.097 | 4.349 | 4.164 | 3.791 | 3.632 | 3.426 | 3.897 | 2.427 | 2.285 | 2.538 | 2.486 | 1.202 |
| Domino | 5.661 | 5.374 | 4.785 | 4.587 | 4.365 | 4.826 | 2.913 | 2.749 | 2.900 | 4.265 | 4.080 | 3.680 | 3.540 | 3.372 | 3.725 | 2.399 | 2.267 | 2.412 | 2.297 | 1.349 |
| Gumiho | 4.340 | 4.065 | 3.564 | 3.239 | 3.319 | 3.241 | 2.378 | 2.281 | 2.244 | 3.419 | 3.222 | 2.873 | 2.648 | 2.698 | 2.671 | 2.029 | 1.953 | 1.953 | 1.844 | 1.170 |
| PARD | 5.218 | 5.090 | 4.536 | 4.271 | 3.994 | 4.443 | 2.876 | 2.729 | 3.229 | 3.995 | 3.922 | 3.539 | 3.374 | 3.168 | 3.508 | 2.395 | 2.291 | 2.667 | 1.812 | 1.171 |
- ① Qwen3-4B target · one trained drafter, 7 drafts per round · GSM8K / MATH-500 / AIME25
- ② same drafter · HumanEval / MBPP / LiveCodeBench
- ③ same drafter · MT-Bench / Alpaca / Arena-Hard v2
- ④ same drafter · all nine benchmarks · priced verification (c = 0.05)
- ⑤ same drafter · decoding speed-up over plain decoding, batch 1 and batch 16
On the acceptance length SD-TARD is ahead of every published baseline in every column of the two settings where this run was measured. On Math it reaches 5.999, 5.842 and 5.358 on the three columns, against 5.804, 5.534 and 4.987 for the strongest baseline, DFlash 2. On Chat the margin is larger in relative terms: 3.427, 3.255 and 3.745, against 2.991 and 2.814 for DFlash 2 on the first two columns and 3.229 for PARD [4] on the third. The closest baseline in kind, PARD, which also adapts a small pretrained model to draft in parallel, reaches 5.218 and 2.876 on the first column of the two settings.
The wall-clock picture is different. On Speed-up our speed-up is 1.944 on the first measure, below DFlash 2 at 2.486 and below DFlash, Domino and DSpark, and just above EAGLE-3 at 1.940. On the second measure we reach 1.162 against 1.349 for Domino [7], below six of the published baselines. The longer accepted blocks do not pay for the drafter's own time. Our reading, which we did not isolate in a measurement on this setting, is that a pretrained backbone that runs its block queries through every layer, and a reranker that walks the block position by position, cost more per round than the drafters that lead on speed.
How we got here
We began by reading the eight reference drafters and reproducing them on a development corpus of our own target rollouts, and found that with a short training run most of the randomly initialised block drafters barely moved off one token per round, while PARD, which starts from the pretrained small model, was clearly ahead. That observation set the direction.
- Four first architectures, one survivor. Our first round compared a drafter trained from scratch with coordinate-aligned target features, two drafters built from the target's own layers, and a first version of the target-aligned small-model drafter. In that short development run the scratch drafter stayed near one token per round (1.03 in our measurement), the target-layer variants reached 1.14 and 1.66, and the small-model drafter 1.34. We continued with the last, and probes of it traced its early losses to initialisation problems.
- Fixing initialisation. Probes of the first small-model drafter showed that the tokenizer's mask token makes the pretrained model predict one token with near certainty, and we reasoned that adapters initialised at zero in both factors sit at a saddle point; the first gave the current mask embedding, the second the dual-gated adapter, whose linear and nonlinear paths have separate gates. A probe of the pretrained small model showed that running the context through only 22 of its layers while the queries ran through all of them kept its zero-shot agreement with the target's greedy tokens at 0.795 against 0.806 for the full depth, which is the basis of the split-depth layout.
- Coordinates before mixing. A recent study we read argues that the target's embedding, layers and output share one coordinate basis, which a dense projection of concatenated feature layers scrambles. Our own probe of the target found per-stream scales differing by more than an order of magnitude. This is why each feature stream is first normalised into the coordinates of the target's output and the streams are fused with per-coordinate weights rather than a dense projection.
- The ridge map. We tried low-rank and nonlinear bridges from the target's space into the small model's; in our probe a rank-256 linear bridge capped zero-shot agreement at about 32% against 67% for the full-rank map, and a SiLU on the projection destroyed most of it, so the linear highway is full rank and the nonlinearity sits in a separate path.
- Abandoned additions. A token-shift bridge in the middle of the network (development of
3.05 against 3.06 without it, in a comparison that also moved the split by one layer) and an expert built from the target's last layer on slot 0 were
dropped. A version that combined a horizon-aware distillation, with a sharper target on slot 0 and a
broader one on the masked slots, with other changes to the reranker's input and the training
chains improved our development from 3.70 to 3.73 in its last full run, but a version
of it with a shorter training time did not finish before the run ended. The submitted file keeps
that objective behind a switch that is off (
HORIZON_DISTILL = False). - The reranker. The repetition and inconsistency of parallel drafts was visible in our development measurements as a high rate of repeated tokens, which the first reranker roughly halved. Later versions widened the shortlist to 24 and added the target-unembedding transition.
On our development set the submitted version reached a mean of 3.70, against 3.09 for our own reproduction of PARD. An ablation that disabled one component at a time in the trained drafter, without retraining, gave 3.22 without the reranker, 3.49 without its local transition and repetition terms, 3.63 without the linear highway, 3.65 without the target-unembedding transition, 3.67 without the adapters' nonlinear path and 3.68 without the attention over earlier positions. In a live end-to-end benchmark of our own we measured a speed-up of 2.22 with graph capture and 1.71 without it; these are our development measurements, on our own data and timing harness.
Limitations
- Accepted tokens do not become wall-clock speed. SD-TARD has the longest acceptance length on Math and Chat, but on Speed-up it is behind four baselines on the first speed-up measure and six on the second. A backbone this deep in the block path, and a reranker that is sequential over positions, make each round expensive; the method as submitted trades too much drafting time for acceptance.
- The priced path is unmeasured. The survival calibrator and the submission-length rule act only when verification is priced, and this run has no value on any priced setting, so that part of the design is untested here.
- The ablations are not retrained. Our component ablation switches components off in one trained drafter; a drafter trained without a component could compensate, so the figures bound the contribution of each part only loosely, and they come from our own development data.
- Training and inference of the reranker differ. The reranker is trained with the true previous token as predecessor but at inference conditions on a soft choice over candidates; errors early in the block are not part of its training distribution.
- Many constants are hand-set. Injection depths and scales, stream priors, loss weights, slot decay and the reranker temperature were chosen during development and are not derived.
References
- Tianle Cai, Yuhong Li, Zhengyang Geng et al. (2024). Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads. ICML.
- Yuhui Li, Fangyun Wei, Chao Zhang et al. (2025). EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test. NeurIPS.
- Jinze Li, Yixing Xu, Haiduo Huang et al. (2025). Gumiho: A Hybrid Architecture to Prioritize Early Tokens in Speculative Decoding. ICML.
- Zihao An, Huajun Bai, Ziqiong Liu et al. (2026). PARD: Accelerating LLM Inference with Low-Cost PARallel Draft Model Adaptation. ICLR.
- Jian Chen, Yesheng Liang, Zhijian Liu (2026). DFlash: Block Diffusion for Flash Speculative Decoding. ICML.
- Xin Cheng, Xingkai Yu, Chenze Shao et al. (2026). DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation.
- Jianuo Huang, Yaojie Zhang, Qituan Zhang et al. (2026). Domino: Decoupling Causal Modeling from Autoregressive Drafting in Speculative Decoding.