{"slug": "github-deepseek-ai-deepspec", "title": "GitHub DeepSeek-AI/DeepSpec", "summary": "DeepSeek-AI released DeepSpec, an open-source codebase for training and evaluating draft models for speculative decoding, supporting three draft model algorithms (DSpark, DFlash, Eagle3) and requiring up to 38 TB of storage for target cache preparation. The project, licensed under MIT, aims to accelerate inference by enabling efficient speculative decoding with target models like Qwen3 and Gemma.", "body_md": "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.\n\nInstall the Python dependencies:\n\n```\npython -m pip install -r requirements.txt\n```\n\nData preparation additionally requires an inference engine to serve the target model when regenerating answers; see [scripts/data/README.md](/deepseek-ai/DeepSpec/blob/main/scripts/data/README.md) for details.\n\nRun the stages in order — each stage's output feeds the next:\n\n**Data Preparation**— download prompts, regenerate target answers, and build the target cache.** Training**— train a draft model against the cached target outputs.** Evaluation**— measure speculative-decoding acceptance on benchmark tasks.\n\nSee [scripts/data/README.md](/deepseek-ai/DeepSpec/blob/main/scripts/data/README.md) for the step-by-step data pipeline:\n\n- download and split training data,\n- regenerate answers,\n- prepare the target cache (storage warning: this can be very large — roughly 38 TB for the default\n`Qwen/Qwen3-4B`\n\nsetting).\n\n```\nbash scripts/train/train.sh\n```\n\n`train.sh`\n\nlaunches `train.py`\n\n, which spawns one worker per visible GPU. Select the algorithm and target model by pointing `config_path`\n\nat one of the configs under [config/](/deepseek-ai/DeepSpec/blob/main/config) (e.g. `config/dspark/dspark_qwen3_4b.py`\n\n); see the script header for the full list of configs, how to override `config_path`\n\n/ `target_cache_dir`\n\n, and how to use `--opts`\n\nto override individual config fields. Checkpoints are written to `~/checkpoints/<project_name>/<exp_name>/step_*`\n\n.\n\nHardware: the default configs and scripts assume a single node with 8 GPUs. For fewer GPUs, reduce `CUDA_VISIBLE_DEVICES`\n\n.\n\n```\nbash scripts/eval/eval.sh\n```\n\n`eval.sh`\n\nruns `eval.py`\n\nagainst a trained draft checkpoint over the speculative-decoding benchmarks in [eval_datasets/](/deepseek-ai/DeepSpec/blob/main/eval_datasets) (gsm8k, math500, aime25, humaneval, mbpp, livecodebench, mt-bench, alpaca, arena-hard-v2). Set:\n\n`target_name_or_path`\n\n— the target model the draft was trained against (e.g.`Qwen/Qwen3-4B`\n\n),`draft_name_or_path`\n\n— the draft checkpoint, e.g.`~/checkpoints/deepspec/dspark_block8_qwen3_4b/step_latest`\n\n.\n\nCurrently, DeepSpec includes three draft models: [DSpark](/deepseek-ai/DeepSpec/blob/main/DSpark_paper.pdf), [DFlash](https://arxiv.org/abs/2602.06036) and [Eagle3](https://arxiv.org/abs/2503.01840).\n\nDeepSpec is released under the [MIT License](/deepseek-ai/DeepSpec/blob/main/LICENSE). It includes code adapted\nfrom third-party projects under their own licenses; see [NOTICE](/deepseek-ai/DeepSpec/blob/main/NOTICE) for the\nfull attribution.\n\nDeepSpec builds on the ideas and code of several excellent open-source projects:\n\n[SpecForge](https://github.com/sgl-project/SpecForge)(Apache-2.0) — the overall training framework and Eagle3 implementation; portions of the Eagle3 modeling, loss, optimizer, attention, and evaluation code are adapted from it. Adapted files carry an in-file attribution comment, and the full notice is recorded in[NOTICE](/deepseek-ai/DeepSpec/blob/main/NOTICE).[DFlash](https://github.com/z-lab/dflash)(MIT) — the DFlash draft-model design and training recipe.[Qwen3](https://github.com/QwenLM/Qwen3)and[Gemma](https://github.com/google-deepmind/gemma)— the target model families supported in this repo.\n\nWe thank the authors and maintainers of these projects. Contributions of new algorithms are welcome.", "url": "https://wpnews.pro/news/github-deepseek-ai-deepspec", "canonical_source": "https://github.com/deepseek-ai/DeepSpec", "published_at": "2026-06-27 20:16:41+00:00", "updated_at": "2026-06-27 20:34:49.573883+00:00", "lang": "en", "topics": ["machine-learning", "ai-research", "ai-tools", "large-language-models", "developer-tools"], "entities": ["DeepSeek-AI", "DeepSpec", "DSpark", "DFlash", "Eagle3", "Qwen3", "Gemma", "SpecForge"], "alternates": {"html": "https://wpnews.pro/news/github-deepseek-ai-deepspec", "markdown": "https://wpnews.pro/news/github-deepseek-ai-deepspec.md", "text": "https://wpnews.pro/news/github-deepseek-ai-deepspec.txt", "jsonld": "https://wpnews.pro/news/github-deepseek-ai-deepspec.jsonld"}}