Qwen3-4B DSpark Speculator (Block Size 16, "PerfectBlend" 8-subset mix)
This repository contains a DSpark speculative decoding draft model trained for
Qwen/Qwen3-4B. It proposes up to 16
tokens per decoding iteration and is intended for use with the
vllm-project/speculators
implementation and vLLM.
This is an experimental checkpoint from a data-ablation series. It was trained
on an 8-file blend ("perfect blend") of the
inference-optimization/Qwen3-8B-Regenerated-Collection
dataset — everything in the 13-file collection except tulu3, magpie,
nemotron_chat, nemotron_math, and nemotron_stem. The blend contains
regenerated responses from MetaMathQA, UltraInteract, UltraChat, Orca-Math,
UltraFeedback, evol-codealpaca, AutoIF, and lmsys-arena (~1.38M source rows,
roughly 49% of the full mixture token count), for ~2.7 epochs, matching the
compute budget of the tulu3-only run (252,775 vs 259,362 optimizer steps).
Model details
- Architecture: DSpark draft model
- Verifier:
Qwen/Qwen3-4B - Speculative block size: 16
- Draft transformer layers: 5
- Verifier hidden-state layers: 1, 9, 17, 25, 33
- Markov head: vanilla, rank 256
- Confidence head: enabled with Markov features
- Default proposal method: greedy
- Precision: bfloat16
- Draft vocabulary size: 151,936
- Parameters file size: 1.23 GB
Training
The model was trained from the speculators repository at commit
1c800f2b053bcd538fc11bf49ec843d4dfa81a95 with vLLM 0.31.0.
- Data: 8-file blend of
Qwen3-8B-Regenerated-Collection— 1,382,562 source lines (1 row dropped from evol_codealpaca for an error-metadata field) → 1,382,556 prepared rows (~4.2B tokens, mean sequence length ~3,056)- metamathqa (394,996), ultrainteract (288,578), orca_math (200,034), ultrachat (207,863), evol_codealpaca (111,099), autoif (61,491), lmsys_arena (57,361), ultrafeedback (61,134)
- Epochs: ~2.7 (capped by
--max-steps) — 252,775 global steps - World size: 6
- Sequence length: 8,192 (multipacked), max anchors 1,024
- Optimizer: Muon (Muon LR 3e-3)
- Learning rate: 6e-4
- Weight decay: 0
- Scheduler: cosine with 4% warmup
- Seed: 42
- Loss:
0.1 * CE + 0.9 * TV, fused implementation - Position weighting: fixed exponential decay, gamma 7.0
- Wall time: ~2d 9h on 6× GPUs (plus render server on 2× GPUs)
The complete invocation is included in train_command.txt. Per-epoch
validation metrics are archived in val_metrics_history/.
Final validation metrics (epoch 2, blend val split)
| Metric | Value |
|---|---|
| Loss | 0.3044 |
| Acceptance rate | 0.6727 |
| Acceptance length | 7.1007 |
| Full accuracy | 0.6915 |
Note: the validation split is a random 10% of this run's own (blend) data, so these values are not comparable across runs trained on different subsets.
Speculator benchmark results
The checkpoint was evaluated with the speculator_benchmarks acceptance eval
(9 subsets, temperature 0 and Qwen3-4B default sampling, maximum generation
length 128, up to ~200-400 requests per category), serving with
vllm serve Qwen/Qwen3-4B --spec-model <this checkpoint> --spec-tokens 16 --spec-method dspark.
Temperature 0 (greedy)
| Category | Acceptance length |
|---|---|
| HumanEval | 5.831 |
| Math reasoning | 7.696 |
| QA | 3.528 |
| Question | 4.430 |
| RAG | 4.669 |
| Summarization | 3.665 |
| Tool call | 4.100 |
| Translation | 5.093 |
| Writing | 4.454 |
| Weighted overall | 4.610 |
Qwen3-4B default sampling (temp 0.6 / top_p 0.95 / top_k 20)
| Category | Acceptance length |
|---|---|
| HumanEval | 5.691 |
| Math reasoning | 7.323 |
| QA | 3.475 |
| Question | 4.197 |
| RAG | 4.509 |
| Summarization | 3.646 |
| Tool call | 4.061 |
| Translation | 4.737 |
| Writing | 4.331 |
| Weighted overall | 4.487 |
The weighted overall is computed as
1 + total accepted speculative tokens / total draft iterations. Full
per-position results: acceptance_temp0.csv, acceptance_defaulttemp.csv.
Comparison within the data-ablation series
All three runs share the same recipe (block 16, Muon 3e-3, CE+TV 0.1/0.9, cosine, seed 42, 6 ranks) and approximately the same compute budget (228k–259k optimizer steps); only the data mixture differs.
| Run | Data | Steps | Temp 0 | Default sampling |
|---|---|---|---|---|
| full-mix b16 | all 13 files, 1 epoch | 228,135 | 4.689 | 4.594 |
| perfectblend b16 (this) | 8-file blend, ~2.7 epochs | 252,775 | 4.610 | 4.487 |
| tulu3 b16 | tulu3 only, 4 epochs | 259,361 | 4.611 | 4.501 |
The 8-file blend and the tulu3-only subset tie within noise at temp 0 (4.610 vs 4.611); neither approaches the full mixture (+1.7%). Per-subset results do track the training mix: perfectblend is the best of the three on HumanEval (5.83, code-heavy evol_codealpaca in the mix) and strong on math reasoning (7.70, metamathqa + orca_math ≈ 595k rows), while tulu3 leads on qa/question/rag.
Usage
Use this repository as the speculative model for Qwen/Qwen3-4B through a
version of vLLM and speculators that supports DSpark (speculators
0.10.0a0, vLLM 0.31.0). The verifier model and tokenizer must remain
Qwen/Qwen3-4B, and the configured speculative-token count is 16:
vllm serve Qwen/Qwen3-4B \
--spec-model MeganEFlynn/Qwen3-4B-speculator-perfectblend-b16.dspark \
--spec-tokens 16 --spec-method dspark
Limitations
- This is a research checkpoint for speculative decoding, not a standalone language model.
- It inherits the behavior, limitations, and license considerations of the verifier model.
- Acceptance and speedup depend on prompts, hardware, batch size, vLLM version, and serving configuration.
- Trained on an 8-subset blend; acceptance on out-of-distribution domains may differ from the benchmark results above.