DeepSpec is a full-stack codebase for training and evaluating draft models for speculative decoding. It contains data preparation utilities, draft model implementations, training code, and evaluation scripts.
EnvironmentInstall the Python dependencies:
python -m pip install -r requirements.txt
Data preparation additionally requires an inference engine to serve the target model when regenerating answers; see scripts/data/README.md for details.
WorkflowRun the stages in order — each stage's output feeds the next:
See scripts/data/README.md for the step-by-step data pipeline:
Qwen/Qwen3-4B setting).bash scripts/train/train.sh
train.sh launches train.py, which spawns one worker per visible GPU. Select the algorithm and target model by pointing config_path at one of the configs under config/ (e.g. config/dspark/dspark_qwen3_4b.py); see the script header for the full list of configs, how to override config_path / target_cache_dir, and how to use --opts to override individual config fields. Checkpoints are written to ~/checkpoints/<project_name>/<exp_name>/step_*.
Hardware: the default configs and scripts assume a single node with 8 GPUs. For fewer GPUs, reduce CUDA_VISIBLE_DEVICES.
bash scripts/eval/eval.sh
eval.sh runs eval.py against a trained draft checkpoint over the speculative-decoding benchmarks in eval_datasets/ (gsm8k, math500, aime25, humaneval, mbpp, livecodebench, mt-bench, alpaca, arena-hard-v2). Set:
target_name_or_path — the target model the draft was trained against (e.g. Qwen/Qwen3-4B),draft_name_or_path — the draft checkpoint, e.g. ~/checkpoints/deepspec/dspark_block7_qwen3_4b/step_latest, or one of the Hugging Face repo IDs listed in Released Checkpoints.The checkpoints below are the ones used for Table 1 in the paper. Each checkpoint was trained on open-perfectblend data generated by its corresponding target model in non-thinking mode, and is the direct output of the corresponding training configuration under config/.
| Algorithm | Qwen/Qwen3-4B |
Qwen/Qwen3-8B |
Qwen/Qwen3-14B |
google/gemma-4-12B-it |
|---|---|---|---|---|
| Eagle3 | deepseek-ai/eagle3_qwen3_4b_ttt7 | deepseek-ai/eagle3_qwen3_8b_ttt7 | deepseek-ai/eagle3_qwen3_14b_ttt7 | deepseek-ai/eagle3_gemma4_12b_ttt7 |
| DFlash | deepseek-ai/dflash_qwen3_4b_block7 | deepseek-ai/dflash_qwen3_8b_block7 | deepseek-ai/dflash_qwen3_14b_block7 | deepseek-ai/dflash_gemma4_12b_block7 |
| DSpark | deepseek-ai/dspark_qwen3_4b_block7 | deepseek-ai/dspark_qwen3_8b_block7 | deepseek-ai/dspark_qwen3_14b_block7 | deepseek-ai/dspark_gemma4_12b_block7 |
Important
If you cite these results in a new paper, align your setup with the training settings in this repository; otherwise, the comparison is not meaningful. For domain-specific use, fine-tune the draft model again for better results, especially if the target model is expected to run in thinking mode.
Currently, DeepSpec includes three draft models: DSpark, DFlash and Eagle3.
LicenseDeepSpec is released under the MIT License. It includes code adapted from third-party projects under their own licenses; see NOTICE for the full attribution.
AcknowledgementsDeepSpec builds on the ideas and code of several excellent open-source projects:
We thank the authors and maintainers of these projects. Contributions of new algorithms are welcome.
Citation@misc{cheng2026dsparkconfidencescheduledspeculativedecoding, title={DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation}, author={Xin Cheng and Xingkai Yu and Chenze Shao and Jiashi Li and Yunfan Xiong and Yi Qian and Jiaqi Zhu and Shirong Ma and Xiaokang Zhang and Jiasheng Ye and Qinyu Chen and Chengqi Deng and Jiping Yu and Damai Dai and Zhengyan Zhang and Yixuan Wei and Yixuan Tan and Wenkai Yang and Runxin Xu and Yu Wu and Zhean Xu and Xuanyu Wang and Muyang Chen and Rui Tian and Xiao Bi and Zhewen Hao and Shaoyuan Chen and Huanqi Cao and Wentao Zhang and Anyi Xu and Huishuai Zhang and Dongyan Zhao and Wenfeng Liang}, year={2026}, eprint={2607.05147}, archivePrefix={arXiv}, primaryClass={cs.AI}, url={https://arxiv.org/abs/2607.05147}, }
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | DeepSeek-V3 Model: Theory, Config, and Rotary Positional Embeddings | 0 | 22.5 | 12-03-2026 |
| 2 | Pymetrica: A Codebase Analysis Tool | 0 | 10 | 15-05-2026 |
| 3 | pytrendy: Trend Detection in Time Series Data | 0 | 10 | 20-06-2026 |
| 4 | StegoForge: Zero-Dependency Python Steganography | 0 | 35 | 07-05-2026 |
| 5 | MO-Gymnasium - environments for reinforcement learning | 0 | 26.67 | 19-07-2026 |
| 6 | whichllm - поиск лучшей LLM модели под оборудование | 0 | 10 | 08-06-2026 |
| 7 | supertree: Decision Tree Visualization | 0 | 10 | 13-07-2026 |
| 8 | pyStrich: 1D and 2D Barcode Generator Library | 0 | 10 | 18-07-2026 |
| 9 | tsauditor: Statistical Auditor for Temporal Data Leakage | 0 | 10 | 03-08-2026 |
| 10 | presidio: Detect, Redact, & Anonymize Sensitive Data (PII) | 0 | 10 | 25-05-2026 |