SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.18394 · 2026

JETSPEC: Breaking the Scaling Ceiling of Speculative Decoding with Parallel Tree Drafting

Uc Diego, Hao Zhang, Yibo Zhu, Daxin Jiang, Peng Zhao, Lanxiang Hu, Yulun Wu, Yu-Yang Qian, Yujie Zhao, Haoran Yuan, Tajana Rosing, Zhaoxiang Feng, and 1 more

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 3 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2606.18394.json · badge: /api/ran/2606.18394.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hao-ai-lab/JetSpec canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
build_target_layer_ids Ran
ran, honoured the contract we drafted
hao-ai-lab/JetSpec/jetspec/models/draft_head.py
pointer only (licence: MIT); the stored copy get_code serves, from ETH-DISCO/TreeFlash, is pointer only (licence: NONE) · get_code("0dc744c2b2fb89e2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ETH-DISCO/TreeFlash, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_context_feature Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hao-ai-lab/JetSpec/jetspec/models/draft_head.py
code served (permissive licence) · get_code("849f62ca5aaec4f3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects:
# - hidden_states: a sequence (list or tuple) of tensors, indexed by layer_id + 1
# - layer_ids: a list of integers representing which layers to extract
#
# Each tensor in hidden_states should have shape (B, T, H) where:
#   B = batch size
#   T = sequence length
#   H = hidden dimension
#
# The function concatenates selected layers along dim=-1

# Create mock hidden_states as a list of tensors
# Index 0 is embedding output (not used when layer_ids start from 0)
# Indices 1+ correspond to layer 0, 1, 2, etc.
batch_size = 2
seq_length = 3
hidden_dim = 4

hidden_states = [
    torch.randn(batch_size, seq_length, hidden_dim),  # index 0: embedding output
    torch.randn(batch_size, seq_length, hidden_dim),  # index 1: layer 0
    torch.randn(batch_size, seq_length, hidden_dim),  # index 2: layer 1
    torch.randn(batch_size, seq_length, hidden_dim),  # index 3: layer 2
]

# Select layers 0 and 1 (which are at indices 1 and 2 in hidden_states)
layer_ids = [0, 1]

ARGS = {
    "hidden_states": hidden_states,
    "layer_ids": layer_ids,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_cache Ran
ran; our contract draft was wrong, not the code
hao-ai-lab/JetSpec/jetspec/core/llm.py
code served (permissive licence) · get_code("959beaaaec24abb5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DynamicCache. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from transformers import DynamicCache

torch.manual_seed(0)

class MockConfig:
    def __init__(self, num_hidden_layers=4):
        self.num_hidden_layers = num_hidden_layers

class MockModel(nn.Module):
    def __init__(self, num_hidden_layers=4):
        super().__init__()
        self.config = MockConfig(num_hidden_layers=num_hidden_layers)
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = MockModel(num_hidden_layers=4)

ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DynamicCache — a DynamicCache output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DynamicCache output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
patch_qwen3_moe_with_grouped_mm Ran
ran, honoured the contract we drafted
hao-ai-lab/JetSpec/jetspec/models/moe_fused.py
code served (permissive licence) · get_code("75a703e2b26ce8f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import types

torch.manual_seed(0)

# Build a minimal mock Qwen3MoeSparseMoeBlock-compatible model
class MockExpert(nn.Module):
    def __init__(self, hidden_dim, intermediate_dim):
        super().__init__()
        self.gate_proj = nn.Linear(hidden_dim, intermediate_dim)
        self.up_proj = nn.Linear(hidden_dim, intermediate_dim)
        self.down_proj = nn.Linear(intermediate_dim, hidden_dim)

class MockQwen3MoeSparseMoeBlock(nn.Module):
    def __init__(self, hidden_dim, num_experts, top_k, intermediate_dim):
        super().__init__()
        self.hidden_dim = hidden_dim
        self.num_experts = num_experts
        self.top_k = top_k
        self.norm_topk_prob = True
        self.gate = nn.Linear(hidden_dim, num_experts)
        self.experts = nn.ModuleList([
            MockExpert(hidden_dim, intermediate_dim)
            for _ in range(num_experts)
        ])

class MockQwen3Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.hidden_dim = 8
        self.num_experts = 3
        self.top_k = 2
        self.intermediate_dim = 12
        
        # Create a sparse MoE block
        self.moe_block = MockQwen3MoeSparseMoeBlock(
            self.hidden_dim,
            self.num_experts,
            self.top_k,
            self.intermediate_dim
        )

# Patch the mock class into transformers.models.qwen3_moe.modeling_qwen3_moe
# so the function can import it
import sys
from types import ModuleType

qwen3_module = ModuleType('transformers.models.qwen3_moe.modeling_qwen3_moe')
qwen3_module.Qwen3MoeSparseMoeBlock = MockQwen3MoeSparseMoeBlock

sys.modules['transformers'] = ModuleType('transformers')
sys.modules['transformers.models'] = ModuleType('transformers.models')
sys.modules['transformers.models.qwen3_moe'] = qwen3_module

# Create model instance
model = MockQwen3Model()

ARGS = {
    'model': model,
    'free_original_experts': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
resolve_attn_implementation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hao-ai-lab/JetSpec/jetspec/models/qwen3.py
code served (permissive licence) · get_code("7b4ffc559096788f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# The function only takes a single string parameter
# and performs conditional logic based on its value.
# No complex objects are needed.

ARGS = {
    'attn_implementation': 'auto'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flash_attn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sample Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hao-ai-lab/JetSpec/jetspec/core/sampler.py
pointer only (licence: MIT); the stored copy get_code serves, from Tencent/AngelSlim, is pointer only (licence: NOASSERTION) · get_code("ab21ebd92ac6698e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Tencent/AngelSlim, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_rotary_pos_emb Not yet run
unverified (harvested, no recorded run)
hao-ai-lab/JetSpec/jetspec/models/draft_head.py
code served (permissive licence) · get_code("517fb615df4dde0c")
How it ran

no invocation recorded.

load_target Not yet run
unverified (harvested, no recorded run)
hao-ai-lab/JetSpec/jetspec/models/qwen3.py
code served (permissive licence) · get_code("01320653ae0cb250")
How it ran

no invocation recorded.

make_static_cache Not yet run
unverified (harvested, no recorded run)
hao-ai-lab/JetSpec/jetspec/core/llm.py
code served (permissive licence) · get_code("aecc93e83807dfcf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 3 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
apply_rotary_pos_emb 2 other papers
2 the same month · 1 only as an assembly brick
2606.02091 (2026-06)
DFLARE: Scaling Up Draft Capacity for Block Diffusion Speculative Decoding
2606.03819 (2026-06)
TreeFlash: Parallel AR-Approximation for Faster Speculative Decoding
build_target_layer_ids 1 other paper
1 the same month
2606.03819 (2026-06)
TreeFlash: Parallel AR-Approximation for Faster Speculative Decoding
sample 1 other paper
1 the same month
2606.02091 (2026-06)
DFLARE: Scaling Up Draft Capacity for Block Diffusion Speculative Decoding

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Speculative decoding (SD) accelerates autoregressive Large Language Models (LLMs) by drafting multiple tokens and verifying them in parallel, but it faces a scaling limitation: increasing the draft budget improves speed only when acceptance remains high and drafting overhead stays low. This ceiling has been difficult to break because prior head-based SD methods face a causality-efficiency dilemma. Autoregressive drafters produce path-conditioned candidates that are effective for tree speculative decoding with higher acceptance length, but their drafting cost grows with tree depth. Bidirectional block-diffusion drafters generate all positions in one pass, but their branch-agnostic marginals can form individually plausible yet mutually inconsistent trees, wasting budget and reducing acceptance. We propose JETSPEC, a head-based SD framework that combines one-forward drafting efficiency with branch-wise causal conditioning. JetSpec trains a causal parallel draft head using fused hidden states from the frozen target model, producing candidate trees whose scores align with the target model's autoregressive factorization. This enables JetSpec to convert larger draft budgets into longer accepted prefixes and higher end-to-end speedup. Across math, coding, and chat benchmarks on dense and MoE Qwen3 models, JetSpec consistently outperforms bidirectional-head and tree-based SD baselines. On H100 GPUs, JetSpec achieves up to 9.64× speedup on MATH-500 and 4.58× on open-ended conversational workloads, with further latency gains demonstrated through vLLM integration under realistic serving loads. Our code and models are available at https://github.com/hao-ai-lab/JetSpec.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2606.18394")
get_code_for_paper("2606.18394")
have("2606.18394")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2606.18394.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2606.18394.svg)](https://syntology.ai/paper/2606.18394)

Connect an agent — have() is free.