Views
No views yet
speculators format, DSparkDraftModel) that proposes tokens for the Gemma-4 26B-A4B target. It is loaded on top of the base model as a vLLM speculative-config and accelerates greedy/low-temperature decoding without changing the target's output distribution (lossless rejection sampling).markov_rank=256) so each of the 7 block positions can condition on the tokens already sampled within the block, and[3, 10, 18, 25, 28] (vLLM auto-appends the final layer). It was trained on-policy — prompts from a diverse 37-dataset corpus, with responses regenerated by the Gemma-4 target itself — so the acceptance numbers below are honest, serve-time (autoregressive) measurements rather than teacher-forced.| Target (verifier) | google/gemma-4-26B-A4B-it |
| Draft params | ~1.2B (bf16) |
| Draft layers | 5 (block_size=7) |
| Target layer IDs | 3, 10, 18, 25, 28 |
| Draft vocab | 32,000 (mapped to the target's 262,144) |
| Extra heads | Markov (rank 256, vanilla) + confidence |
| Default proposal | greedy, num_speculative_tokens=6 |
makora greedy-400 is an in-domain accept-length probe. A representative subset of training-data scales is shown.| train prompts | offline val accept-len @ckpt | served in-domain accept-len | served MATH-500 accept-len (C1 / C4) | MATH-500 tok/s (C1 / C4 agg) |
|---|---|---|---|---|
| 50,000 | 3.684 | 2.825 | 1.60 / 1.60 | 231 / 730 |
| 100,000 | 3.964 | 2.366 | 1.86 / 1.90 | 268 / 886 |
| 200,000 | 4.098 | 2.857 | 3.11 / 3.14 | 442 / 1304 |
| 400,000 | 4.079 | 3.157 | 3.98 / 4.08 | 568 / 1875 |
| 600,000 (this checkpoint) | 4.237 | 3.101 | 3.97 / 4.10 | 566 / 1866 |
vllm:spec_decode_num_accepted_tokens... /metrics deltas), i.e. the number you actually get in deployment. Mean accept-length ≈ 1 + accepted/drafts.dspark speculative method), not by transformers directly — it has no lm_head/embeddings of its own and only produces drafts for the target to verify. Load the base model normally and point vLLM's speculative config at this repo; vLLM reads the DSpark config (algorithm, num_speculative_tokens, and the target layer IDs to extract) from config.json automatically.VLLM_USE_FLASHINFER_SAMPLER=0 (the FlashInfer sampler JIT needs nvcc on PATH; disabling it selects the precompiled FLASH_ATTN + Triton MoE path).1export HF_TOKEN=hf_... # both repos may be gated
2export VLLM_USE_FLASHINFER_SAMPLER=0
3
4vllm serve google/gemma-4-26B-A4B-it \
5 --speculative-config '{"model": "makora-ai/gemma4-26b-a4b-dspark", "num_speculative_tokens": 6}' \
6 --max-model-len 8192 \
7 --port 80001curl http://127.0.0.1:8000/v1/chat/completions \
2 -H 'Content-Type: application/json' \
3 -d '{
4 "model": "google/gemma-4-26B-A4B-it",
5 "messages": [{"role": "user", "content": "What is 17*23? Think step by step."}],
6 "temperature": 1.0, "top_p": 0.95, "top_k": 64,
7 "max_tokens": 512
8 }'curl http://127.0.0.1:8000/metrics | grep spec_decode.1from vllm import LLM, SamplingParams
2
3# The DSpark head is attached to the base target as a speculative draft.
4llm = LLM(
5 model="google/gemma-4-26B-A4B-it",
6 speculative_config={
7 "model": "makora-ai/gemma4-26b-a4b-dspark",
8 "num_speculative_tokens": 6,
9 },
10 max_model_len=8192,
11)
12
13messages = [{"role": "user", "content": "What is 17*23? Think step by step."}]
14sampling = SamplingParams(temperature=1.0, top_p=0.95, top_k=64, max_tokens=512)
15
16out = llm.chat(messages, sampling)
17print(out[0].outputs[0].text)speculators library (>= 0.7.0.dev69), e.g. for verification or re-serving:1from speculators import SpeculatorModel
2
3draft = SpeculatorModel.from_pretrained("makora-ai/gemma4-26b-a4b-dspark")
4print(draft.config) # DSparkSpeculatorConfig: block_size=7, markov_rank=256, ...