Views
No views yet

Qwen/Qwen3-4B. The draft model is not intended to be used as a standalone language model; it should be paired with the target model during generation.Qwen/Qwen3-4BHuang2020/Qwen3-4B-Domino-b1616spec_generate pathuv pip install "git+https://github.com/jianuo-huang/sglang.git@feat/domino-tensor-parallel#subdirectory=python"1sglang serve \
2 --model-path Qwen/Qwen3-4B \
3 --speculative-algorithm DFLASH \
4 --speculative-draft-model-path Huang2020/Qwen3-4B-Domino-b161from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer
2
3draft = AutoModel.from_pretrained(
4 "Huang2020/Qwen3-4B-Domino-b16",
5 trust_remote_code=True,
6 torch_dtype="auto",
7 device_map="cuda:0",
8).eval()
9
10target = AutoModelForCausalLM.from_pretrained(
11 "Qwen/Qwen3-4B",
12 torch_dtype="auto",
13 device_map="cuda:0",
14).eval()
15
16tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B")
17messages = [{
18 "role": "user",
19 "content": "How many positive whole-number divisors does 196 have?",
20}]
21input_ids = tokenizer.apply_chat_template(
22 messages,
23 return_tensors="pt",
24 return_dict=False,
25 add_generation_prompt=True,
26 enable_thinking=False,
27).to(draft.device)
28
29output = draft.spec_generate(
30 input_ids=input_ids,
31 target=target,
32 max_new_tokens=2048,
33 temperature=0.0,
34 stop_token_ids=[tokenizer.eos_token_id],
35)
36
37generated = output[:, input_ids.shape[1]:]
38print(tokenizer.decode(generated[0], skip_special_tokens=True))
assets/speedup.pdf.1@article{huang2026domino,
2 title={Domino: Decoupling Causal Modeling from Autoregressive Drafting in Speculative Decoding},
3 author={Huang, Jianuo and Zhang, Yaojie and Zhang, Qituan and Lin, Hao and Xu, Hanlin and Zhang, Linfeng},
4 journal={arXiv preprint arXiv:2605.29707},
5 year={2026}
6}