SpecForge: A Flexible and Efficient Open-Source Training Framework for Speculative Decoding

Shenggui Li, Chao Wang, Yikai Zhu, Yubo Wang, Fan Yin, Shuai Shi, Yefei Chen, Xiaomin Dong, Qiaoling Chen, Jin Pan, Ji Li, Yineng Zhang, Lei Yu, Yonggang Wen, Ivor Tsang, Tianwei Zhang

Introduction

Large Language Model (LLM) inference is notoriously "memory-bound." The primary bottleneck is not raw compute power, but the time required to move billions of parameters from memory to the processor for every single generated token. Speculative decoding (SD) mitigates this by using a tiny, lightweight "draft" model to guess several tokens ahead. The massive "target" model then verifies these guesses in a single parallel batch, drastically speeding up generation.

Despite its potential, real-world adoption of speculative decoding has been hindered by a lack of high-quality draft models and scalable training infrastructure. To address this, researchers introduce SpecForge, a high-performance, open-source framework designed to solve the "asymmetry problem" in speculative decoding training. Alongside the framework, the authors release SpecBundle, a suite of production-grade draft models that deliver up to 4.48x faster inference for popular LLMs.

The Challenge: Asymmetry in Speculative Decoding

Training draft models for speculative decoding presents three major hurdles:

  1. Draft Scarcity: High-quality draft models simply do not exist for many of today's most popular open-source LLMs.
  2. Training Inefficiency: Current tools attempt to train the tiny draft model and the massive target model using the same distributed training strategy (e.g., DeepSpeed or FSDP). This is highly inefficient because the massive target model is frozen and requires inference-style optimization, while the draft model requires training-style optimization.
  3. Quality Gaps: Existing open-source drafts are often trained on limited data, leading to low "acceptance rates"—the percentage of guessed tokens that the target model actually accepts.

SpecForge: System-Level Innovations

SpecForge reimagines the training pipeline by decoupling the target and draft models, allowing each to operate with optimal efficiency.

  • Target–Draft Decoupling: Instead of wrapping both models in a single training module, SpecForge uses a production inference engine (SGLang) to run the target model, while relying on a standard training framework (FSDP) for the draft model. This allows the target model to leverage inference optimizations like Tensor Parallelism and CUDA Graphs, while the draft model focuses purely on gradient updates.
  • TTT Optimizations: State-of-the-art SD methods like EAGLE-3 use "Training-Time Test" (TTT) to simulate multi-step guessing during training. SpecForge optimizes this process using Sparse Tree Attention (via PyTorch’s FlexAttention) and custom Triton kernels for memory-efficient gradient computation. This reduces activation memory by up to 80%.
  • Hybrid Parallelism: The framework supports "disaggregated training," meaning the target and draft models can reside on entirely different GPUs or utilize different sharding strategies to maximize hardware utilization.

Training Recipes and Key Insights

To train the SpecBundle models, the researchers utilized Open-PerfectBlend, a dataset of 1.4 million conversations spanning chat, math, coding, and instruction-following. Through their experiments, they distilled several actionable insights for the community:

  • Data Regeneration is Crucial: The team found that "cleaning" the dataset by regenerating assistant responses using the target model (at a temperature of 0.8) significantly boosted the final draft model's quality.
  • Dense > MoE for Drafts: Interestingly, dense draft models consistently outperformed Mixture-of-Experts (MoE) drafts. The researchers attribute this to the relatively small size of SD datasets, which leaves individual "experts" in an MoE draft under-trained.
  • The TTT Sweet Spot: While simulating more steps during training (a longer TTT length) improves draft accuracy, it yields diminishing returns and can eventually slow down inference by making the drafting phase too computationally expensive. The authors recommend a TTT length of 7–11 for most tasks.

Key Results

Evaluated across a rigorous battery of benchmarks (Math500, GSM8K, HumanEval, LiveCodeBench, GPQA, MTBench, and FinanceQA), SpecForge and SpecBundle demonstrated massive improvements in both training and inference:

  • Training Speed: SpecForge achieved up to a 9.99x speedup in training throughput for the massive Qwen3-235B model compared to standard baselines.
  • Inference Speed: The SpecBundle draft models provided substantial end-to-end speedups on SGLang, including:
  • 4.48x for Llama-4-Scout on coding tasks.
  • 2.72x for Llama-3.1-8B.
  • 2.38x for Qwen-235B.
  • Memory Efficiency: SpecForge's optimized kernels reduced peak memory usage for attention by 93.5% and for loss computation by 23.3%.

Limitations and Future Work

The current SpecBundle release focuses primarily on "instruct" (chat) models. Moving forward, the authors plan to extend this framework to support reasoning models (such as o1-style architectures) and Vision-Language Models (VLMs).

Additionally, the current TTT length is fixed during training. The researchers suggest that developing adaptive, sample-dependent TTT strategies—where the model simulates more steps for complex prompts and fewer for simple ones—could further optimize the pipeline from training to inference.

Summary updated

BibTeX
@inproceedings{li2026specforge,
  author = {Shenggui Li and Chao Wang and YIKAI ZHU and Yubo Wang and Fan Yin and Shuai Shi and Yefei Chen and Xiaomin Dong and Qiaoling Chen and Jin Pan and Ji Li and Yineng Zhang and Lei Yu and Yonggang Wen and Ivor Tsang and Tianwei Zhang},
  title = {{SpecForge: A Flexible and Efficient Open-Source Training Framework for Speculative Decoding}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=CQOEbxy0tE},
}
Figure